Skip to main content
When there is no event to reply to — or the 45-minute window has closed — use an API key. Cron follow-ups, overnight batch results, and messages you start yourself all live here.

Get a key

Create one in your bot’s settings. It is shown once — we only keep a hashed copy. Each key belongs to exactly one chatbot and can only reach that bot’s conversations.

Send a message

Response

Read history

Page through history with after_seq. Every message has a seq number that only goes up, which makes it a safe bookmark.
after_seq
number
default:"0"
Return messages with a seq higher than this.
limit
number
default:"50"
Between 1 and 100. Numbers outside that range are pulled back in.
Response
To check for new messages, remember the highest seq you have seen and send it back as after_seq. When last_seq matches your bookmark, you are up to date.

Limits

Errors

A conversation that belongs to another bot returns 404, not 403. It looks the same as an id that does not exist — on purpose, so a key cannot be used to hunt for other bots’ conversations.

Next

Edit a sent message

PATCH any bot message. No time limit.

Attach a file

Upload it, then use the file_id.