Skip to main content

File Attachments

Send images, documents, audio, and other files as WhatsApp messages.

Workflow

Sending a file is a two-step process:
1

Upload the file

Upload to TimelinesAI and get a file_uid
2

Send with the file_uid

Include file_uid when sending your message

Uploading files

Option 1: Upload from URL

If your file is publicly accessible:
curl -X POST "https://app.timelines.ai/integrations/api/files" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/brochure.pdf",
    "filename": "product-brochure.pdf"
  }'
Response:
{
  "status": "ok",
  "data": {
    "uid": "90d353e6-44c1-48ff-b15b-69b7721e5450",
    "filename": "product-brochure.pdf",
    "mime_type": "application/pdf",
    "size": 245678
  }
}

Option 2: Upload file directly

For local files, use multipart form data:
curl -X POST "https://app.timelines.ai/integrations/api/files_upload" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "file=@/path/to/document.pdf" \
  -F "filename=document.pdf"

Sending files

Once uploaded, use the file_uid to send:

File with text

curl -X POST "https://app.timelines.ai/integrations/api/messages" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+14155551234",
    "text": "Here is the document you requested!",
    "file_uid": "90d353e6-44c1-48ff-b15b-69b7721e5450"
  }'

Supported file types

CategoryFormatsMax Size
ImagesJPG, PNG, GIF, WebP16 MB
DocumentsPDF, DOC, DOCX, XLS, XLSX100 MB
AudioMP3, OGG, OGA, AAC16 MB
VideoMP4, 3GP16 MB

Managing uploaded files

List files

curl -X GET "https://app.timelines.ai/integrations/api/files" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get file details

curl -X GET "https://app.timelines.ai/integrations/api/files/90d353e6-44c1-48ff-b15b-69b7721e5450" \
  -H "Authorization: Bearer YOUR_TOKEN"

Delete file

curl -X DELETE "https://app.timelines.ai/integrations/api/files/90d353e6-44c1-48ff-b15b-69b7721e5450" \
  -H "Authorization: Bearer YOUR_TOKEN"

Next steps