Update Role
curl --request PUT \
--url https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [
{}
],
"position": 123
}
'import requests
url = "https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}"
payload = {
"name": "<string>",
"permissions": [{}],
"position": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', permissions: [{}], position: 123})
};
fetch('https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_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.vertracloud.app/v1/workspaces/{id}/roles/{role_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' => '<string>',
'permissions' => [
[
]
],
'position' => 123
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\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))
}HttpResponse<String> response = Unirest.put("https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_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\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\n}"
response = http.request(request)
puts response.read_bodyRoles
Update Role
Updates a role’s name or permissions. Requires roles:manage.
PUT
/
v1
/
workspaces
/
{id}
/
roles
/
{role_id}
Update Role
curl --request PUT \
--url https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": [
{}
],
"position": 123
}
'import requests
url = "https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}"
payload = {
"name": "<string>",
"permissions": [{}],
"position": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', permissions: [{}], position: 123})
};
fetch('https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_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.vertracloud.app/v1/workspaces/{id}/roles/{role_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' => '<string>',
'permissions' => [
[
]
],
'position' => 123
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\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))
}HttpResponse<String> response = Unirest.put("https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/workspaces/{id}/roles/{role_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\": \"<string>\",\n \"permissions\": [\n {}\n ],\n \"position\": 123\n}"
response = http.request(request)
puts response.read_bodyRequires
roles:manage. An API key needs the workspaces:write scope.
Same escalation guard as Create Role, but
checked against the union of the role’s old and new permission sets: removing a
permission you don’t hold from someone else’s role is also editing something that isn’t
yours. Nobody — owner included in spirit, though the owner is exempt from the check — can
edit the role currently assigned to themselves, and nobody can change their own role
assignment through this endpoint.
Path
string
required
Workspace ID.
string
required
Role ID.
Body
Full replacement — same fields as Create Role, all required except the optional ones.string
required
WorkspacePermission[]
required
number
Response
Same shape as Create Role.Errors
| Status | Code | When |
|---|---|---|
| 403 | WORKSPACE_PERMISSION_DENIED | Caller lacks roles:manage. |
| 403 | WORKSPACE_PERMISSION_ESCALATION | Old or new permission set includes something the caller doesn’t have (non-owner). |
| 404 | WORKSPACE_NOT_FOUND | Workspace doesn’t exist or you’re not a member. |
| 404 | WORKSPACE_ROLE_NOT_FOUND | role_id doesn’t belong to this workspace. |