- Home
- API Documentation
API Documentation
Programmatically access your encrypted data using our secure REST API with token-based authentication.
Chapters
Getting Started
Generate an API key in your account settings to begin
To use the Hexbon API, you need to generate an API key from your Account Settings → API Settings page. The API uses a two-step authentication flow for enhanced security.
Authentication Flow
Request a Token
Use your API key to request a temporary access token via POST /api/v1/auth
Token Validity
The token is valid for 60 minutes. After expiry, request a new token.
Use the Token
Include the token in the Authorization: Bearer <token> header for data operations.
Rate Limiting
The API is rate-limited to 10 requests per minute per user. Exceeding this limit will result in a 429 Too Many Requests response.
Endpoints
Authenticate
https://hexbon.com/api/v1/auth
Generate a temporary access token using your API key.
Headers
| X-API-Key | Your API key (required) |
curl -X POST "https://hexbon.com/api/v1/auth" \ -H "X-API-Key: your_api_key_here"
{
"success": true,
"bearer_token": "abc123def456...",
"expires_at": "2025-11-27T15:30:00Z",
"expires_in": 3600
}
Read
https://hexbon.com/api/v1/data
Retrieve your encrypted data. Returns the client-encrypted payload (v1:... or v2:...).
Headers
| Authorization | Bearer {token} (required) |
curl -X GET "https://hexbon.com/api/v1/data" \ -H "Authorization: Bearer your_token_here"
{
"success": true,
"data": "v1:encrypted_payload_here..."
}
Update
https://hexbon.com/api/v1/data
Save your encrypted data. Accepts a client-encrypted payload (v1:... or v2:...) in the request body.
Note: Write access must be enabled in your API Settings. By default, API access is read-only.
Headers
| Authorization | Bearer {token} (required) |
| Content-Type | application/json (required) |
Request Body
| data | Client-encrypted payload starting with v1: or v2: (required) |
curl -X POST "https://hexbon.com/api/v1/data" \
-H "Authorization: Bearer your_token_here" \
-H "Content-Type: application/json" \
-d '{"data": "v2:your_encrypted_payload"}'
{
"success": true,
"message": "Encrypted data saved successfully."
}
Response Format
All API responses are returned in JSON format with a success boolean field indicating the operation result.
{ "success": true, "data": "..." }
{ "success": false, "message": "Error description" }
Error Codes
| Code | Description |
|---|---|
| 401 | Invalid or missing API key / expired token |
| 403 | Write access disabled (for POST /data) |
| 422 | Invalid payload format or storage limit exceeded |
| 429 | Rate limit exceeded (10 requests/minute) |
| 500 | Internal server error |
Ready to Get Started?
Generate your API key and start integrating with Hexbon today.
Go to API Settings