Invite user to project
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/"
payload = {
"email": "[email protected]",
"permissions": ["CAN_VIEW_DATA", "CAN_PERFORM_ADMIN_ACTIONS"],
"profile": "contributor"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
permissions: ['CAN_VIEW_DATA', 'CAN_PERFORM_ADMIN_ACTIONS'],
profile: 'contributor'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"permissions": [
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"permissions": [
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"invited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"date_joined": "2023-11-07T05:31:56Z"
},
"type": "new_user"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Invitations
Invite user to project
Invite a user to join the project.
- For new users (not registered): Creates a pending invite and sends an email.
- For existing users: Automatically accepts the invite and sends a notification.
POST
/
projects
/
{project_id}
/
invites
/
invite
/
Invite user to project
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/"
payload = {
"email": "[email protected]",
"permissions": ["CAN_VIEW_DATA", "CAN_PERFORM_ADMIN_ACTIONS"],
"profile": "contributor"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
permissions: ['CAN_VIEW_DATA', 'CAN_PERFORM_ADMIN_ACTIONS'],
profile: 'contributor'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/invites/invite/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"permissions": [
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"permissions": [
"CAN_PERFORM_ADMIN_ACTIONS"
],
"profile": "contributor",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"invited_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"date_joined": "2023-11-07T05:31:56Z"
},
"type": "new_user"
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Authorizations
BearerAuthTokenAuth
Use Authorization: Bearer
Path Parameters
UUID of the project
Body
application/json
Email address of the user to invite
Example:
Permissions to grant to the user
CAN_PERFORM_ADMIN_ACTIONS: Full administrative accessCAN_VIEW_DATA: Read-only access to project dataCAN_IMPERSONATE_OTHER_USERS: Impersonate other users in API calls (contact Clarifeye to enable)
Available options:
CAN_PERFORM_ADMIN_ACTIONS, CAN_VIEW_DATA, CAN_IMPERSONATE_OTHER_USERS Example:
[
"CAN_VIEW_DATA",
"CAN_PERFORM_ADMIN_ACTIONS"
]
Profile to assign to the invited user on the project.
Defaults to contributor when omitted.
Available options:
tech, contributor, user Response
Invitation created successfully
CAN_PERFORM_ADMIN_ACTIONS: Full administrative accessCAN_VIEW_DATA: Read-only access to project dataCAN_IMPERSONATE_OTHER_USERS: Impersonate other users in API calls (contact Clarifeye to enable)
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 pending: Invitation sent, awaiting responseaccepted: User accepted the invitationcancelled: Invitation was cancelled
Available options:
pending, accepted, cancelled Show child attributes
Show child attributes
new_user: User not registered, invite is pendingexisting_user: User exists, invite auto-accepted
Available options:
new_user, existing_user