Skip to content
Chatwise
Skip to Content
Developer docs

List a message's files

GET /v1/conversations/{conversationId}/messages/{messageId}/files. Lists the files of a message, at most 20: those a customer sent, and those the workspace sent.

View as Markdown

GEThttps://api.chatwise.so/v1/conversations/{conversationId}/messages/{messageId}/files

Lists the files of a message, at most 20: those a customer sent, and those the workspace sent. Each that is available has a link that downloads it without an API key and works for 5 minutes. Call this again for a new one, and don't store links: for a webhook event, use its message's and conversation's ids when you need the file.

On WhatsApp, Instagram and Messenger. A file on Instagram or Messenger is copied just after the message arrives, so for a moment it can be pending. A story that a message replies to, or that mentions the account, isn't listed until it is copied. On Instagram a shared post, reel or story is a file only if Chatwise copied it. Files on Website Chat aren't available, and neither are those in a WhatsApp template's header, or those of Messenger messages from before Chatwise kept them, in December 2026: for these the list is empty.

A deleted or hidden message is not found. A link you already have works until it expires.

The API key needs the messages:read scope. See authentication and scopes.

Example

curl 'https://api.chatwise.so/v1/conversations/1234/messages/5678/files' \
  -H "Authorization: Bearer $CHATWISE_API_KEY"

Path parameters

NameTypeDescription
conversationIdstringRequired. The conversation's id.
messageIdstringRequired. The message's id.

Response

200. The message's files, in the order they were sent. On WhatsApp and Instagram those Chatwise has copied come first.

{
  "data": [
    {
      "id": "3f1c9a5be07d42a68c1e9b70",
      "type": "document",
      "status": "available",
      "name": "invoice.pdf",
      "mimeType": "application/pdf",
      "size": 48213,
      "url": "https://files.example.com/5f0e7a52-1c1b-4c0e-9a53-6a7d1c2b3e4f.pdf?X-Amz-Expires=300&X-Amz-Signature=0a1b2c",
      "urlExpiresAt": "2026-11-12T09:30:36.000Z"
    }
  ]
}
FieldTypeDescription
data[].idstringThe file's id, the same each time you list it. Only when one of several Instagram files is lost before it is copied can another take its id.
data[].typestringWhat kind of file it is. One of image, video, audio, document.
data[].statusstringavailable, pending while Chatwise is still copying it, or unavailable when it couldn't be copied, isn't copied after 15 minutes, or is gone.
data[].namestring or nullThe name it was sent with, if Chatwise has it.
data[].mimeTypestring or nullIts MIME type. Types a browser could run, such as HTML and SVG, are downloaded as application/octet-stream. Null unless it is available.
data[].sizeinteger or nullIts size in bytes. Null unless it is available.
data[].urlstring or nullWhere to download it, without an API key, until urlExpiresAt. Null unless it is available.
data[].urlExpiresAtstring or nullWhen the link stops working. ISO 8601, in UTC. Null unless it is available.

Errors

StatusMessageWhat it means
400Validation failedA parameter or body field is missing, unknown or malformed. errors lists each one.
401A valid Bearer API key is requiredThe Authorization header is missing or isn't Bearer <API key>.
401Invalid or revoked API keyThe key doesn't exist, was revoked, or has expired.
401Invalid API keyChatwise couldn't check the key. Try again.
403API key does not have the required scope: messages:readThe key lacks the route's scope. Create a key that has it.
404Message not foundNo visible message with this id in this conversation.
429API key rate limit exceededWait the number of seconds in the Retry-After header.
500Internal server errorSomething failed in Chatwise. Retry reads with backoff.
503FILE_STORAGE_UNAVAILABLE: The files could not be read right now. Try again in a momentWait as Retry-After says, then repeat the request.

The body of an error is described in errors.

On this page