Skip to main content

Attachments

Attachment endpoints are under /v1/workspaces/:workspaceId. Auth: Bearer + x-workspace-id.

GET /v1/workspaces/:workspaceId/attachments/:attachmentId/download

Get a download URL (or redirect) for the attachment. The response may be a JSON object with a url or the API may redirect to a signed URL.

Response (200): JSON with download URL, or 302 redirect to the file.

Example:

curl -X GET https://api.inboxops.app/v1/workspaces/ws-123/attachments/ATTACHMENT_UUID/download \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123"

GET /v1/workspaces/:workspaceId/messages/:messageId/attachments

List attachments for a message.

Response (200): Array of attachment objects (id, filename, contentType, etc.).

Example:

curl -X GET https://api.inboxops.app/v1/workspaces/ws-123/messages/MESSAGE_UUID/attachments \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123"

GET /v1/workspaces/:workspaceId/tickets/:ticketId/attachments

List attachments for a ticket (all messages on the ticket).

Response (200): Array of attachment objects.

Example:

curl -X GET https://api.inboxops.app/v1/workspaces/ws-123/tickets/TICKET_UUID/attachments \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123"

POST /v1/workspaces/:workspaceId/tickets/:ticketId/attachments/upload-url

Request a presigned (or one-time) upload URL to upload a file. After uploading the file to that URL, call POST .../attachments/:attachmentId/confirm to attach it to the ticket.

Body:

{
"filename": "document.pdf",
"contentType": "application/pdf",
"size": 102400
}

Response (201): Object with uploadUrl (or url), attachmentId, and any other fields (e.g. method, headers). Upload the file with a PUT or POST to the given URL, then confirm.

Example:

curl -X POST https://api.inboxops.app/v1/workspaces/ws-123/tickets/TICKET_UUID/attachments/upload-url \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123" \
-H "Content-Type: application/json" \
-d '{"filename":"doc.pdf","contentType":"application/pdf","size":1024}'

POST /v1/workspaces/:workspaceId/attachments/:attachmentId/confirm

Confirm an attachment after uploading the file to the URL from upload-url. Optionally send the storage provider’s ETag if required.

Body (optional): { "s3ETag": "optional-etag" }

Response (200): Attachment object (ready to use in attachmentIds when posting a message).

Example:

curl -X POST https://api.inboxops.app/v1/workspaces/ws-123/attachments/ATTACHMENT_UUID/confirm \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123" \
-H "Content-Type: application/json" \
-d '{}'

DELETE /v1/workspaces/:workspaceId/attachments/:attachmentId

Delete an attachment. Returns 204 on success.

Example:

curl -X DELETE https://api.inboxops.app/v1/workspaces/ws-123/attachments/ATTACHMENT_UUID \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "x-workspace-id: ws-123"

Upload flow summary: 1) POST upload-url for the ticket → 2) PUT file to returned URL → 3) POST confirm with attachmentId → 4) Use attachmentId in POST ticket message body.