All Collections
Versions 3.0 and 2.0
Implement
Workspaces
Can I upload data to a Flatfile Workspace via an API?
Can I upload data to a Flatfile Workspace via an API?
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

This article is for Flatfile's Workspaces. If you'd like to check out the latest version of the Flatfile Data Exchange Platform, click here!

Yes! You can insert data into a sheet in your Flatfile workspace using an API POST request.

In order to do this, you will need three things:

  1. A correct path to route the POST request.

  2. A valid API key.

  3. Correctly formatted JSON data

POST Request URL

To correctly route your POST request, you will need the workspace ID of the workspace that contains the sheet you are sending data to, and you will need the ID of the sheet you are working with. The post request URL will follow the format https://api.us.flatfile.io/workspace/{workspaceID}/sheet/{sheet}/data. For more information about this, you can view our REST API documentation.

JSON Data Formatting

You can see how your JSON data should be structured by clicking on Explore API in the sheet you are looking to populate.

mceclip0.png

In the Explore API expandable menu, you can enter data, see API access keys, and see helpful code examples. You can also see the way that data is structured in Flatfile.

mceclip1.png

All JSON data in Flatfile has the same basic structure. When the JSON contains data, it will look something like this:

{    "data": [        {            "internalId": "1",            "name": "Parent Company"        },        {            "internalId": "7",            "name": "Parent Company 2"        },        {            "internalId": "5",            "name": "Parent Company 3"        }    ]}

If you are importing data using an API, remember that the object containing the array of data must be called “data.”

Assuming your JSON is formatted correctly, you have the correct API key, and your POST URL is correct, you can upload data to a sheet using an API.

Did this answer your question?