# Send a test to a Telegram chat

`POST /api/v1/telegram/chats/{chatId}/test`

Sends a test message to an active linked chat. Project chats: the project admin; workspace chats: the workspace owner or admin.

Sign-in: a dashboard session only. API tokens and OAuth sign-ins get `403 token.not_allowed`.

Section: Telegram. Operation id in openapi.json: `send_telegram_test`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `chatId` | path | yes | string (uuid) | The Telegram chat's id. |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 202

Accepted: the message is on its way.

`application/json`: ChatRequestAccepted

| Field | Type | Required | Description |
|---|---|---|---|
| `pending` | boolean | yes | The request is queued; nothing has been sent or changed yet. |

### 400

Bad Request.

- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.not_allowed`: this operation needs a signed-in session; tokens cannot call it
- `request.origin_mismatch`, `request.header_required`: a changing request with a session comes from another site or lacks `X-Monitorly-Request: 1`

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 409

Conflict.

- `telegram.chat_not_active`: chat is not `active` (broken or unlinked): the test message will not be sent

### 429

Too Many Requests.

- `session.rate_limited`: more than 5 changes a second from your sessions
- `test_message.rate_limited`: a test message to this channel or chat less than 30 seconds after the last one, or more than 20 in an hour in the workspace; wait `Retry-After` seconds

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
