Skip to main content

Create New API Key

POST 

/company/apikey/

Create a new API Key for the authenticated user associated with their company.

Operation Flow:

  1. Validate that the user exists and belongs to a company
  2. Verify that the maximum limit of API Keys per company has not been exceeded
  3. Generate a unique key with a prefix based on the environment (sk_test_ or sk_live_)
  4. Create a temporary code for management operations
  5. Store the key in the database

Important Considerations:

  • The API Key is only displayed in full at the moment of creation
  • It cannot be retrieved later; it must be stored securely
  • Each company has a maximum allowed number of keys
  • Requires valid JWT authentication

Request Example:

{
type: write
}

Possible Errors:

  • 400: Invalid request (type not specified)
  • 401: Not authenticated
  • 403: Key limit reached
  • 404: User or company not found

Request

Responses

Successful operation