# Conversation routes: answer, assign, close

URL: /code/api/conversation/verbs · Id: `page:code/api/conversation/verbs`

> The Conversation Verbs answer, assign, close as api.sb routes, with inputs, result, refusals and an example.

Reference for [Conversation](/business/nouns/conversation), one group of [Conversation routes](/code/api/conversation).

### Conversation.answer
Answer replies in a Conversation through the Channel it arrived on and closes the reply Task it opened. [Verb page](/business/nouns/conversation/answer?interface=api).

```text
POST /{namespace}/conversations/{conversation}/answer
```

Path: `conversation`. Body, as JSON: the other inputs. Emits [`Conversation.answered`](/business/events/Conversation.answered).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The Conversation that waits. |
| `body` | `text` | Yes | The reply. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The answered Conversation. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/answer \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"Example body"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "conversation": {
    "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "$type": "Conversation",
    "subject": "Example subject",
    "answeredAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Conversation.answer",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Conversation.assign
Assign routes a Conversation to the Worker holding the right Role, by topic, Customer tier and language. [Verb page](/business/nouns/conversation/assign?interface=api).

```text
POST /{namespace}/conversations/{conversation}/assign
```

Path: `conversation`. Body, as JSON: the other inputs. Emits [`Conversation.assigned`](/business/events/Conversation.assigned).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The Conversation to route. |
| `worker` | [Worker](/business/nouns/worker) | No | The Worker to take it; omitted, the routing Policy picks. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The Conversation, with its Worker. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/assign \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "conversation": {
    "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "$type": "Conversation",
    "subject": "Example subject",
    "answeredAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Conversation.assign",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Conversation.close
Close marks a Conversation resolved, confirmed by the Customer or assumed after 72 hours with no reply. [Verb page](/business/nouns/conversation/close?interface=api).

```text
POST /{namespace}/conversations/{conversation}/close
```

Path: `conversation`. Body, as JSON: the other inputs. Emits [`Conversation.closed`](/business/events/Conversation.closed).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The answered Conversation. |
| `resolution` | `string` | Yes | How it ended: the Customer said so, or 72 hours passed after an answer with no reply. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `conversation` | [Conversation](/business/nouns/conversation) | Yes | The Conversation, resolved. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k/close \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resolution":"confirmed"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "conversation": {
    "$id": "https://api.sb/leaseline.app/conversations/conversation_0vg6SDjB6k",
    "$type": "Conversation",
    "subject": "Example subject",
    "answeredAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Conversation.close",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```