Hush Docs

Hush Bot API

Access Hush Bot programmatically! Authenticate, send commands, retrieve data, and integrate with your applications safely and efficiently.

API Overview

Hush Bot API allows you to integrate server management features into your own apps or scripts. Each request must be authenticated with your personal API token, and endpoints may require specific permissions.

Authentication

Securely authenticate with your API token.

Endpoints

Access user info, server stats, and more.

Permissions

Endpoints require specific access levels.

Authentication

Include your API token in the Authorization header.

GET /v1/users
Authorization: Bearer YOUR_API_TOKEN

Note:

Never share your API token publicly. Keep it secure!

Endpoints

Get User Info

Retrieve details about a user by ID.

GET /v1/users/:id
Authorization: Bearer YOUR_API_TOKEN

Admin

Response:

{
  "id": "123456",
  "username": "User#1234",
  "roles": ["Admin", "Member"]
}

Code Examples:

// JavaScript (fetch)
fetch('https://api.hushbot.com/v1/users/123456', {
  headers: { Authorization: 'Bearer YOUR_API_TOKEN' }
})
# Python (requests)
import requests
headers = {'Authorization': 'Bearer YOUR_API_TOKEN'}
requests.get('https://api.hushbot.com/v1/users/123456', headers=headers)
# curl
curl -H "Authorization: Bearer YOUR_API_TOKEN" https://api.hushbot.com/v1/users/123456

Get Server Stats

Retrieve server member counts and bot stats.

GET /v1/servers/:id/stats
Authorization: Bearer YOUR_API_TOKEN

Server Owner

Response:

{
  "members": 120,
  "bots": 5,
  "online": 95
}

Code Examples:

// JavaScript (fetch)
fetch('https://api.hushbot.com/v1/servers/123456/stats', {
  headers: { Authorization: 'Bearer YOUR_API_TOKEN' }
})
# Python (requests)
import requests
headers = {'Authorization': 'Bearer YOUR_API_TOKEN'}
requests.get('https://api.hushbot.com/v1/servers/123456/stats', headers=headers)
# curl
curl -H "Authorization: Bearer YOUR_API_TOKEN" https://api.hushbot.com/v1/servers/123456/stats

Rate Limits & Best Practices

  • Maximum of 60 requests per minute per server.
  • Use exponential backoff if receiving 429 Too Many Requests.
  • Always authenticate requests with your API token.
  • Cache responses where possible to reduce unnecessary calls.

Versioning & Changelog

Current API Version: v1

  • v1.2: Added /servers/:id/stats endpoint.
  • v1.1: Improved authentication and token validation.
  • v1.0: Initial release.

Common Errors & FAQs

401 Unauthorized:

Check your API token and headers.

429 Too Many Requests:

You exceeded the rate limit. Wait before retrying.

404 Not Found:

Check your endpoint URL and parameters.

Quick Links