API Authentication
Token-based authentication for the platform REST API.
Everything the Console does is available through the REST API at https://api.daakyicloud.com/v1. Authentication is a two-step token flow: exchange your long-lived API key for a short-lived bearer token, then send that token with every request.
1. Create an API Key
In the Console: Security → API Keys → Create Key. The key inherits the role permissions of its owning user — create dedicated automation users with minimal roles (see IAM). The secret is shown once; store it in a secrets manager.
2. Exchange for a Token
/v1/auth/tokensExchange an API key for a bearer token (valid 1 hour).
{
"api_key": "dk_live_9f2a..."
}{
"token": "eyJhbGciOiJSUzI1NiIs...",
"expires_in": 3600,
"organization": "org-7c21",
"role": "operator"
}3. Call the API
TOKEN=$(curl -s -X POST "https://api.daakyicloud.com/v1/auth/tokens" \
-H "Content-Type: application/json" \
-d '{"api_key": "'$DAAKYI_API_KEY'"}' | jq -r .token)
curl -s "https://api.daakyicloud.com/v1/vms" \
-H "Authorization: Bearer $TOKEN"Conventions
- All requests and responses are JSON; timestamps are UTC ISO-8601
- List endpoints paginate with ?page= and ?per_page= (max 100) and return a total count
- Long-running operations (create VM, restore backup) return a task ID — poll GET /v1/tasks/{id} for completion
- Errors return a machine-readable code and human-readable message: {"error": {"code": "quota_exceeded", "message": "..."}}
Rate Limits
| Scope | Limit |
|---|---|
| Read requests | 300 per minute per token |
| Write requests | 60 per minute per token |
| Token issuance | 10 per minute per API key |
Never embed API keys in client-side code or repositories. Keys can be revoked instantly under Security → API Keys if one leaks.
