curl --request PATCH \
--url https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"role": "viewer",
"role_id": "789e0123-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}"
payload = {
"role": "viewer",
"role_id": "789e0123-e89b-12d3-a456-426614174000"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'viewer', role_id: '789e0123-e89b-12d3-a456-426614174000'})
};
fetch('https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_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.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}",
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([
'role' => 'viewer',
'role_id' => '789e0123-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}"
payload := strings.NewReader("{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_bodyActualizar rol de un miembro del grupo
Actualiza el rol de un usuario añadido explícitamente a un grupo (fila group_members, mostrada como access_type: "group" por GET /api/v1/groups/{group_id}/members). Acepta el role general (admin/viewer) o role_id, del sistema o personalizado (consulta GET /api/v1/roles); indica exactamente uno. Requiere una clave global.
Los miembros de organización quedan fuera: acceden a los grupos por su rol en ella y una escritura de grupo no lo cambiaría. Devuelven 409; usa PATCH /api/v1/organizations/members/{user_id}. No permite modificar al usuario de la clave. No hay restricción de último administrador en grupos: los administradores de organización conservan ese acceso a todos.
Los roles distintos de admin y viewer se respetan para el acceso, pero aún no se muestran en el panel. Un role_id como Editor o Billing Manager concede sus permisos reales en todos los sitios del grupo, pero la lista del panel muestra cualquier rol no administrador como “Lector”. Prefiere admin / viewer si el administrador cliente también necesita ver el rol asignado.
curl --request PATCH \
--url https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"role": "viewer",
"role_id": "789e0123-e89b-12d3-a456-426614174000"
}
'import requests
url = "https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}"
payload = {
"role": "viewer",
"role_id": "789e0123-e89b-12d3-a456-426614174000"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({role: 'viewer', role_id: '789e0123-e89b-12d3-a456-426614174000'})
};
fetch('https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_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.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}",
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([
'role' => 'viewer',
'role_id' => '789e0123-e89b-12d3-a456-426614174000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}"
payload := strings.NewReader("{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/groups/{group_id}/members/{user_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"role\": \"viewer\",\n \"role_id\": \"789e0123-e89b-12d3-a456-426614174000\"\n}"
response = http.request(request)
puts response.read_bodyParámetros de ruta
Identificador único del grupo
Identificador único del usuario de destino
Cuerpo
Cuerpo de la solicitud para actualizar el rol de un miembro de un grupo. Indica exactamente uno de role o role_id.
Rol general que se asignará. Mutuamente excluyente con role_id.
admin, viewer "viewer"
Asigna cualquier rol por ID, del sistema o personalizado de tu organización (consulta GET /api/v1/roles). Excluyente con role. Devuelve 404 si no existe o es de otra organización. Los ID del sistema son centinelas con formato GUID (p. ej., 00000000-0000-0000-0000-000000000001), no UUID RFC 4122. En grupos, los roles distintos de Admin y Viewer se respetan para el acceso, pero se muestran como "Lector" en la lista de miembros del panel.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"789e0123-e89b-12d3-a456-426614174000"
¿Esta página le ayudó?