---
title: ข้อมูลอ้างอิง API: Conversations
description: Platform API v1 ส่วน Conversations: path, พารามิเตอร์, ฟิลด์ของคำขอและคำตอบ, scope, idempotency และข้อผิดพลาดของทุก operation จาก contract
url: https://agentlab.cresclab.com/docs/th/api/conversations
language: th
updated: 2026-12-05
---

# ข้อมูลอ้างอิง API: Conversations

Platform API v1 ส่วน Conversations: path, พารามิเตอร์, ฟิลด์ของคำขอและคำตอบ, scope, idempotency และข้อผิดพลาดของทุก operation จาก contract

> [!NOTE]
> สร้างจาก API contract (Agent Lab Platform API 1.0.0-alpha.1) คำอธิบายเป็นภาษาอังกฤษตามต้นฉบับใน contract

Members' conversations, read and kept as the acting member: reading what was said needs the
restricted `conversations:read`, as does searching them, listing what automation started and
reading their files; changing where a conversation sits on its member's shelf, and archiving
a departed member's file, needs `conversations:write`.

## The conversations people started

`GET /v1/workspaces/{workspaceId}/conversations`

The conversations members started, newest activity first, as the acting member's shelf shows
them: their own, or every member's for a member who may read any conversation (owners and
administrators). Conversations automation started are listed by
`GET …/conversations/background`; evaluation runs' are not listed.
`archived=true` lists what was put away instead; the two lists page separately.
`conversations:read` is restricted: no installation holds it until the platform has reviewed
the application.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `cursor` | query | `string` | ไม่ | The `nextCursor` of the previous page. Opaque. |
| `limit` | query | `integer` | ไม่ | Items per page. ค่าเริ่มต้น: `50`. |
| `archived` | query | `boolean` | ไม่ | List the archived conversations instead. ค่าเริ่มต้น: `false`. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationPage](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationPage) | A page of conversations. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## A conversation and what was said in it

`GET /v1/workspaces/{workspaceId}/conversations/{conversationId}`

The conversation and every message in it, oldest first. Readable by the member who started
it, and by a member who may read any conversation, whose read is recorded in the workspace's
audit log with the application beside them; anyone else's is not found, as is one of another
workspace. Reading does not mark it read; `PATCH` with `seen: true` does.
`conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationDetail](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationDetail) | The conversation. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Rename, pin, archive or mark a conversation read

`PATCH /v1/workspaces/{workspaceId}/conversations/{conversationId}`

Changes where the conversation sits on its member's shelf; only what is sent changes. Only
the member who started it changes it: anyone else's conversation is not found, as is one of
another workspace. Pinning is for conversations people started, and archiving one unpins
it. The changes are made one at a time in this order: `archived: false`, `pinned`,
`archived: true`, `title`, `seen`; a refusal (such as `PIN_LIMIT_REACHED`) leaves the ones
before it made, so read the conversation again before retrying.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:write` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |

### เนื้อหาคำขอ

