support_attachment_create
Reserve a file on a support thread and get a short-lived signed URL to upload it to.
Reserve a file on a support thread and get a short-lived signed URL to upload it to. The bytes never pass through this API: PUT them to the returned uploadUrl with the same Content-Type, then call support_attachment_finalize. Until finalized the attachment is pending — it cannot be attached to a message and is invisible in message output. A thread belonging to another product is reported as not found
Behavior
- HTTP
POST /support/attachments
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
| fileName | string | • | Display name of the file, e.g. "invoice.pdf". Only the base name is used for the storage key; any directory part is discarded |
| threadId | string | • | Thread the file belongs to. An attachment is created against a thread first and claimed by one of its messages later, when that message is posted |
| sizeBytes | integer | • | Size of the file in bytes, at most 26214400. Declared up front so an oversized upload is refused before a URL is issued; finalize checks the real size again |
| contentType | string | • | MIME type of the file. The upload URL is signed for exactly this type, so the PUT must send the same Content-Type header or storage rejects it |
Response
| Field | Type | Always | Description |
|---|---|---|---|
| id | string | • | Attachment id |
| status | string | • | pending: the row exists and an upload URL was issued, but no bytes have been confirmed. uploaded: finalize saw the object in storage. Only uploaded attachments can be attached to a message or downloaded |
| fileName | string | • | Display name of the file |
| threadId | string | • | Thread this attachment belongs to |
| createdAt | string | • | ISO-8601 creation timestamp |
| messageId | string | • | The message that carries this attachment, or null while nothing claims it yet |
| sizeBytes | integer | • | Size in bytes: what the caller declared while the attachment is pending, what storage reported once it is uploaded |
| uploadUrl | string | • | Short-lived signed URL. PUT the file bytes here with the same Content-Type, then call support_attachment_finalize. The URL is a bearer credential for this one object |
| uploadedAt | string | • | ISO-8601 timestamp of the confirmed upload, or null while pending |
| contentType | string | • | MIME type declared when the attachment was created |
| uploadExpiresAt | string | • | ISO-8601 moment the upload URL stops working |
Try it
Reserve a file on a support thread and get a short-lived signed URL to upload it to.