curl --request GET \
--url https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}', 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.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "account_admin",
"name": "account_admin",
"scope": "ACCOUNT",
"status": "ACTIVE",
"isCustom": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountId": "my-company-account",
"projectId": "project-alpha",
"description": "Full administrative access to the account",
"createdBy": "admin.user"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request parameters",
"details": [
"accountId must be a valid identifier"
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Insufficient permissions to access this resource"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}Get a Specific Role
Retrieve details of a specific role by its identifier
curl --request GET \
--url https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}', 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.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "account_admin",
"name": "account_admin",
"scope": "ACCOUNT",
"status": "ACTIVE",
"isCustom": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountId": "my-company-account",
"projectId": "project-alpha",
"description": "Full administrative access to the account",
"createdBy": "admin.user"
}{
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request parameters",
"details": [
"accountId must be a valid identifier"
]
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}{
"error": {
"code": "FORBIDDEN",
"message": "Insufficient permissions to access this resource"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}Authorizations
JWT Bearer token authentication
Path Parameters
The account identifier (external account ID)
"my-company-account"
The role identifier (external role ID)
"account_admin"
Response
Successfully retrieved role
Role identifier (external_id from database)
50"account_admin"
Role name
"account_admin"
The scope of the role:
- ACCOUNT: Role applies at the account level (e.g., account_admin)
- PROJECT: Role applies at the project level (e.g., project_admin, project_reader)
- RESOURCE: Role applies to specific resources
ACCOUNT, PROJECT, RESOURCE The status of the role
ACTIVE, INACTIVE Whether this is a custom role (false for system roles like account_admin, project_admin, project_reader)
Timestamp when the role was created
Timestamp when the role was last updated
Account identifier (external account ID, null for system roles)
"my-company-account"
Project identifier (external project ID, for project-scoped custom roles)
"project-alpha"
Role description
500"Full administrative access to the account"
Creator identifier (external user ID)
"admin.user"
