logo
InboxGet presigned URL for attachment upload
Inbox

Get presigned URL for attachment upload

Returns a presigned URL for direct client upload to R2 cloud storage. The presigned URL expires after 5 minutes. Use the returned url and key when sending a reply with attachments. Max file size is 10MB.

Allowed content types: image/jpeg, image/png, image/gif, image/webp, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, text/csv

curl -X POST "https://api.sendkit.ai/v1/inbox/attachments/upload" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "filename": "proposal.pdf",
  "contentType": "application/pdf",
  "fileSize": 245760
}'
{
  "success": true,
  "data": {
    "presignedUrl": "https://r2.example.com/inbox-attachments/ws123/1717200000000-proposal.pdf?X-Amz-Signature=...",
    "url": "https://cdn.example.com/inbox-attachments/ws123/1717200000000-proposal.pdf",
    "key": "inbox-attachments/ws123/1717200000000-proposal.pdf",
    "filename": "proposal.pdf",
    "contentType": "application/pdf"
  }
}
POST
/v1/inbox/attachments/upload
POST
API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Bearer Token
Bearer Tokenstring
Required

API key as Bearer token

API key as Bearer token
Content-Typestring
Required

The media type of the request body

Options: application/json
filenamestring
Required

Name of the file to upload

Min length: 1
contentTypestring
Required

MIME type of the file

Options: image/jpeg, image/png, image/gif, image/webp, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain, text/csv
fileSizeinteger

File size in bytes (max 10MB = 10485760 bytes)

Max: 10485760
Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

header
Authorizationstring
Required

Bearer token. API key as Bearer token

Body

application/json
filenamestring
Required

Name of the file to upload

contentTypestring
Required

MIME type of the file

Allowed values:image/jpegimage/pngimage/gifimage/webpapplication/pdfapplication/mswordapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.ms-excelapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/plaintext/csv
fileSizeinteger

File size in bytes (max 10MB = 10485760 bytes)

Responses

successboolean
dataobject