Skip to main content
POST
Create API Key

Endpoint

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.

Request Body

object
required
Container for API data
string
required
Must be "auth"
object
required
Container for authentication attributes
string
required
Your application ID provided during onboarding

Example Request

Response

Success Response (201 Created)

Contains URLs related to the resource
object
Container for response data

Example Response

Code Examples

Error Responses

Common Error Scenarios

Error: 401 UnauthorizedSolution: Ensure the x-api-key header is included in the request with your valid API key.
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