GetFiles

[POST] .../v1/chatmessage/getfiles

Returns message files of the selected chat with original message context. Use this method to build a chat media or file browser for one chat while keeping the source message context. The request body is required and chat_id must identify the chat when filters are not used; filters metadata exposes chat_id, author_entity_type, author_entity_id, kind and created_date fields. The response returns ChatMessageFile records with author metadata, message timestamp, file order and the CommonFile object and access follows the same current-user chat visibility as ChatMessage/Get. Missing body, missing chat_id, invalid author filters, invalid file kind, denied access, private-message restrictions, file lookup failures and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
filters Array of Filter Optional Optional filters by fields available for this API method.
include_staff_private Boolean Optional Include Staff-restricted messages if permitted: Private and System with action_code = StaffNoticeAdded.
limit Int32 Optional Maximum number of result items.
offset Int32 Optional Result set offset.

Filterable Fields

Field Type Description
author_entity_id int Message author entity ID.
author_entity_type string Message author entity type.
chat_id string Chat UUID. Required filter field.
created_date int
from_date int Message creation date lower bound as Unix time in seconds.
kind string File type filter.
to_date int Message creation date upper bound as Unix time in seconds.

Request Example

{
  "filters": [
    {
      "field": "chat_id",
      "operator": "Equal",
      "value": "8cdd646d-dbd0-45c0-8f5b-d90a9b000001"
    },
    {
      "field": "kind",
      "operator": "Equal",
      "value": "File"
    },
    {
      "field": "created_date",
      "operator": "GreaterOrEqual",
      "value": "1767220000"
    },
    {
      "field": "created_date",
      "operator": "LessOrEqual",
      "value": "1767225600"
    }
  ],
  "limit": 50,
  "offset": 0
}

Response Parameters

Name Type Description
next_offset Int32 Offset for the next data page.
ok Boolean Indicates whether the request completed successfully.
result Array of ChatMessageFile Result array.
total Int64 Total number of result items.

Response Example

{
  "ok": true,
  "result": [
    {
      "message_id": "4b9727ec-a389-4274-95b6-069350000001",
      "chat_id": "8cdd646d-dbd0-45c0-8f5b-d90a9b000001",
      "author_entity_type": "User",
      "author_entity_id": 42,
      "author_role": "Staff",
      "author_entity_name": "Alex Carter",
      "author_entity_photo": null,
      "message_type": "Regular",
      "message_created_date": 1767225600,
      "file_order": 1,
      "file": {
        "id": 321,
        "name": "invoice.pdf",
        "size": 12400,
        "extension": "pdf",
        "mime_type": "application/pdf",
        "media_type": "File",
        "width": null,
        "height": null,
        "duration_ms": null,
        "date": 1767225600,
        "user_id": 42,
        "access_level": "Private",
        "hash": "sha256:example",
        "folder": null,
        "folder_id": 2,
        "cdn_name": null,
        "url": "https://example.com/files/invoice.pdf",
        "last_update": 1767225600
      }
    }
  ],
  "next_offset": 50,
  "total": 1
}