POST
/
generate_api_brx
{
  "401": {},
  "403": {},
  "429": {},
  "500": {},
  "UpdateKeyResponse": {
    "generated": true,
    "apiKey": "<string>"
  }
}

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

UpdateKeyResponse
object

Example Response

{
  "UpdateKeyResponse": {
    "generated": true,
    "apiKey": "brx_api_12345678-90ab-cdef-1234-567890abcdef"
  }
}

Error Codes

401
object

Unauthorized - Authentication credentials are missing or invalid

403
object

Forbidden - The authenticated user does not have permission to generate API keys

429
object

Too Many Requests - The user has exceeded the API key generation rate limit

500
object

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:

key: brx_api_12345678-90ab-cdef-1234-567890abcdef

API keys can be used for all API endpoints that support authentication.