Skip to main content
PUT
/
roles
/
{id}
Update a role
import requests

url = "https://{FUSION HOST}/api/roles/{id}"

payload = { "name": "test-role" }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.put("https://{FUSION HOST}/api/roles/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"test-role\"\n}")
.asString();
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'test-role'})
};

fetch('https://{FUSION HOST}/api/roles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
require 'uri'
require 'net/http'

url = URI("https://{FUSION HOST}/api/roles/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"test-role\"\n}"

response = http.request(request)
puts response.read_body
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{FUSION HOST}/api/roles/{id}"

payload := strings.NewReader("{\n \"name\": \"test-role\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

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))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{FUSION HOST}/api/roles/{id}",
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([
'name' => 'test-role'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request PUT \
--url https://{FUSION HOST}/api/roles/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "test-role"
}
'
{
  "id": "9902679c-7f7e-4a66-8c28-b178a07afc46",
  "name": "test-role",
  "createdAt": "2025-10-31T18:12:59Z",
  "updatedAt": "2025-10-31T18:44:34Z",
  "permissions": [
    {
      "methods": [
        "OPTIONS",
        "GET",
        "PUT"
      ],
      "path": "/"
    }
  ],
  "uiPermissions": [
    "string",
    "string"
  ]
}

Path Parameters

id
string
required

The role ID. Use GET /roles to get the list of role IDs.

Body

application/json
name
string
required
id
string
createdAt
string<date-time>
Example:

"2025-09-23T17:48:07Z"

updatedAt
string<date-time>
Example:

"2025-10-31T12:28:04Z"

desc
string
permissions
object[]
uiPermissions
string[]

Response

OK