Skip to content

Tables

Create table import

Create a CSV import. Upload sources receive signed transfer instructions; workspace-file sources start processing directly. OAuth scope: `api:write`.

POST/api/v2/tables/imports

Create a CSV import. Upload sources receive signed transfer instructions; workspace-file sources start processing directly.

OAuth scope: api:write.

Authentication

Send a personal or workspace API key in X-API-Key. See key types and access; operations that reject workspace keys say so in their description.

Send X-API-Key in the request header.

Alternatively

Send a Sim OAuth access token in Authorization: Bearer. See OAuth authentication and scopes.

Authorization: Bearer YOUR_ACCESS_TOKEN

Required scopes: api:write

OAuth flows
json
{
  "authorizationCode": {
    "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
    "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "scopes": {
      "api:read": "Read your workspaces, workflows, files, tables, and logs",
      "api:write": "Read, create, change, run, and delete resources in your workspaces",
      "offline_access": "Stay signed in without asking again"
    }
  }
}

OAuth scope: api:write.

Request body

Required

Workspace, CSV source, target table, optional mapping, and timezone.

object

Workspace, CSV source, target table, optional mapping, and timezone.

6 fields
workspaceIdstringRequired

Unique workspace identifier.

minLength
1
maxLength
128
sourcevalueRequired

CSV source for the import.

Schema details

Exactly one of

Option 1object

CSV file uploaded through signed transfer instructions.

4 fields
typestringRequired

Upload-backed import discriminator.

const
upload
namestringRequired

CSV filename.

minLength
1
maxLength
255
contentTypestringRequired

CSV MIME type.

minLength
1
maxLength
255
sizeintegerRequired

Exact CSV file size in bytes.

minimum
1
maximum
5368709120

Additional properties are not allowed.

Option 2object

Existing workspace file used as a CSV import source.

2 fields
typestringRequired

Workspace-file source discriminator.

const
workspace_file
fileIdstringRequired

Existing workspace file identifier.

minLength
1

Additional properties are not allowed.

targetvalueRequired

New or existing table import target.

Schema details

Exactly one of

Option 1object
3 fields
typestringRequired

Create-new-table target discriminator.

const
new
namestringRequired

Name of the table to create.

minLength
1
maxLength
128
pattern
^[A-Za-z_][A-Za-z0-9_]*$
folderPathstring

Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as "New folder" is /New%20folder: everything outside A-Z a-z 0-9 - _ . ~ is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal . or .. segment are rejected. At most 64 segments and 4096 encoded bytes.

maxLength
4096

Additional properties are not allowed.

Option 2object
3 fields
typestringRequired

Existing-table target discriminator.

const
existing
tableIdstringRequired

Existing target table identifier.

minLength
1
modestringRequired

Whether to append rows or replace existing rows.

enum
["append","replace"]

Additional properties are not allowed.

mappingobject

CSV headers mapped to existing table columns.

Schema details
Additional propertiesvalue
Schema details

Any of

Option 1string
minLength
1
maxLength
50
Option 2null
createColumnsarray

CSV headers for which new columns should be created.

maxItems
1000
Schema details
Array itemstring
minLength
1
maxLength
50
timezonestring

IANA timezone used to interpret local date values.

Additional properties are not allowed.

Request example 1

json
{
  "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
  "source": {
    "type": "upload",
    "name": "customers.csv",
    "contentType": "text/csv",
    "size": 2048
  },
  "target": {
    "type": "new",
    "name": "ImportedCustomers",
    "folderPath": "/Imports"
  },
  "timezone": "America/Los_Angeles"
}

Responses

201

The created table import and optional transfer instructions.

object

The import session and upload instructions when transfer is required.

1 field
dataV2CreateTableImportDataRequired

Response data.

Schema details

Any of

Option 1object
3 fields
sessionobjectRequired

Created upload-backed import session.

14 fields
idstringRequired

Unique table-import identifier.

workspaceIdstringRequired

