uploadFormRecordAttachment
POST
/api/v1/data-sources/{id}/records/{recordId}/attachments
const url = 'https://example.com/api/v1/data-sources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/records/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/attachments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"fieldKey":"example","fileName":"example","contentType":"example","data":"example","version":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/data-sources/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/records/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/attachments \ --header 'Content-Type: application/json' \ --data '{ "fieldKey": "example", "fileName": "example", "contentType": "example", "data": "example", "version": 1 }'Uploads a base64-encoded image as a dedicated form attachment bound to an image field, returning the updated record detail with its incremented version. Uses optimistic concurrency — the request body must carry the record’s current version, and a mismatch returns 409. Because image fields are single-valued, uploading to a field that already has an attachment replaces it. Authorization matches record editing. Form attachments are never exposed through the general Media library.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
recordId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
fieldKey
required
string
fileName
string
contentType
string
data
required
Base64-encoded image bytes
string
version
required
The record’s current version
integer
Examplegenerated
{ "fieldKey": "example", "fileName": "example", "contentType": "example", "data": "example", "version": 1}Responses
Section titled “ Responses ”Updated record detail after the attachment change
Not permitted to edit this record
Record version conflict
Not an image, unsupported type, or too large