Endpoint
POST https://api.digitzs.com/auth/key
Overview
Use this endpoint to generate an app key for your application. The app key is required to create access tokens via the /auth/token endpoint.
Creating a new app key renders the previous key unusable. Plan key rotation carefully to avoid service disruption.
Authentication
This endpoint requires only the x-api-key header. No Bearer token is needed.
Header Value Required
x-api-keyYour API key from onboarding Yes Content-Typeapplication/jsonYes
Request Body
Container for authentication attributes
Your application ID provided during onboarding
Example Request
{
"data" : {
"type" : "auth" ,
"attributes" : {
"appId" : "your-application-id"
}
}
}
Response
Success Response (201 Created)
Contains URLs related to the resource URL of the current endpoint
Container for response data Resource type - will be "auth"
Your API key (same as the x-api-key header)
Generated app key for creating access tokens
Example Response
{
"links" : {
"self" : "https://api.digitzs.com/auth/key"
},
"data" : {
"type" : "auth" ,
"id" : "api-key-xyz" ,
"attributes" : {
"appKey" : "generated-app-key-abc123"
}
}
}
Code Examples
cURL
JavaScript
Python
PHP
Ruby
curl -X POST https://api.digitzs.com/auth/key \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"data": {
"type": "auth",
"attributes": {
"appId": "your-application-id"
}
}
}'
Error Responses
400 Bad Request
401 Unauthorized
403 Forbidden
{
"errors" : [
{
"status" : "400" ,
"title" : "Bad Request" ,
"detail" : "The appId field is required" ,
"source" : {
"pointer" : "/data/attributes/appId"
}
}
]
}
Common Error Scenarios
Error: 400 Bad RequestSolution: Verify your application ID matches the ID provided during onboarding.
Error: 403 ForbiddenSolution: Contact Digitzs support to check your account status.
Best Practices
Store Securely: Save the returned app key in a secure location (environment variable or secret management service). You’ll need it to generate access tokens.
Key Rotation: When creating a new app key, the previous key becomes invalid immediately. Ensure all services are updated before rotating keys.
Next Steps
After creating an app key, use it to generate an access token:
Create App Token Generate an access token using your app key