POST
/files/uploadUpload a file attachment
Uploads a file attachment for a page. Send the file and its pageId as multipart form data; you can provide an attachmentId to use a pre-generated attachment identifier. The response includes the file path.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Multipart form data for the file attachment. Include file and pageId; attachmentId can be supplied to use a pre-generated attachment ID.
attachmentIdstringoptional
Optional pre-generated attachment ID. If omitted, a new ID is generated automatically.
filestringrequired
The file to upload. Images, documents, and other file types are supported.
pageIdstringrequired
ID of the page this attachment belongs to.
200Returns the upload result, including the file path.
dataunknownoptional
Response payload
statusintegeroptional
successbooleanoptional
400Returned when the upload request fails validation.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
403Returned when the authenticated user is not permitted to upload the attachment.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
404Returned when the page cannot be found.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
Error handling
A 400 is returned when the upload fails validation, including when file or pageId is missing. A 403 is returned when the authenticated user is not permitted to upload the attachment. A 404 is returned when the page identified by pageId cannot be found.