Skip to main content
POST
/
v1
/
admin
/
bots
/
{bot_id}
/
regenerate-key
curl -X POST https://portal-api.7331.org/v1/admin/bots/1/regenerate-key \
  -b "psession=YOUR_SESSION"
{
  "bot": {
    "id": 1,
    "name": "Portal Bot",
    "owner_id": 42,
    "bot_type": 1,
    "is_active": true,
    "rate_limit_per_hour": 1000,
    "groups": 250,
    "users": 50000,
    "is_verified": true,
    "created_at": "2025-01-01T00:00:00Z",
    "updated_at": "2026-03-05T12:00:00Z"
  },
  "api_key": "hbot_abc123def456...",
  "message": "API key regenerated for bot Portal Bot",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2026-03-05T12:00:00Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.7331.org/llms.txt

Use this file to discover all available pages before exploring further.

Requires an active admin session cookie. Hierarchy enforced against the bot owner.
bot_id
integer
required
Bot ID.

Response

Returns the bot details with the new plaintext API key. Store the key securely — it cannot be retrieved later.
bot
object
required
Updated bot details.
api_key
string
required
New plaintext API key (shown only once).
message
string
required
Success message.
curl -X POST https://portal-api.7331.org/v1/admin/bots/1/regenerate-key \
  -b "psession=YOUR_SESSION"
{
  "bot": {
    "id": 1,
    "name": "Portal Bot",
    "owner_id": 42,
    "bot_type": 1,
    "is_active": true,
    "rate_limit_per_hour": 1000,
    "groups": 250,
    "users": 50000,
    "is_verified": true,
    "created_at": "2025-01-01T00:00:00Z",
    "updated_at": "2026-03-05T12:00:00Z"
  },
  "api_key": "hbot_abc123def456...",
  "message": "API key regenerated for bot Portal Bot",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2026-03-05T12:00:00Z"
}