Enqueue a Telegram outbound message
POST /v1/telegram/messages
Enqueues a message for delivery by the background job worker and returns
immediately with the queued job. The recipient is resolved from contactId,
username, or telegramUserId - at least one must be supplied. If
contactId is provided and the contact has no resolved Telegram identity,
the request fails with 400. Set runAt (UTC) to schedule delivery for
later; omit for immediate dispatch. The accountId must belong to the
authenticated user. Requires scope telegram:send.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Provide exactly one of contactId, username, or telegramUserId to identify the recipient (or let contactId resolve to one automatically).
object
Id of the Telegram account (owned by the caller) to send from.
CRM contact to message. The contact’s stored username/telegramUserId is used as the target.
Telegram @username of the recipient (leading @ is stripped server-side).
Telegram numeric user id of the recipient.
Message body. Maximum 4000 characters.
Scheduled delivery time (UTC). Omit or set to null for immediate dispatch.
Example
{ "accountId": 7, "username": "john_doe", "text": "Hi from Acme Inc.!", "runAt": null}Responses
Section titled “ Responses ”Message job accepted and queued.
Queued message job returned by POST /v1/telegram/messages (202 Accepted).
object
Current job status.
Scheduled or effective send time (UTC).
The request body or parameters failed validation.
Standard error envelope for all v1 error responses.
object
Machine-readable error code.
Human-readable explanation of the error.
Optional structured context (field-level validation errors, etc.).
Example
{ "error": "bad_request", "message": "at least one of name, username, phone is required"}Missing or invalid bearer token.
Standard error envelope for all v1 error responses.
object
Machine-readable error code.
Human-readable explanation of the error.
Optional structured context (field-level validation errors, etc.).
Example
{ "error": "unauthorized", "message": "Invalid bearer principal"}The API key does not have the required scope for this operation.
Standard error envelope for all v1 error responses.
object
Machine-readable error code.
Human-readable explanation of the error.
Optional structured context (field-level validation errors, etc.).
Example
{ "error": "forbidden", "message": "scope contacts:write is required"}The requested resource does not exist or is not owned by the caller.
Standard error envelope for all v1 error responses.
object
Machine-readable error code.
Human-readable explanation of the error.
Optional structured context (field-level validation errors, etc.).
Example
{ "error": "not_found", "message": "contact not found"}Per-key rate limit exceeded. Retry after the time indicated by X-RateLimit-Reset.
Standard error envelope for all v1 error responses.
object
Machine-readable error code.
Human-readable explanation of the error.
Optional structured context (field-level validation errors, etc.).
Example
{ "error": "rate_limited", "message": "rate limit exceeded"}Headers
Section titled “Headers ”Maximum requests allowed per minute for this key.
Requests remaining in the current window.
Unix timestamp (seconds) when the rate limit window resets.