Create New API Key
POST/company/apikey/
Create a new API Key for the authenticated user associated with their company.
Operation Flow:
- Validate that the user exists and belongs to a company
- Verify that the maximum limit of API Keys per company has not been exceeded
- Generate a unique key with a prefix based on the environment (sk_test_ or sk_live_)
- Create a temporary code for management operations
- 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
- 200
- 400
- 401
- 403
Successful operation
Invalid request
Unauthorized
Forbidden