Skip to content
Skip to Content
Coder Docs

List chat attachments

GET
/api/v2/chats/{chat}/attachments

Returns every file part in the user-visible user and assistant messages of a chat, newest first, so a client can list a chat's attachments without paging through every message in the chat.

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

chat*string

Chat ID

Formatuuid

Query Parameters

before_id?integer

Return attachments from messages with id < before_id

Response Body

OK

application/json
  1. response
attachments?array<>

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/chats/{chat}/attachments" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "attachments": [    {      "file": {        "data": "string",        "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767",        "media_type": "string",        "name": "string",        "type": "file"      },      "message_id": 0,      "part_index": 0,      "role": "user"    }  ]}