Documentation Index Fetch the complete documentation index at: https://help.teable.ai/llms.txt
Use this file to discover all available pages before exploring further.
Path
POST /api/table/{tableId}/record/{recordId}/{fieldId}/uploadAttachment
Request
Path Parameters
tableId (string): The unique identifier of the table (how to get) .
recordId (string): The unique identifier of the record to update (how to get) .
fieldId (string): The ID of the attachment field to upload to (how to get)
Attachment fields can contain multiple attachments. This API allows uploading one attachment at a time to the end of the cell.
To delete or reorder attachments, use the Update Record API .
fieldId must be an attachment type field.
Through the API, uploaded attachments are limited to 100MB in the cloud version, with no limit in the self-hosted version.
Request Body
Type: formData
Parameters:
file (optional)
Description: The record data to update
Type: Buffer or ReadStream
fileUrl (optional)
Description: The URL to upload from
Type: String
Example: https://example.com/image.jpg
Note: Only one of file or fileUrl can be specified at a time. If both are specified, file takes precedence.
Response
Success Response
Status code: 201 Created
Response body: Returns the updated record data.
Example Response Body
{
"id" : "rec123456789ABCDE" ,
"fields" : {
"fld123456789ABCDE" : [
{
"id" : "act75TiSyhcS7hfrizW" ,
"name" : "example.jpg" ,
"path" : "table/example" ,
"size" : 392903 ,
"token" : "tokenxxxxx" ,
"width" : 976 ,
"height" : 1000 ,
"mimetype" : "image/jpeg" ,
"presignedUrl" : "https://app.teable.ai/preview/previewURL"
}
],
}
}
Error Responses
Status code: 400 Bad Request: Request body format error or missing required fields.
Status code: 404 Not Found: Specified tableId or recordId does not exist.
Example Code
CURL
JS SDK
TypeScript
Python
# Upload via file
curl -X POST 'https://app.teable.ai/api/table/__tableId__/record/__recordId__/__fieldId__/uploadAttachment' \
-H 'Authorization: Bearer __token__' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/path/to/your/file.jpg'
# Upload via URL
curl -X POST 'https://app.teable.ai/api/table/__tableId__/record/__recordId__/__fieldId__/uploadAttachment' \
-H 'Authorization: Bearer __token__' \
-H 'Content-Type: multipart/form-data' \
-F 'fileUrl=https://example.com/image.jpg'