Update workspace role
curl --request PATCH \
--url https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": []
}
'import requests
url = "https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}"
payload = {
"name": "<string>",
"description": "<string>",
"permissions": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', permissions: []})
};
fetch('https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/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://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'permissions' => [
]
]),
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://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"role": {
"id": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"permissions": [
"agents:read"
],
"isSystem": true,
"isDefault": true,
"memberCount": 1,
"assignable": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Workspace Roles
Update workspace role
Updates a custom role. System roles (Owner / Admin / Member) reject this with 409. Permission changes (additions or removals) take effect immediately, on each affected member’s next request.
PATCH
/
workspaces
/
{workspaceId}
/
roles
/
{roleId}
Update workspace role
curl --request PATCH \
--url https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"permissions": []
}
'import requests
url = "https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}"
payload = {
"name": "<string>",
"description": "<string>",
"permissions": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', description: '<string>', permissions: []})
};
fetch('https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/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://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'permissions' => [
]
]),
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://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/workspaces/{workspaceId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"permissions\": []\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"role": {
"id": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"permissions": [
"agents:read"
],
"isSystem": true,
"isDefault": true,
"memberCount": 1,
"assignable": true,
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
1 - 60Maximum string length:
500Available options:
agents:read, agents:write, agents:delete, agents:sync, agents:test, workflows:read, workflows:write, workflows:delete, workflows:sync, workflows:test, calls:read, calls:write, calls:delete, calls:import, calls:export, calls:recording-download, calls:metrics-read, calls:web-token, calls:chat-message, calls:cdr-read, calls:pii, calls:share, calls:register, calls:recording-upload, calls:transfer, calls:resume, calls:status-read, calls:webhook-payload, campaign:read, campaign:write, campaign:delete, campaign:execute, bes:read, bes:write, feedbacks:read, feedbacks:write, feedbacks:delete, feedbacks:comment, feedbacks:assign, feedbacks:config, reviews:read, reviews:write, reviews:delete, reviews:assign, insights:read, insights:write, insights:delete, insights:assign, assertions:read, assertions:write, assertions:delete, assertions:assign, personas:read, personas:write, personas:delete, simulations:read, simulations:write, simulations:delete, simulations:execute, solutions:read, solutions:write, solutions:delete, solutions:generate, solutions:accept, kb:read, kb:write, kb:delete, kb:upload, kb:sync, kb:articles-write, phone-numbers:read, phone-numbers:write, phone-numbers:delete, phone-numbers:import, phone-aliases:read, phone-aliases:write, phone-aliases:delete, suppression-list:read, suppression-list:write, suppression-list:delete, integrations:read, integrations:write, integrations:delete, integrations:webhook, analytics:read, analytics:widgets-write, analytics:widgets-delete, api-keys:read, api-keys:write, api-keys:delete, api-keys:manage-others, members:read, members:invite, members:remove, members:role-change, members:mfa-reset, roles:read, roles:write, roles:delete, billing:read, billing:manage, workspace:read, workspace:settings-write, workspace:delete, workspace:logs-read, versions:read, versions:publish, models:read, inbound:write, chat:read, custom:abbreviations-read, custom:abbreviations-write, speech-filter:preview, agents:resolve, campaign:resolve-contact, retention:purge, simulations:verdict-callback