Roles
Updates a role
Replaces the permission keys a role grants. Send the complete permission_keys list: it overwrites the role’s current keys, and omitting it leaves them unchanged. The role’s name cannot be changed here. Requires a company admin Bearer token with the roles.update permission. You can add only permissions you hold yourself; keys already on the role and removals always pass, except that only a platform operator can remove permissions from a full-access system role. Otherwise it returns 403. Returns 404 when the role does not belong to your company and 422 when a permission key is not recognised.
PUT
/
api
/
company
/
roles
/
{id}
Updates a role
curl --request PUT \
--url https://api.fluid.app/api/company/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": {
"permission_keys": [
"orders.view",
"orders.update",
"refunds.view",
"refunds.create",
"subscriptions.view",
"subscriptions.update",
"orders.view_timeline"
]
}
}
'import requests
url = "https://api.fluid.app/api/company/roles/{id}"
payload = { "role": { "permission_keys": ["orders.view", "orders.update", "refunds.view", "refunds.create", "subscriptions.view", "subscriptions.update", "orders.view_timeline"] } }
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({
role: {
permission_keys: [
'orders.view',
'orders.update',
'refunds.view',
'refunds.create',
'subscriptions.view',
'subscriptions.update',
'orders.view_timeline'
]
}
})
};
fetch('https://api.fluid.app/api/company/roles/{id}', 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.fluid.app/api/company/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([
'role' => [
'permission_keys' => [
'orders.view',
'orders.update',
'refunds.view',
'refunds.create',
'subscriptions.view',
'subscriptions.update',
'orders.view_timeline'
]
]
]),
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.fluid.app/api/company/roles/{id}"
payload := strings.NewReader("{\n \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\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.fluid.app/api/company/roles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/company/roles/{id}")
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 \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"role": {
"id": 3187,
"name": "Customer Support",
"createdAt": "2026-09-14T15:42:08.311Z",
"user_count": 3,
"permission_keys": [
"orders.view",
"orders.update",
"refunds.view",
"refunds.create",
"subscriptions.view",
"subscriptions.update",
"orders.view_timeline"
]
},
"meta": {
"request_id": "5f0c2b9e-3d41-4a7e-9b12-6e8d4c0a7f31",
"timestamp": "2026-09-30T14:05:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}⌘I
Updates a role
curl --request PUT \
--url https://api.fluid.app/api/company/roles/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"role": {
"permission_keys": [
"orders.view",
"orders.update",
"refunds.view",
"refunds.create",
"subscriptions.view",
"subscriptions.update",
"orders.view_timeline"
]
}
}
'import requests
url = "https://api.fluid.app/api/company/roles/{id}"
payload = { "role": { "permission_keys": ["orders.view", "orders.update", "refunds.view", "refunds.create", "subscriptions.view", "subscriptions.update", "orders.view_timeline"] } }
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({
role: {
permission_keys: [
'orders.view',
'orders.update',
'refunds.view',
'refunds.create',
'subscriptions.view',
'subscriptions.update',
'orders.view_timeline'
]
}
})
};
fetch('https://api.fluid.app/api/company/roles/{id}', 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.fluid.app/api/company/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([
'role' => [
'permission_keys' => [
'orders.view',
'orders.update',
'refunds.view',
'refunds.create',
'subscriptions.view',
'subscriptions.update',
'orders.view_timeline'
]
]
]),
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.fluid.app/api/company/roles/{id}"
payload := strings.NewReader("{\n \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\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.fluid.app/api/company/roles/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/company/roles/{id}")
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 \"role\": {\n \"permission_keys\": [\n \"orders.view\",\n \"orders.update\",\n \"refunds.view\",\n \"refunds.create\",\n \"subscriptions.view\",\n \"subscriptions.update\",\n \"orders.view_timeline\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"role": {
"id": 3187,
"name": "Customer Support",
"createdAt": "2026-09-14T15:42:08.311Z",
"user_count": 3,
"permission_keys": [
"orders.view",
"orders.update",
"refunds.view",
"refunds.create",
"subscriptions.view",
"subscriptions.update",
"orders.view_timeline"
]
},
"meta": {
"request_id": "5f0c2b9e-3d41-4a7e-9b12-6e8d4c0a7f31",
"timestamp": "2026-09-30T14:05:12Z"
}
}{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}