# API reference

Every route of the Chatwise API, with the scope it needs.

The base URL is `https://api.chatwise.so`. Every route needs an API key: see [authentication and scopes](https://chatwise.so/docs/authentication.md). A machine-readable [OpenAPI 3.1 file](https://chatwise.so/docs/openapi.json) describes all of them.

## Conversations

Read the conversations in the workspace's inbox.

| Route | What it does | Scope |
| --- | --- | --- |
| `GET /v1/conversations` | [List conversations](https://chatwise.so/docs/api/list-conversations.md) | `conversations:read` |
| `GET /v1/conversations/{conversationId}` | [Get a conversation](https://chatwise.so/docs/api/get-conversation.md) | `conversations:read` |

## Messages

Read and search messages, and send approved WhatsApp templates.

| Route | What it does | Scope |
| --- | --- | --- |
| `GET /v1/conversations/{conversationId}/messages` | [List a conversation's messages](https://chatwise.so/docs/api/list-conversation-messages.md) | `messages:read` |
| `GET /v1/conversations/{conversationId}/messages/{messageId}` | [Get a message](https://chatwise.so/docs/api/get-message.md) | `messages:read` |
| `GET /v1/messages` | [List or search messages](https://chatwise.so/docs/api/list-messages.md) | `messages:read` |
| `POST /v1/messages` | [Send a template by id](https://chatwise.so/docs/api/send-message.md) | `messages:send` |
| `POST /v1/template/whatsapp` | [Send a template by name](https://chatwise.so/docs/api/send-whatsapp-template.md) | `messages:send` |

## WhatsApp templates

Find WhatsApp templates, and create new ones.

| Route | What it does | Scope |
| --- | --- | --- |
| `GET /v1/whatsapp/templates` | [List WhatsApp templates](https://chatwise.so/docs/api/list-whatsapp-templates.md) | `templates:read` |
| `POST /v1/whatsapp/templates` | [Create a WhatsApp template](https://chatwise.so/docs/api/create-whatsapp-template.md) | `templates:write` |
| `GET /v1/whatsapp/templates/{templateId}` | [Get a WhatsApp template](https://chatwise.so/docs/api/get-whatsapp-template.md) | `templates:read` |

## Webhook endpoints

Choose where Chatwise sends events.

| Route | What it does | Scope |
| --- | --- | --- |
| `GET /v1/webhook-endpoints` | [List webhook endpoints](https://chatwise.so/docs/api/list-webhook-endpoints.md) | `webhooks:read` |
| `POST /v1/webhook-endpoints` | [Create a webhook endpoint](https://chatwise.so/docs/api/create-webhook-endpoint.md) | `webhooks:write` |
| `GET /v1/webhook-endpoints/{endpointId}` | [Get a webhook endpoint](https://chatwise.so/docs/api/get-webhook-endpoint.md) | `webhooks:read` |
| `PATCH /v1/webhook-endpoints/{endpointId}` | [Update a webhook endpoint](https://chatwise.so/docs/api/update-webhook-endpoint.md) | `webhooks:write` |
| `DELETE /v1/webhook-endpoints/{endpointId}` | [Delete a webhook endpoint](https://chatwise.so/docs/api/delete-webhook-endpoint.md) | `webhooks:write` |
| `POST /v1/webhook-endpoints/{endpointId}/test` | [Send a test event](https://chatwise.so/docs/api/test-webhook-endpoint.md) | `webhooks:write` |
| `POST /v1/webhook-endpoints/{endpointId}/rotate-secret` | [Rotate the signing secret](https://chatwise.so/docs/api/rotate-webhook-secret.md) | `webhooks:write` |
| `GET /v1/webhook-event-types` | [List event types](https://chatwise.so/docs/api/list-webhook-event-types.md) | `webhooks:read` |

## Webhook deliveries

See what was sent to an endpoint, and send it again.

| Route | What it does | Scope |
| --- | --- | --- |
| `GET /v1/webhook-endpoints/{endpointId}/deliveries` | [List deliveries](https://chatwise.so/docs/api/list-webhook-deliveries.md) | `webhooks:read` |
| `GET /v1/webhook-deliveries/{deliveryId}` | [Get a delivery](https://chatwise.so/docs/api/get-webhook-delivery.md) | `webhooks:read` |
| `POST /v1/webhook-deliveries/{deliveryId}/redeliver` | [Redeliver](https://chatwise.so/docs/api/redeliver-webhook-delivery.md) | `webhooks:write` |