Workspace that owns the import.

statusstringRequired

Current import lifecycle state.

enum
["uploading","processing","completed","failed","canceled","expired"]
sourceobjectRequired

Uploaded CSV source for this import.

4 fields
typestringRequired

Upload-backed import discriminator.

const
upload
namestringRequired

CSV filename.

minLength
1
maxLength
255
contentTypestringRequired

CSV MIME type.

minLength
1
maxLength
255
sizeintegerRequired

Exact CSV file size in bytes.

minimum
1
maximum
5368709120

Additional properties are not allowed.

targetvalueRequired

New or existing table import target.

Schema details

Exactly one of

Option 1object
3 fields
typestringRequired

Create-new-table target discriminator.

const
new
namestringRequired

Name of the table to create.

minLength
1
maxLength
128
pattern
^[A-Za-z_][A-Za-z0-9_]*$
folderPathstring

Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as "New folder" is /New%20folder: everything outside A-Z a-z 0-9 - _ . ~ is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal . or .. segment are rejected. At most 64 segments and 4096 encoded bytes.

maxLength
4096

Additional properties are not allowed.

Option 2object
3 fields
typestringRequired

Existing-table target discriminator.

const
existing
tableIdstringRequired

Existing target table identifier.

minLength
1
modestringRequired

Whether to append rows or replace existing rows.

enum
["append","replace"]

Additional properties are not allowed.

tableIdvalueRequired

Resulting or target table identifier.

Schema details

Any of

Option 1string
Option 2null
rowsProcessedintegerRequired

Rows processed so far.

minimum
0
maximum
9007199254740991
rowsRejectedintegerRequired

Minimum number of source records dropped by parser failures. One failure can discard multiple records, such as an unterminated quote consuming the rest of the file. A non-zero value means partial import even with completed status; zero does not guarantee no loss.

minimum
0
maximum
9007199254740991
cellsRejectedintegerRequired

Non-empty cell values the target column type could not represent. Their rows were imported with the cell left blank.

minimum
0
maximum
9007199254740991
rejectedSamplesarrayRequired

Bounded sample of the dropped records, for locating them in the source file.

Schema details
Array itemobject

One source record a table import could not read.

3 fields
codestringRequired

CSV parser error code, e.g. CSV_QUOTE_NOT_CLOSED.

linevalueRequired

1-based source line the parser had reached when it gave up, or null.

Schema details

Any of

Option 1integer
minimum
0
maximum
9007199254740991
Option 2null
messagestringRequired

Parser message for the dropped record.

Additional properties are not allowed.

errorvalueRequired

Terminal failure reason, or null.

Schema details

Any of

Option 1string
Option 2null
createdAtstringRequired

ISO 8601 creation timestamp.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
updatedAtstringRequired

ISO 8601 last-update timestamp.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
completedAtvalueRequired

ISO 8601 completion timestamp, or null.

Schema details

Any of

Option 1string
format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Option 2null

Additional properties are not allowed.

uploadTokenstringRequired

Signed token for upload control requests.

minLength
1
transfervalueRequired

Signed CSV upload instructions.

Schema details

Exactly one of

Option 1object

Instructions for uploading bytes to one signed URL.

4 fields
methodstringRequired

Upload strategy discriminator.

const
put
urlstringRequired

Signed URL to which the file bytes are uploaded. Upload bytes with PUT and exactly the supplied headers; never construct or modify the signed URL. Treat any 2xx as success. Sim-hosted URLs return an empty 204 and v2 JSON errors. Object-storage URLs may return 200 or 201 and provider-specific errors, often XML.

format
uri
headersobjectRequired

Headers that must be included with the upload request.

Schema details
Additional propertiesstring
expiresAtstringRequired

ISO 8601 expiration time for this signed URL. This is the URL's own expiry and is normally earlier than the upload session's expiresAt: the session stays open for later part, status, completion, and abort requests, but the bytes must be uploaded before this time. Once it passes, the storage provider rejects the upload and a new upload session must be created.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$

