# Retrieve chat

`opensend.ask.chat(id)`

One kept chat with everything that was said in it.

Needs the scope: `workspace:read`

This method answers a person who is signed in to the dashboard. A call with an API key is refused with 403.

## Input

`id` goes first, on its own, and the rest in one object. One object that holds `id` works too.

- `id` (string, required): The id of the item. Up to 64 characters.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("chat"): Always `chat`.
- `id` (string): The id of the chat.
- `title` (string): The first question, shortened.
- `updatedAt` (string): When the chat was last saved.
- `createdAt` (string): When the chat was started.
- `entries` (object[]): The whole conversation, oldest first.
- `entries[].id` (string): An id for the entry, unique in the chat. Up to 64 characters.
- `entries[].role` (string): Who said it: `user` or `assistant`. One of: `user`, `assistant`.
- `entries[].text` (string, optional): What was said. Up to 4,000 characters.
- `entries[].steps` (object[], optional): The methods that were run for this answer. Up to 20 items.
- `entries[].steps[].call` (string): The method that was run. Up to 80 characters.
- `entries[].steps[].title` (string): The method in a few words. Up to 500 characters.
- `entries[].steps[].ok` (boolean): Whether it worked.
- `entries[].change` (object, optional): The change that was proposed with this answer.
- `entries[].change.call` (string): The method the assistant proposed. Up to 80 characters.
- `entries[].change.title` (string): The method in a few words. Up to 500 characters.
- `entries[].change.description` (string): What running it does. Up to 4,000 characters.
- `entries[].change.effect` (string): What it does to your data: `write`, `send` or `destroy`. One of: `read`, `write`, `send`, `destroy`.
- `entries[].change.input` (Record<string, unknown>): The input it is run with.
- `entries[].change.state` (string): Where the proposal stands: `waiting`, `busy`, `done`, `dismissed` or `failed`. One of: `waiting`, `busy`, `done`, `dismissed`, `failed`.
- `entries[].change.fault` (string, optional): Why it failed, when it did. Up to 500 characters.
- `entries[].fault` (string, optional): Why the answer failed, when it did. Up to 500 characters.
- `entries[].off` (boolean, optional): Whether the assistant was not connected when this was asked.

## Example

TypeScript:

```ts
await opensend.ask.chat('chat_01')
```

CLI:

```bash
opensend ask chat chat_01
```

Answer:

```json
{
  "object": "chat",
  "id": "chat_01",
  "title": "Which domains are not verified yet?",
  "updatedAt": "2026-11-27T09:30:00.000Z",
  "createdAt": "2026-11-27T09:30:00.000Z",
  "entries": [
    {
      "id": "prompt-1",
      "role": "user",
      "text": "Which domains are not verified yet?"
    },
    {
      "id": "answer-1",
      "role": "assistant",
      "text": "Two domains are not verified yet: news.example.com is pending and example.org failed its last check."
    }
  ]
}
```
