Data -- Internal Tables

Import CSV

Imports data from a CSV file into a specified internal table in a given project.

This endpoint accepts a multipart/form-data request with two parts:

  • file: The CSV file to be imported.
  • request: A JSON string describing how the CSV columns map to the table's columns.

CSV file format can be get from /projects/{projectId}/table/{tableName}/sample.

Request JSON syntax

The request part must contain:

  • mappings: A list of objects, each with:
    • name: The name of the target column in the internal table.
    • Either csvColumnName or csvColumnIndex to define the corresponding column in the CSV.
  • containsHeader: A boolean indicating whether the CSV includes a header row.

Examples

With column names:

{
  "mappings": [
    { "name": "numcol", "csvColumnName": "numcol" },
    { "name": "text", "csvColumnName": "text" },
    { "name": "decimalcol", "csvColumnName": "decimalcol" }
  ],
  "containsHeader": true
}

With column indexes:

{
  "mappings": [
    { "name": "numcol", "csvColumnIndex": 0 },
    { "name": "text", "csvColumnIndex": 1 },
    { "name": "decimalcol", "csvColumnIndex": 2 }
  ],
  "containsHeader": false
}
  • When the CSV contains a header row (containsHeader: true), you can use either csvColumnName or csvColumnIndex.
  • When the CSV does not contain a header row (containsHeader: false), you must use csvColumnIndex.

Response

The endpoint currently runs synchronously and returns an ImportJob object with the job status and number of processed rows.

In future versions, this endpoint will return only the jobId, and the progress/result will be tracked via a separate job status endpoint: GET /jobs/{id}

post/data/projects/{projectId}/table/{tableName}/import

Request

  • Base URL: https://partner.peaka.studio/api/v1
  • URL: https://partner.peaka.studio/api/v1/data/projects/{projectId}/table/{tableName}/import
  • Auth: HTTP bearer

Path parameters

projectIdstring required

ID of the Project

tableNamestring required

Name of the table to import into

Response

Import job created successfully

Changes

No recorded changes to this operation across all 1 revision of this API.