API
API Overview
The AutoHost Cloud API is a REST + gRPC backend that manages nodes, enrollment, heartbeats, metrics, and remote command execution.
The AutoHost Cloud API is a REST + gRPC backend that manages the entire AutoHost ecosystem. It handles user authentication, node registration, heartbeats, metrics collection, and remote command execution.
Base URL
- REST: http://<host>:8080
- gRPC: <host>:9090
Authentication
The API uses two authentication mechanisms:
- JWT (user auth): For dashboard and user-facing operations. Access tokens are short-lived (15 min) with refresh tokens (24 hours).
- Node tokens: For agent-to-API communication (heartbeats, metrics). Issued during enrollment.
Keep tokens secure
Node tokens grant access to send heartbeats and metrics on behalf of a node. Never commit them to version control or share them publicly.
gRPC
The agent connects to the gRPC server to:
- Register available commands (built-in + custom scripts)
- Receive job assignments
- Report job results (output, errors, status)
The AutoHost API uses token-based authentication. All API requests must include a valid API token in the Authorization header.
API Tokens
Generate an API token from the Cloud Panel under Settings > API Tokens, or use the CLI:
bash
autohost tokens create --name "My API Token" --scope read,write
Keep Tokens Secure
API tokens provide full access to your account. Never commit tokens to version control or share them publicly.
Making Requests
bash
curl -X GET "https://api.autohost.cloud/v1/services" \ -H "Authorization: Bearer your-api-token" \ -H "Content-Type: application/json"
Token Scopes
- read - Read-only access to resources
- write - Create and modify resources
- delete - Delete resources
- admin - Full administrative access