Admin
Create an empty access role
Requires a signed-in team user, the team_access_roles_v1 rollout and Manage Access roles (groups). API keys remain accepted by route middleware but cannot replace the user actor required by this controller. Creates a deny-by-default role at version 1. Permissions are not accepted by this operation; configure them through the role update after creation. Records an audit event.
POST
/
admin
/
access
/
roles
Create an empty access role
curl --request POST \
--url https://api.gratona.com/v1/admin/access/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/access/roles"
payload = {
"name": "<string>",
"source": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', source: '<string>'})
};
fetch('https://api.gratona.com/v1/admin/access/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.gratona.com/v1/admin/access/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([
'name' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.gratona.com/v1/admin/access/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/access/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/access/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"version": 123,
"can_manage": true,
"role": {
"id": 123,
"name": "<string>",
"is_full_access": true,
"member_count": 123,
"version": 123,
"access_summary": {
"level": "<string>",
"source": "<string>",
"label": "<string>"
},
"members": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"is_active": true,
"role_id": 123,
"access_assignment_version": 123
}
],
"stored_permissions": {},
"effective_access": {},
"access_by_area": {},
"restrictions": [
"<string>"
],
"editor_schema": {
"version": 123,
"role_id": 123,
"role_version": 123,
"affected_member_count": 123,
"editable": true,
"reason": "<string>",
"stored_permissions": {},
"stored_permissions_when_full_access_removed": {},
"sections": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "<string>",
"items": [
{
"id": "<string>",
"type": "<string>",
"area": "<string>",
"label": "<string>",
"description": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"kind": "<string>",
"polarity": "<string>",
"availability": "<string>",
"resource_type": "<string>",
"editable": true,
"reason": "<string>",
"editable_when_full_access_removed": true,
"affected_member_count": 123,
"version": 123,
"keys": [
"<string>"
],
"current": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"current_when_full_access_removed": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"allowed_values": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"allowed_values_when_full_access_removed": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"prerequisites": [
{
"key": "<string>",
"label": "<string>"
}
],
"resources": [
{
"id": 123,
"label": "<string>",
"key": "<string>",
"current": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"current_when_full_access_removed": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"allowed_values": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"editable": true,
"reason": "<string>",
"editable_when_full_access_removed": true,
"allowed_values_when_full_access_removed": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
]
}
]
}
]
}
]
}
},
"allowed_transitions": {
"can_edit": true,
"can_delete": true,
"can_assign": true,
"is_full_access_locked": true,
"requires_expected_version": true,
"advisory": true
}
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Headers
Optional correlation ID recorded with the access audit event.
Body
application/json
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Response
Create an empty access role response.
Show child attributes
Show child attributes
⌘I
Create an empty access role
curl --request POST \
--url https://api.gratona.com/v1/admin/access/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/access/roles"
payload = {
"name": "<string>",
"source": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', source: '<string>'})
};
fetch('https://api.gratona.com/v1/admin/access/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.gratona.com/v1/admin/access/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([
'name' => '<string>',
'source' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.gratona.com/v1/admin/access/roles"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.gratona.com/v1/admin/access/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/access/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"version": 123,
"can_manage": true,
"role": {
"id": 123,
"name": "<string>",
"is_full_access": true,
"member_count": 123,
"version": 123,
"access_summary": {
"level": "<string>",
"source": "<string>",
"label": "<string>"
},
"members": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"is_active": true,
"role_id": 123,
"access_assignment_version": 123
}
],
"stored_permissions": {},
"effective_access": {},
"access_by_area": {},
"restrictions": [
"<string>"
],
"editor_schema": {
"version": 123,
"role_id": 123,
"role_version": 123,
"affected_member_count": 123,
"editable": true,
"reason": "<string>",
"stored_permissions": {},
"stored_permissions_when_full_access_removed": {},
"sections": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"type": "<string>",
"items": [
{
"id": "<string>",
"type": "<string>",
"area": "<string>",
"label": "<string>",
"description": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"kind": "<string>",
"polarity": "<string>",
"availability": "<string>",
"resource_type": "<string>",
"editable": true,
"reason": "<string>",
"editable_when_full_access_removed": true,
"affected_member_count": 123,
"version": 123,
"keys": [
"<string>"
],
"current": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"current_when_full_access_removed": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"allowed_values": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"allowed_values_when_full_access_removed": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"prerequisites": [
{
"key": "<string>",
"label": "<string>"
}
],
"resources": [
{
"id": 123,
"label": "<string>",
"key": "<string>",
"current": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"current_when_full_access_removed": {
"stored": true,
"effective": true,
"level": "<string>",
"source": "<string>"
},
"allowed_values": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
],
"editable": true,
"reason": "<string>",
"editable_when_full_access_removed": true,
"allowed_values_when_full_access_removed": [
{
"value": "<string>",
"label": "<string>",
"enabled": true,
"reason": "<string>"
}
]
}
]
}
]
}
]
}
},
"allowed_transitions": {
"can_edit": true,
"can_delete": true,
"can_assign": true,
"is_full_access_locked": true,
"requires_expected_version": true,
"advisory": true
}
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}