`application/json`: [ConversationStateChange](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationStateChange)

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `title` | `string` | ไม่ | The member's own name for it; empty clears it back to the generated one. |
| `pinned` | `boolean` | ไม่ | — |
| `archived` | `boolean` | ไม่ | Archiving also unpins it. |
| `seen` | `boolean` | ไม่ | The member opened it. Nothing marks a conversation unread. ค่าที่เป็นไปได้: `true`. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [Conversation](https://agentlab.cresclab.com/docs/th/api/schemas.md#Conversation) | The conversation as it is now. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `409` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The change cannot be made as asked: `PIN_LIMIT_REACHED`, the member has pinned as many conversations as they may (`configure`: unpin one first); `CONVERSATION_ARCHIVED`, an archived conversation cannot be pinned without `archived: false` in the same change (`none`). |
| `413` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The body is larger than the operation accepts (`PAYLOAD_TOO_LARGE`, `recovery: none`). |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Find conversations by what was said in them

`GET /v1/workspaces/{workspaceId}/conversations/search`

The conversations the acting member may list (their own, or every member's for a member who
may read any conversation) whose messages contain every word of `query`, ignoring case,
newest activity first. The newest 200 conversations are searched, and `searched` says how
many were, so an empty `items` tells "nothing matched" from "nothing to search". A member
who may read any conversation searching other members' conversations is recorded in the
workspace's audit log with the application beside them (the count, never the term); when
that cannot be recorded nothing is answered (503). `conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `query` | query | `string` | ใช่ | The words to find; not blank, at most 200 characters. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationSearch](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationSearch) | The conversations that matched. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## The conversations automation started

`GET /v1/workspaces/{workspaceId}/conversations/background`

The conversations schedules and triggers started, newest activity first, each with how its
run ended and what started it: the acting member's own, or every member's for a member who
may read any conversation. Read one with `GET …/conversations/{conversationId}`.
`conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `cursor` | query | `string` | ไม่ | The `nextCursor` of the previous page. Opaque. |
| `limit` | query | `integer` | ไม่ | Items per page. ค่าเริ่มต้น: `50`. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [BackgroundConversationPage](https://agentlab.cresclab.com/docs/th/api/schemas.md#BackgroundConversationPage) | A page of background conversations. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## How each schedule and trigger has been doing

`GET /v1/workspaces/{workspaceId}/conversations/background/summary`

The newest `window` background conversations the acting member may list, grouped by the
schedule or trigger that started them, with how their runs ended. The counts describe that
window, not a source's whole history. Conversations naming no source are counted in
`unattributedCount`. `conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [BackgroundConversationSummary](https://agentlab.cresclab.com/docs/th/api/schemas.md#BackgroundConversationSummary) | The summary. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## How many background results the member has not opened

`GET /v1/workspaces/{workspaceId}/conversations/background/unseen`

How many of the acting member's own newest `window` background conversations hold a
result they have not opened; the member's own for an administrator too.
`conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [BackgroundConversationUnseen](https://agentlab.cresclab.com/docs/th/api/schemas.md#BackgroundConversationUnseen) | The count. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Tools that wait for the member's own credential

`GET /v1/workspaces/{workspaceId}/conversations/{conversationId}/pending-authorizations`

The tools in the conversation that would refuse the member who started it until that member
connects their own credential for them. A tool that acts with the workspace's credential is
not listed. Readable by the member who started it and by a member who may read any
conversation; anyone else's is not found, as is one of another workspace.
`conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [PendingAuthorizationList](https://agentlab.cresclab.com/docs/th/api/schemas.md#PendingAuthorizationList) | The tools waiting for a credential. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Every file attached in a conversation

`GET /v1/workspaces/{workspaceId}/conversations/{conversationId}/attachments`

The files members attached in the conversation, without their content, and whether the
member who attached them is still a member. For a member who may read any conversation
(owners and administrators), whatever conversation it is; anyone else is refused
(`MEMBER_NOT_AUTHORIZED`) before the conversation is looked up. The member who attached a
file reads it in the conversation's messages. `conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationAttachmentInventory](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationAttachmentInventory) | The files. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## A file the member attached

`GET /v1/workspaces/{workspaceId}/conversations/{conversationId}/attachments/{attachmentId}`

The file as it was attached, base64-encoded, for the member who started the conversation.
Anyone else's, including a member who may read any conversation, is not found: they use
`POST …/export`, which is recorded. `conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |
| `attachmentId` | path | `string` | ใช่ | A file attached in the conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationAttachmentContent](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationAttachmentContent) | The file. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Export a file attached in any conversation

`POST /v1/workspaces/{workspaceId}/conversations/{conversationId}/attachments/{attachmentId}/export`

The file as it was attached, base64-encoded, for a member who may read any conversation
(owners and administrators). The export is recorded in the workspace's audit log as the
acting member's, with the application beside them, before anything is answered; when it
cannot be recorded nothing is answered. Anyone else is refused (`MEMBER_NOT_AUTHORIZED`)
before the conversation is looked up. `conversations:read` is restricted.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:read` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |
| `attachmentId` | path | `string` | ใช่ | A file attached in the conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [ConversationAttachmentContent](https://agentlab.cresclab.com/docs/th/api/schemas.md#ConversationAttachmentContent) | The file. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## Archive a file whose uploader has left

`POST /v1/workspaces/{workspaceId}/conversations/{conversationId}/attachments/{attachmentId}/archive`

Marks a file archived once the member who attached it is no longer a member of the
workspace; the file is kept and can still be exported. Recorded in the workspace's audit
log as the acting member's, with the application beside them. Needs a member who may read
any conversation and manage the workspace; anyone else is refused (`MEMBER_NOT_AUTHORIZED`)
before the conversation is looked up. A file whose uploader is still a member is not found,
as one that does not exist. Archiving an archived file changes nothing.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `conversations:write` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `conversationId` | path | `string` | ใช่ | The conversation, by id. |
| `attachmentId` | path | `string` | ใช่ | A file attached in the conversation, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `204` | — | Archived. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused: `SCOPE_NOT_GRANTED` (`configure`); `WORKSPACE_NOT_INSTALLED`, the path names a workspace other than the installation's (`configure`); `MEMBER_REQUIRED`, no single `Agentlab-On-Behalf-Of` (`none`); `MEMBER_NOT_AUTHORIZED`, the named account is not a current member who signed in to the application here, or the member may not read or do this (`authorize`); `SERVER_TO_SERVER_ONLY`, sent from a browser (`none`); `PRODUCT_ACCESS_DENIED`, the workspace's plan does not include it (`configure`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |
