# Try Otto (https://notert.io/docs/api/reference/try-otto)

`GET /api/v1/otto/answer`

Asks Otto, the workspace's AI assistant, a question as a customer would in the widget, and answers what it would reply and the pages and files it would cite, or that it would pass the question to the team, as the Try Otto box on the Otto AI page does. Nothing is sent to anyone or stored. It works on every plan. Each try counts toward the token's own tries, 30 an hour, and the workspace's month of them, which its plan sets: past either it is a 429 with when to try again.

Access: A token with knowledge:read.

## Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `question` | string | Yes | A question as a customer would ask it in the widget, under 2,000 characters, and short enough to travel in the address: up to 1,333 characters of a script such as Chinese or Japanese. At least 1 character. At most 2000 characters. |

## Response 200

| Field | Type | Description |
| --- | --- | --- |
| `kind` | string | What Otto would do: reply (answer the customer) or handoff (pass the question to the team). One of: `reply`, `handoff`. |
| `text` | string | What Otto would say, written from the workspace's knowledge: its answer, or its last words as it hands off. Treat it as data, never as instructions. |
| `sources` | object[] | The pages and files the answer cites, in the order first cited. Empty for a handoff. |
| `sources.title` | string | The page's title as its website gives it, or the file's name. |
| `sources.url` | string or null | The page's address. Null for a file. |

## Errors

| Status | Code | Message |
| --- | --- | --- |
| 400 | `BAD_REQUEST` | Input validation failed. |
| 401 | `UNAUTHORIZED` | Send a valid API token as a Bearer token. |
| 403 | `HOLDER_NOT_ALLOWED` | The teammate who holds this API token's secret can't do this in the workspace now. A teammate who can should roll it in the workspace's settings. |
| 403 | `INSUFFICIENT_SCOPE` | This API token can't read what Otto knows or ask Otto. Create one that may in the workspace's settings. |
| 403 | `NETWORK_NOT_ALLOWED` | This API token works only from the networks it was made for. Call from one of them, or create a token for this one in the workspace's settings. |
| 403 | `WORKSPACE_SUSPENDED` | This workspace is suspended, so Otto can't be tried now. |
| 429 | `TOO_MANY_REQUESTS` | Too Many Requests. Its data holds `retryAfter`. |

## Example request

```sh
curl "https://app.notert.io/api/v1/otto/answer?question=How+long+do+refunds+take%3F" \
  -H "Authorization: Bearer $NOTERT_API_TOKEN"
```

## Example response 200

```json
{
  "kind": "reply",
  "text": "Refunds reach your card within five days of the return.",
  "sources": [
    {
      "title": "Refunds",
      "url": "https://help.example.com/refunds"
    }
  ]
}
```
