Update role assignment for a user
curl --request PUT \
--url https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleId": "project_reader",
"projectId": "project-beta"
}
'import requests
url = "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}"
payload = {
"roleId": "project_reader",
"projectId": "project-beta"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roleId: 'project_reader', projectId: 'project-beta'})
};
fetch('https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}', 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}/assignments/{assigneeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'roleId' => 'project_reader',
'projectId' => 'project-beta'
]),
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.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}"
payload := strings.NewReader("{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}"
response = http.request(request)
puts response.read_body{
"assigneeId": "jane.smith",
"assigneeType": "USER",
"roleId": "account_admin",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}IAM
Update Role Assignment for a User
Update an existing role assignment for a user. This replaces the current role with a new role.
Restrictions:
- Organization admins cannot demote themselves (change their own role from account_admin to a non-admin role)
- The last organization admin in an account cannot be demoted
PUT
/
api
/
v1
/
accounts
/
{accountId}
/
roles
/
{roleId}
/
assignments
/
{assigneeId}
Update role assignment for a user
curl --request PUT \
--url https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"roleId": "project_reader",
"projectId": "project-beta"
}
'import requests
url = "https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}"
payload = {
"roleId": "project_reader",
"projectId": "project-beta"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({roleId: 'project_reader', projectId: 'project-beta'})
};
fetch('https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}', 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}/assignments/{assigneeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'roleId' => 'project_reader',
'projectId' => 'project-beta'
]),
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.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}"
payload := strings.NewReader("{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aion.xyz/api/v1/accounts/{accountId}/roles/{roleId}/assignments/{assigneeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"roleId\": \"project_reader\",\n \"projectId\": \"project-beta\"\n}"
response = http.request(request)
puts response.read_body{
"assigneeId": "jane.smith",
"assigneeType": "USER",
"roleId": "account_admin",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
JWT Bearer token authentication
Path Parameters
The account identifier (external account ID)
Example:
"my-company-account"
The new role identifier to assign
Example:
"project_admin"
The assignee identifier (external user ID)
Example:
"john.doe"
Query Parameters
Project identifier for project-scoped role assignments
Example:
"project-alpha"
Body
application/json
The type of assignee
Available options:
USER, IAMGROUP The current role identifier being replaced
Example:
"project_reader"
Project identifier (for project-scoped roles)
Example:
"project-beta"
The status of the role assignment
Available options:
ACTIVE, INACTIVE Response
Role assignment successfully updated
Assignee identifier (external user/group ID)
Example:
"jane.smith"
The type of assignee
Available options:
USER, IAMGROUP Role identifier
Example:
"account_admin"
The status of the role assignment
Available options:
ACTIVE, INACTIVE 