Skip to main content
POST
/
api-keys
curl --request POST \
  --url https://api.eu.bronto.io/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-BRONTO-API-KEY: <api-key>' \
  --data '
{
  "name": "Production Monitoring API Key",
  "roles": [
    "IngestionApi",
    "SearchApi",
    "AdminApi"
  ],
  "ttl": 31536000
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "Production API Key",
  "created_at": 1710948395538,
  "api_key": "2ad85149",
  "roles": [
    "SearchApi",
    "IngestionApi"
  ],
  "tags": {
    "region": "eu",
    "environment": "production"
  },
  "expires_at": 1757000000
}

Authorizations

X-BRONTO-API-KEY
string
header
required

Body

application/json
name
string
required

The name of the API key to create

Required string length: 1 - 255
Example:

"Production API Key"

roles
object
required

A list of api key role ids

Example:
["IngestionApi"]
ttl
integer<int64>

The time to live for the API key in seconds, defaults to no expiry

Required range: 0 <= x <= 70000000
Example:

31536000

Response

API keys is created successfully

id
string<uuid>

The unique identifier for the API key

name
string

The name of the API key

Example:

"Production API Key"

created_at
integer<int64>

The timestamp when the API key was created

Example:

1710948395538

api_key
string

The first 8 characters of the API key. Note its not possible to retrieve the key after creation time.

Example:

"2ad85149"

roles
object

A list of api key role ids

Example:
["SearchApi", "IngestionApi"]
tags
object

A map of key value pairs associated with this log

Example:
{
  "region": "eu",
  "environment": "production"
}
expires_at
integer<int64>

The expiration time of the API key, expressed as a Unix timestamp. If not set, the key never expires.

Example:

1757000000