Skip to content
Docs
Esc
↑↓navigate↵open⌘Jpreview

A one-time code that links a Telegram chat.

Makes a one-time code, valid for ten minutes and for one use, that the user sends to the bot to link a Telegram chat to this account. A new code ends the one before it; 409 telegram_linked when a chat is already linked.

POST/v1/me/telegram/link-code
Authorization
sessionAPI key · cookierequired

An opaque, revocable INVICTUS session set by createSession.

Header parameters
Idempotency-Keystringrequired

A key the client makes per intended write; a repeat with the same key and body is answered as the first, never applied twice.

min length 1 · max length 200
Responses
201

Success.

codestringrequired

The one-time code to send to the bot as /start <code>.

matches ^[0-9A-HJKMNP-TV-Z]{8}$
expiresAtintegerrequired

When the code stops working, in unix seconds.

min 0 · max 9007199254740991
401

No session, or it ended.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
409

In conflict with the current state.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
429

Too many requests; retryAfterSeconds says when to ask again.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
500

Server error.

typestring<uri-reference>required

A URI reference naming the problem type; about:blank when only the status says it.

max length 200
titlestringrequired

A short summary of the problem type, the same for every occurrence.

max length 200
statusintegerrequired

The HTTP status code of this answer.

min 400 · max 599
detailstring

What went wrong this time, for a person to read.

max length 500
instancestring<uri-reference>

A URI reference of this occurrence, quoted to support.

max length 200
codestringrequired

What a client branches on, stable across releases.

matches ^[a-z][a-z0-9_]{0,63}$
retryAfterSecondsinteger

Seconds to wait before asking again, on 429 and 503; the Retry-After header agrees.

max 9007199254740991
errorsobject[]

The fields that were refused, on 400.

max items 50
Show properties
Array of object
fieldstringrequired

The refused field, as a JSON path into the request.

max length 200
codestringrequired

Why it was refused, stable across releases.

max length 64
messagestring

The reason, for a person to read.

max length 200
Try it
Server
Authorization
Parameters
Request
curl -X POST '/v1/me/telegram/link-code' \
  -H 'Cookie: session=YOUR_API_KEY' \
  -H 'Idempotency-Key: string' \
  -H 'Accept: application/json'
Response
{
  "code": "string",
  "expiresAt": 1793145600
}