Authentication
Learn how to authenticate your API requests
Customer API calls use two headers: x-api-key and x-workspace-id. Send both on every request.
curl https://api.trillet.ai/v1/api/workspaces \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json"
x-api-keystringrequiredAPI key for the call. Generate it in the Trillet settings dashboard.
x-workspace-idstringrequiredWorkspace the request applies to. Required on customer API calls.
Content-TypestringrequiredSet to application/json for JSON bodies. File uploads use multipart/form-data.
Authorization: Bearer is a dashboard session token. The API key belongs in x-api-key.
Obtaining API Keys
Generate an API key under the Settings tab. Each key has its own permissions and limits.
Get your API key from the Trillet Settings Dashboard.
Security Best Practices
- Keep API keys on your server. A browser or mobile app should use a short-lived SDK token from Create SDK Token.
- Rotate API keys periodically.
- Use different API keys for development and production.
- Watch key usage for unexpected traffic.