Generate API Key
Generates a new API key for the authenticated user
This endpoint generates a new API key for the authenticated user. API keys can be used to authenticate API requests instead of using Firebase authentication. This is useful for server-to-server communication or for integrating BRX with other applications. The generated API key will have the same permissions as the authenticated user.
Request
This endpoint does not require any parameters.
Example Request
Response
Example Response
Error Codes
Unauthorized - Authentication credentials are missing or invalid
Forbidden - The authenticated user does not have permission to generate API keys
Too Many Requests - The user has exceeded the API key generation rate limit
Internal Server Error - An unexpected error occurred on the server
Notes
- API keys are used to authenticate API requests instead of using Firebase authentication.
- API keys have the same permissions as the authenticated user who generated them.
- API keys should be kept secure and not shared with unauthorized users.
- If an API key is compromised, it should be deleted using the Delete API Key endpoint.
- There is a rate limit on API key generation to prevent abuse. If you exceed this limit, you will receive a 429 Too Many Requests response.
- To list all API keys for the authenticated user, use the List API Keys endpoint.
- To delete an API key, use the Delete API Key endpoint.
Authentication
To use an API key for authentication, include it in the key
header of your API requests:
API keys can be used for all API endpoints that support authentication.