Create a new role
curl --request POST \
--url https://api.eu.bronto.io/roles \
--header 'Content-Type: application/json' \
--header 'X-BRONTO-API-KEY: <api-key>' \
--data '
{
"role_type": "<string>",
"display_name": "<string>",
"description": "<string>",
"permissions": [
"tag_write",
"tag_read",
"tag_delete"
]
}
'import requests
url = "https://api.eu.bronto.io/roles"
payload = {
"role_type": "<string>",
"display_name": "<string>",
"description": "<string>",
"permissions": ["tag_write", "tag_read", "tag_delete"]
}
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({
role_type: '<string>',
display_name: '<string>',
description: '<string>',
permissions: ['tag_write', 'tag_read', 'tag_delete']
})
};
fetch('https://api.eu.bronto.io/roles', 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/roles",
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([
'role_type' => '<string>',
'display_name' => '<string>',
'description' => '<string>',
'permissions' => [
'tag_write',
'tag_read',
'tag_delete'
]
]),
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/roles"
payload := strings.NewReader("{\n \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\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/roles")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/roles")
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 \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"role_id": "<string>",
"role_type": "USER",
"display_name": "<string>",
"description": "<string>",
"is_system_role": true,
"metadata": {
"created_at": 123,
"created_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"modified_at": 123,
"modified_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"deleted_at": 123,
"deleted_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_heartbeat_at": 1791331200000
},
"permissions": [
{
"group_name": "<string>",
"group_display_name": "<string>",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"type": "<string>",
"restricted": true,
"sensitive": true
}
]
}{
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window."
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}roles
Create a new role
Creates a new role with specified permissions in the organization. Roles define sets of permissions that can be assigned to users to control their access to various system features and resources. The role must have a unique identifier and include at least one permission.
POST
/
roles
Create a new role
curl --request POST \
--url https://api.eu.bronto.io/roles \
--header 'Content-Type: application/json' \
--header 'X-BRONTO-API-KEY: <api-key>' \
--data '
{
"role_type": "<string>",
"display_name": "<string>",
"description": "<string>",
"permissions": [
"tag_write",
"tag_read",
"tag_delete"
]
}
'import requests
url = "https://api.eu.bronto.io/roles"
payload = {
"role_type": "<string>",
"display_name": "<string>",
"description": "<string>",
"permissions": ["tag_write", "tag_read", "tag_delete"]
}
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({
role_type: '<string>',
display_name: '<string>',
description: '<string>',
permissions: ['tag_write', 'tag_read', 'tag_delete']
})
};
fetch('https://api.eu.bronto.io/roles', 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/roles",
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([
'role_type' => '<string>',
'display_name' => '<string>',
'description' => '<string>',
'permissions' => [
'tag_write',
'tag_read',
'tag_delete'
]
]),
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/roles"
payload := strings.NewReader("{\n \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\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/roles")
.header("X-BRONTO-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.bronto.io/roles")
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 \"role_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": [\n \"tag_write\",\n \"tag_read\",\n \"tag_delete\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"role_id": "<string>",
"role_type": "USER",
"display_name": "<string>",
"description": "<string>",
"is_system_role": true,
"metadata": {
"created_at": 123,
"created_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"modified_at": 123,
"modified_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"deleted_at": 123,
"deleted_by": {
"type": "API_KEY_ID",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"last_heartbeat_at": 1791331200000
},
"permissions": [
{
"group_name": "<string>",
"group_display_name": "<string>",
"name": "<string>",
"display_name": "<string>",
"description": "<string>",
"type": "<string>",
"restricted": true,
"sensitive": true
}
]
}{
"code": 400,
"type": "Bad Request",
"correlation_id": "95c6a974e3ab01209b6b0dfedb1b16c5",
"details": "Validation failed: 'name' field is required and cannot be empty"
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 404,
"type": "Not Found",
"correlation_id": "605f832bcfe44a1081441691c8d42253",
"details": "Resource not found."
}{
"code": 429,
"type": "Too Many Requests",
"correlation_id": "53909ed43c544531b7a555e295960437",
"details": "Rate limit exceeded. Maximum 100 requests are allowed within a 5-minute window."
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}{
"code": 500,
"type": "Internal Server Error",
"correlation_id": "b129b8e0e66c41aa9541a30f67e38ce2",
"details": "Internal Server Error"
}Authorizations
ApiKeyAuthBearerAuth
Body
application/json
Response
Role created successfully
The ID of the role
The entity which the roles can be applied to
Available options:
USER, API The display name of the role
Description of the role
Whether this is a built-in system role or a custom user-created role
Common metadata attached to all persisted resources.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
