const url = 'https://app.monitorly.cloud/api/v1/projects/PROJECT_ID/telegram/link-codes';const options = { method: 'POST', headers: {cookie: '__Host-monitorly_session=<__Host-monitorly_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.monitorly.cloud/api/v1/projects/PROJECT_ID/telegram/link-codes \ --cookie __Host-monitorly_session=<__Host-monitorly_session>A one-time code that links a Telegram chat to the project’s alerts: open startUrl for a private chat or startGroupUrl for a group. Needs the project admin role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project’s id.
Example
PROJECT_IDResponses
Section titled “Responses”The code and its links.
object
The bot’s username without @ (MONITORLY_TELEGRAM_BOT_USERNAME); null when not configured.
Send /start <code> to the bot in the chat to link. 43 characters of A-Z a-z 0-9 _ -, so it is
also a valid start / startgroup parameter of a Telegram deep link.
https://t.me/<bot>?startgroup=<code>: Telegram asks which group to add the bot to; the group then
sends /start@<bot> <code>. Null without a bot username.
https://t.me/<bot>?start=<code>: opens the private chat with the bot, which then receives
/start <code>. Null without a bot username.
Example generated
{ "botUsername": "example", "code": "example", "expiresAt": "example", "startGroupUrl": "example", "startUrl": "example"}Bad Request.
auth.credentials_conflict: the request carries both a session cookie and a token
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unauthorized.
auth.unauthenticated,auth.session_expired: no session, or it endedtoken.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Forbidden.
auth.forbidden: your role is too low for thistoken.not_allowed: this operation needs a signed-in session; tokens cannot call itrequest.origin_mismatch,request.header_required: a changing request with a session comes from another site or lacksX-Monitorly-Request: 1
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Not Found.
request.not_found: it does not exist, or you cannot see it
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Too Many Requests.
session.rate_limited: more than 5 changes a second from your sessions
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Headers
Section titled “Headers”Seconds to wait before trying again.