setChatAdministratorCustomTitle
Set a custom title for an administrator in the chat.
Request
POST /:token/setchatadministratorcustomtitle
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier or username of the target chat |
| user_id | Integer | Yes | Unique identifier of the target administrator user |
| custom_title | String | Yes | Custom title for the administrator, 0-16 characters. Set to an empty string to clear the custom title |
Response
Returns Boolean true on success.
json
{
"ok": true,
"result": true
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, such as custom_title exceeding 16 characters or the target user is not an administrator |
| 401 | Invalid or expired token |
| 403 | Bot does not have sufficient administrator privileges to perform this action |
| 404 | Chat or user not found |
| 500 | Internal server error |
Example
cURL
Set a custom title
bash
curl -X POST "https://api.example.com/<token>/setchatadministratorcustomtitle" \
-H "Content-Type: application/json" \
-d '{
"chat_id": -1001234567890,
"user_id": 987654321,
"custom_title": "Tech Lead"
}'Clear a custom title
bash
curl -X POST "https://api.example.com/<token>/setchatadministratorcustomtitle" \
-H "Content-Type: application/json" \
-d '{
"chat_id": -1001234567890,
"user_id": 987654321,
"custom_title": ""
}'