Create a new API key
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 API Key",
"roles": [
"IngestionApi"
]
}
'import requests
url = "https://api.eu.bronto.io/api-keys"
payload = {
"name": "Production API Key",
"roles": ["IngestionApi"]
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Production API Key', roles: ['IngestionApi']})
};
fetch('https://api.eu.bronto.io/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.bronto.io/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production API Key',
'roles' => [
'IngestionApi'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.bronto.io/api-keys")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Production API Key",
"created_at": 1710948395538,
"api_key": "2ad85149",
"roles": [
"SearchApi",
"IngestionApi"
],
"tags": {
"region": "eu",
"environment": "production"
}
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}api-keys
Create a new API key
Create a new Bronto API key with one or more role scopes such as IngestionApi or SearchApi, and an optional TTL, for authenticating REST API requests.
POST
/
api-keys
Create a new API key
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 API Key",
"roles": [
"IngestionApi"
]
}
'import requests
url = "https://api.eu.bronto.io/api-keys"
payload = {
"name": "Production API Key",
"roles": ["IngestionApi"]
}
headers = {
"X-BRONTO-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-BRONTO-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Production API Key', roles: ['IngestionApi']})
};
fetch('https://api.eu.bronto.io/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eu.bronto.io/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production API Key',
'roles' => [
'IngestionApi'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-BRONTO-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eu.bronto.io/api-keys"
payload := strings.NewReader("{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-BRONTO-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eu.bronto.io/api-keys")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-BRONTO-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production API Key\",\n \"roles\": [\n \"IngestionApi\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Production API Key",
"created_at": 1710948395538,
"api_key": "2ad85149",
"roles": [
"SearchApi",
"IngestionApi"
],
"tags": {
"region": "eu",
"environment": "production"
}
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}{
"code": 201,
"correlation_id": "<string>",
"message": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
Body
application/json
Response
API keys is created successfully
The unique identifier for the API key
The name of the API key
Example:
"Production API Key"
The timestamp when the API key was created
Example:
1710948395538
The first 8 characters of the API key. Note its not possible to retrieve the key after creation time.
Example:
"2ad85149"
A list of api key role ids
Example:
["SearchApi", "IngestionApi"]
A map of key value pairs associated with this log
Show child attributes
Show child attributes
Example:
{
"region": "eu",
"environment": "production"
}
⌘I