Additional properties are not allowed.

Option 2object

Instructions for splitting bytes into a multipart upload.

3 fields
methodstringRequired

Upload strategy discriminator.

const
multipart
partSizeintegerRequired

Required size of each non-final part in bytes.

maximum
9007199254740991
exclusiveMinimum
0
partCountintegerRequired

Total number of upload parts.

maximum
640
exclusiveMinimum
0

Additional properties are not allowed.

Additional properties are not allowed.

Option 2object
3 fields
sessionobjectRequired

Created workspace-file import session.

14 fields
idstringRequired

Unique table-import identifier.

workspaceIdstringRequired

Workspace that owns the import.

statusstringRequired

Current import lifecycle state.

enum
["uploading","processing","completed","failed","canceled","expired"]
sourceobjectRequired

Workspace-file CSV source for this import.

2 fields
typestringRequired

Workspace-file source discriminator.

const
workspace_file
fileIdstringRequired

Existing workspace file identifier.

minLength
1

Additional properties are not allowed.

targetvalueRequired

New or existing table import target.

Schema details

Exactly one of

Option 1object
3 fields
typestringRequired

Create-new-table target discriminator.

const
new
namestringRequired

Name of the table to create.

minLength
1
maxLength
128
pattern
^[A-Za-z_][A-Za-z0-9_]*$
folderPathstring

Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as "New folder" is /New%20folder: everything outside A-Z a-z 0-9 - _ . ~ is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal . or .. segment are rejected. At most 64 segments and 4096 encoded bytes.

maxLength
4096

Additional properties are not allowed.

Option 2object
3 fields
typestringRequired

Existing-table target discriminator.

const
existing
tableIdstringRequired

Existing target table identifier.

minLength
1
modestringRequired

Whether to append rows or replace existing rows.

enum
["append","replace"]

Additional properties are not allowed.

tableIdvalueRequired

Resulting or target table identifier.

Schema details

Any of

Option 1string
Option 2null
rowsProcessedintegerRequired

Rows processed so far.

minimum
0
maximum
9007199254740991
rowsRejectedintegerRequired

Minimum number of source records dropped by parser failures. One failure can discard multiple records, such as an unterminated quote consuming the rest of the file. A non-zero value means partial import even with completed status; zero does not guarantee no loss.

minimum
0
maximum
9007199254740991
cellsRejectedintegerRequired

Non-empty cell values the target column type could not represent. Their rows were imported with the cell left blank.

minimum
0
maximum
9007199254740991
rejectedSamplesarrayRequired

Bounded sample of the dropped records, for locating them in the source file.

Schema details
Array itemobject

One source record a table import could not read.

3 fields
codestringRequired

CSV parser error code, e.g. CSV_QUOTE_NOT_CLOSED.

linevalueRequired

1-based source line the parser had reached when it gave up, or null.

Schema details

Any of

Option 1integer
minimum
0
maximum
9007199254740991
Option 2null
messagestringRequired

Parser message for the dropped record.

Additional properties are not allowed.

errorvalueRequired

Terminal failure reason, or null.

Schema details

Any of

Option 1string
Option 2null
createdAtstringRequired

ISO 8601 creation timestamp.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
updatedAtstringRequired

ISO 8601 last-update timestamp.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
completedAtvalueRequired

ISO 8601 completion timestamp, or null.

Schema details

Any of

Option 1string
format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Option 2null

Additional properties are not allowed.

uploadTokennullRequired

Always null; a workspace-file import has no upload to authorize.

transfernullRequired

Always null; a workspace-file import has no bytes to transfer.

Additional properties are not allowed.

Additional properties are not allowed.

Response headers

X-RateLimit-Limitinteger

Maximum requests allowed in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Remaininginteger

Requests remaining in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Resetstring

ISO 8601 timestamp when the current rate-limit window resets.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Was this helpful?
Suggest an edit