---
title: "Update a bot user"
method: PATCH
path: "/telegram/users/{user}"
tags: ["Telegram bot users"]
---

# Update a bot user

`PATCH /telegram/users/{user}`

## Request

- Base URL: `https://api.vidmoat.com/v1`
- URL: `https://api.vidmoat.com/v1/telegram/users/{user}`
- Auth: HTTP bearer

Change one person: allowed (allowlist), blocked, daily_credits (null for the bot's default).

Live keys only, 120 changes a minute per app. A key only ever reaches its own app's bot. Blocking somebody stops work already queued for them and sends the telegram.end_user.blocked webhook.

## Path parameters

- `user` string, required

## Request body

- object
  - `allowed` boolean: `true` adds them to the allowlist (by id, or by the @username you gave when they have not used the bot yet); `false` removes them.
  - `blocked` boolean: `true` blocks them; `false` unblocks them.
  - `daily_credits` integer, nullable: Their own daily limit, 0 to 1,000,000, or `null` for the bot's default.

## Response `200`

Update a bot user

- object
  - `object` string: Always `telegram_user`.
  - `id` string, nullable: Vidmoat id of the person. `null` for somebody who has not used the bot yet.
  - `telegram_user_id` string, nullable: Numeric Telegram id, as a string.
  - `username` string, nullable: Telegram @username, without the @.
  - `display_name` string, nullable: Their Telegram name.
  - `status` 'active' | 'blocked': Whether they are blocked.
  - `allowlisted` boolean: On the bot's allowlist.
  - `daily_credits` integer, nullable: Their own daily credit limit. `null` means the bot's default.
  - `first_seen_at` string, nullable: ISO 8601 time of their first message.
  - `last_seen_at` string, nullable: ISO 8601 time of their latest message.
  - `projects` integer: Projects they have. Omitted for somebody who has not used the bot.
  - `messages_today` integer: Since midnight UTC. Omitted for somebody who has not used the bot.
  - `messages_30d` integer: Last 30 days. Omitted for somebody who has not used the bot.
  - `credits_today` integer: Credits spent since midnight UTC. Omitted for somebody who has not used the bot.
  - `credits_30d` integer: Credits spent in the last 30 days. Omitted for somebody who has not used the bot.

## Other responses

- `400`: `invalid_request`: No field to change, a value of the wrong type, a test key, or an allowlist already at 5,000 entries.
- `404`: `not_found`: The key is not minted for an app you own (a personal key, for example). Use a key from the app whose bot you manage. `not_found`: No bot is connected to the app yet.
- `429`: `rate_limited`: More than 120 changes a minute on this app.

---

[API](https://skmtc.dev/vidmoat/apis/vidmoat-api.md) · [All operations](https://skmtc.dev/vidmoat/apis/vidmoat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vidmoat/apis/vidmoat-api/revisions/23e24e25c756?raw)
