Update user permissions
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/"
payload = {
"permissions": ["CAN_VIEW_DATA", "CAN_PERFORM_ADMIN_ACTIONS"],
"profile": "contributor"
}
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({
permissions: ['CAN_VIEW_DATA', 'CAN_PERFORM_ADMIN_ACTIONS'],
profile: 'contributor'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"display_name": "<string>",
"is_service_account": true,
"date_joined": "2023-11-07T05:31:56Z"
},
"permissions": [
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}{
"error": "Not found."
}Users
Update user permissions
Update a user’s permissions on the project.
PATCH
/
projects
/
{project_id}
/
users
/
{permission_id}
/
Update user permissions
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/"
payload = {
"permissions": ["CAN_VIEW_DATA", "CAN_PERFORM_ADMIN_ACTIONS"],
"profile": "contributor"
}
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({
permissions: ['CAN_VIEW_DATA', 'CAN_PERFORM_ADMIN_ACTIONS'],
profile: 'contributor'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/users/{permission_id}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"permissions": [
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"display_name": "<string>",
"is_service_account": true,
"date_joined": "2023-11-07T05:31:56Z"
},
"permissions": [
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}{
"error": "Not found."
}Authorizations
BearerAuthTokenAuth
Use Authorization: Bearer <token>. The token is either a user token / OAuth access
token, or a service-account API key (cfk_...). A key is valid on every endpoint and
acts as its service account, an organization member with per-store permissions.
Refused keys answer 403 with Invalid API key., API key revoked.,
API key expired. or API key disabled..
Path Parameters
UUID of the project
UUID of the permission record
Body
application/json
CAN_PERFORM_ADMIN_ACTIONS: Full administrative accessCAN_VIEW_DATA: Read-only access to project dataCAN_IMPERSONATE_OTHER_USERS: Impersonate other users in API calls (for a person, contact Clarifeye to enable it; org admins grant it to a service account)
Available options:
CAN_PERFORM_ADMIN_ACTIONS, CAN_VIEW_DATA, CAN_IMPERSONATE_OTHER_USERS Example:
[
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
]
Update the user's profile on the project.
Available options:
tech, contributor, user Response
Permissions updated successfully
Show child attributes
Show child attributes
CAN_PERFORM_ADMIN_ACTIONS: Full administrative accessCAN_VIEW_DATA: Read-only access to project dataCAN_IMPERSONATE_OTHER_USERS: Impersonate other users in API calls (for a person, contact Clarifeye to enable it; org admins grant it to a service account)
Available options:
CAN_PERFORM_ADMIN_ACTIONS, CAN_VIEW_DATA, CAN_IMPERSONATE_OTHER_USERS Profile of the user on the project. The profile shapes the UI surface a
user sees (sidebar, available views) and complements the fine-grained
permissions list.
tech: Technical profile with access to advanced/technical interfacescontributor: Default profile for users who contribute to the projectuser: End-user profile with the most restricted UI surface
Available options:
tech, contributor, user