Skip to content

Link a Telegram chat to a project

POST
/api/v1/projects/{projectId}/telegram/link-codes
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.

projectId
required
string format: uuid

The project’s id.

Example

PROJECT_ID

The code and its links.

Media typeapplication/json
object
botUsername

The bot’s username without @ (MONITORLY_TELEGRAM_BOT_USERNAME); null when not configured.

string | null
code
required

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.

string
expiresAt
required
string
startGroupUrl

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.

string | null
startUrl

https://t.me/<bot>?start=<code>: opens the private chat with the bot, which then receives /start <code>. Null without a bot username.

string | null

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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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 ended
  • token.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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 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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

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
Media typeapplication/problem+json
object
detail
string | null
errors
required

Field errors, empty for errors of the whole request.

Array<object>
object
code
required
string
params
required
object
key
additional properties
pointer
required

JSON pointer into the request body.

string
status
required
integer format: int32
title
required
string
type
required

Stable code, for example check.timeout_exceeds_interval.

string

Example generated

{
"detail": "example",
"errors": [
{
"code": "example",
"params": {
"additionalProperty": "example"
},
"pointer": "example"
}
],
"status": 1,
"title": "example",
"type": "example"
}
Retry-After
integer
>= 1

Seconds to wait before trying again.