Authentication
The DivinityCoin API uses API keys or OAuth 2.0 tokens for authentication. Include your credentials in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Public Keys (pk_...)
Read-only access. Safe to use in client-side code.
Private Keys (sk_...)
Full access. Keep secure on your server only.
Authentication
All API requests require authentication via API key or OAuth token.
POST
/api/v1/auth/tokenExchange OAuth credentials for an access token
Authentication:OAuth Client ID & Secret
Request Body
{
"grant_type": "client_credentials",
"client_id": "oauth_yourcompany_xxx",
"client_secret": "your_client_secret"
}Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600
}Rate Limits
API requests are rate limited based on your plan tier:
| Tier | Requests/Minute | Burst |
|---|---|---|
| Standard | 100 | 150 |
| Professional | 500 | 750 |
| Enterprise | 2000 | 3000 |
Rate limit headers are included in all responses:X-RateLimit-Remaining,X-RateLimit-Reset
Error Codes
| Code | Description |
|---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Contact support |