Skip to main content
POST
/
api
/
public
/
v2
/
tables
/
{table_id}
/
sheets
/
{sheet_id}
/
imports
/
file
Import File Into Table Sheet
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/tables/{table_id}/sheets/{sheet_id}/imports/file \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "file_name": "<string>",
  "file_content_base64": "<string>",
  "operation_id": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "operation_id": "<string>",
  "operation": {
    "operation_id": "<string>",
    "progress": 123,
    "message": "<string>",
    "rows_added": 123,
    "row_count": 123,
    "file_name": "<string>",
    "error_message": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  },
  "status_url": "<string>"
}
Start an asynchronous CSV import into an existing Table sheet. Send file_name ending in .csv and file_content_base64 containing the base64-encoded CSV content. Pass operation_id when you want a stable client-side identifier for polling and webhook correlation. If omitted, PromptLayer generates one. The response returns an operation_id and status_url for polling with Get Table Sheet Import Operation.

Authorizations

X-API-KEY
string
header
required

Headers

X-API-KEY
string
required

Your PromptLayer API key. The key's workspace scopes table resources for this request.

Path Parameters

table_id
string<uuid>
required

Table ID.

sheet_id
string<uuid>
required

Table sheet ID.

Body

application/json
file_name
string
required

CSV file name. Must end with .csv.

Required string length: 1 - 255
file_content_base64
string
required

Base64-encoded CSV file content.

Minimum string length: 1
operation_id
string | null

Optional client-provided operation ID. A UUID is generated when omitted.

Response

File import queued.

success
boolean
required
message
string
required
operation_id
string
required
operation
object
required

Status of an asynchronous sheet import operation.

status_url
string
required