cURL
curl -X PUT \
/accounts/{id}/role \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '[]'import requests
url = "https://coreapi.io/accounts/{id}/role"
payload = {}
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({})
};
fetch('https://coreapi.io/accounts/{id}/role', 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://coreapi.io/accounts/{id}/role",
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([
]),
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;
}{
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "jsmith@example.com",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"role": "administrator",
"createdAt": "2023-11-07T05:31:56Z",
"deactivated": true
}User & Permissions
Update account role
Update the role of an account. The changes will apply immediately after the next page navigation of the user. You cannot change the role of your own account.
Required permissions:account:role:writePUT
/
accounts
/
{id}
/
role
cURL
curl -X PUT \
/accounts/{id}/role \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '[]'import requests
url = "https://coreapi.io/accounts/{id}/role"
payload = {}
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({})
};
fetch('https://coreapi.io/accounts/{id}/role', 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://coreapi.io/accounts/{id}/role",
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([
]),
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;
}{
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ",
"user": {
"firstName": "John",
"lastName": "Doe",
"email": "jsmith@example.com",
"id": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
},
"role": "administrator",
"createdAt": "2023-11-07T05:31:56Z",
"deactivated": true
}Autorisierungen
Body
application/jsontext/html
The updated Account resource
Antwort
Account resource updated
War diese Seite hilfreich?