Change a person's role
Makes a person of the project an admin, or an admin a member.
The owner and the admins allowed to name admins may do it. A person who is not in the project is refused as not_permitted.
Authorization
Authorization: Bearer <key> Authentication
Path parameters
The project's id.
The person's id.
Body
An id the caller makes for this request. Sent again with the same request, it returns the first answer and changes nothing twice; sent with a different request, it is refused.
The person's new role.
Response
200 The project's people after the change.
What the key's person may do with the project now.
Show properties of capabilitiesHide properties of capabilities
True when the key's person may invite people to the project.
True when they may manage the project's people.
True when they may make a person an admin or a member.
True when they may remove people from the project.
True when they may change the project's steps.
True when they may archive the project.
True when they may bring the project back from the archive.
True when they may delete the project.
True when they may hand the project to another person and leave it.
True when they may rename the project.
True when they may change the project's photo.
True when they may leave the project.
The version of the project's people, which changes whenever its people do.
The project's people.
Show properties of peopleHide properties of people
The person's id.
The person's name, as they set it.
The person's role in the project.
The grammatical gender of the person's role name in the reader's language; not sent today.
The person's verified email, which everyone in the project sees.
Show properties of emailHide properties of email
One of 2 shapes, told apart by kind:
kindaddressaddress for an email shown as is, private_relay for an Apple address the person keeps hidden.
The email address.
kindprivate_address for an email shown as is, private_relay for an Apple address the person keeps hidden.
True for the key's own person.
What the key's person may do to this person now.
Show properties of actionsHide properties of actions
The roles the key's person may give this person now.
True when the key's person may remove this person from the project.
True when the key's person may hand the project to this person and leave it.
The person's photo, when they have one.
Show properties of photoHide properties of photo
The person whose photo it is.
The photo's version, which changes with the photo; its read takes it to fetch the current one.
The version of the project's settings; leaving a project as its owner sends it as expectedConfigVersion.
Errors
invalid_query The query is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).invalid_people_request The people request is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).session_revoked The request carries no session the server holds, or its session has ended.session_expired The session has expired.not_permitted The signed-in person's role, or whose the record is, does not allow this request.conversation_not_found The project the request names, or its chat, is not one the signed-in person is in.person_not_found The person the request is about is not one the signed-in person can reach.session_changed The session changed while the request was in flight.project_deleted The project is being deleted.project_archived The project is archived, so it does not take this request.request_conflict The request id was already used with another request, or the change it asks could not be made to the record it names.request_erased The request id belongs to a request whose record was erased.payload_too_large The request body has more bytes than the route takes.rate_limited More requests of this kind were sent than Werk takes within the time it counts them over.server_error The server could not complete the request, and it is not known whether a write it holds was made.curl -X PATCH "https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/people/c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64" \
-H "Authorization: Bearer wk_key_..." \
-H "Content-Type: application/json" \
-d '{
"clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4d01",
"role": "admin"
}'const res = await fetch("https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/people/c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64", {
method: "PATCH",
headers: {
Authorization: "Bearer wk_key_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
"clientRequestId": "f1e2d3c4-b5a6-4978-8a9b-0c1d2e3f4d01",
"role": "admin"
}),
});
const answer = await res.json();{
"peopleVersion": 3,
"configVersion": 6,
"people": [
{
"id": "5d1f3a2e-8c4b-4e7a-9f21-3b6c8d0e1a42",
"name": "Maya Chen",
"role": "owner",
"email": {
"kind": "address",
"address": "maya@harborstreet.example"
},
"isYou": true,
"photo": {
"personId": "5d1f3a2e-8c4b-4e7a-9f21-3b6c8d0e1a42",
"version": 1
}
},
{
"id": "8a2e6c14-3f5d-4b9a-a7e2-61c0d9f4b3e8",
"name": "Tom Okafor",
"role": "admin",
"email": {
"kind": "address",
"address": "tom@harborstreet.example"
},
"isYou": false,
"actions": {
"changeRoleTo": [
"member"
],
"remove": true,
"receiveOwnership": true
}
},
{
"id": "c4b7e9a1-2d6f-4c83-b5a0-7e1f3d9c2b64",
"name": "Lucia Ferraro",
"role": "member",
"email": {
"kind": "address",
"address": "lucia@harborstreet.example"
},
"isYou": false,
"actions": {
"changeRoleTo": [
"admin"
],
"remove": true,
"receiveOwnership": true
}
}
]
}Send a requestPATCH
It is sent with the key you give, as you. A change made here is real.
The request could not be sent, or its response could not be read.