Clienvy API documentation

List employees

GET
https://api.clienvy.io/employee/v1
/employees

Returns every employee, ordered by name. Only the active ones unless status says otherwise.

List employees › query Parameters

search
​string

Full-text search across first and last name.

status
​string

Which employees to return: active (default), deactivated or all.

List employees › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List employees › Responses

Array of EmployeeListResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

function
​string | null
​object
full_access
​boolean
is_service_account
​boolean

Service accounts are for machine to machine API access

​

Get an employee

GET
https://api.clienvy.io/employee/v1
/employees/{employee}

Returns a single employee by ID, including their function, manager flag and permissions.

Get an employee › path Parameters

employee
​string · uuid · required

The employee UUID

Get an employee › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get an employee › Responses

EmployeeResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
function
​string | null
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

​object
full_access
​boolean
​
permissions
​string[]
is_service_account
​boolean

Service accounts are for machine to machine API access

oauth_provider
​string | null

The provider the employee signs in with instead of a password, such as google.

2fa_active
​boolean

$2fa_active

created_at
​string · date-time

Update an employee

PUT
https://api.clienvy.io/employee/v1
/employees/{employee}

Updates an employee. Only the fields present in the request are changed. Setting full_access grants full access. Otherwise permissions (a list of permission keys) applies.

Update an employee › path Parameters

employee
​string · uuid · required

The employee UUID

Update an employee › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Update an employee › Request Body

first_name
​string · maxLength: 32
last_name
​string · maxLength: 64
function
​string · maxLength: 32

The employee's job title.

full_access
​boolean

Whether the employee is a manager (full access).

permissions
​string[]

Permission keys granted to the employee (ignored when full_access is true).

profile_picture_id
​string | null · uuid

UUID of an uploaded jpg, jpeg or png file to use as the profile picture. Send null to remove it.

Update an employee › Responses

EmployeeResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
function
​string | null
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

​object
full_access
​boolean
​
permissions
​string[]
is_service_account
​boolean

Service accounts are for machine to machine API access

oauth_provider
​string | null

The provider the employee signs in with instead of a password, such as google.

2fa_active
​boolean

$2fa_active

created_at
​string · date-time

Delete an employee

POST
https://api.clienvy.io/employee/v1
/employees/{employee}/delete

Deletes an employee and reassigns their resources to another employee (assign_to_id). You cannot delete yourself, and the target must differ from the deleted employee.

Delete an employee › path Parameters

employee
​string · uuid · required

The employee UUID

Delete an employee › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Delete an employee › Request Body

assign_to_id
​string · uuid · required

UUID of the active employee to reassign the deleted employee's resources to.

Delete an employee › Responses

EmployeeResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
function
​string | null
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

​object
full_access
​boolean
​
permissions
​string[]
is_service_account
​boolean

Service accounts are for machine to machine API access

oauth_provider
​string | null

The provider the employee signs in with instead of a password, such as google.

2fa_active
​boolean

$2fa_active

created_at
​string · date-time

Deactivate an employee

POST
https://api.clienvy.io/employee/v1
/employees/{employee}/deactivate

Deactivates an employee: their tokens are revoked, they can no longer sign in, they stop counting towards the subscription slots and they disappear from every selection list. Their history stays intact. You cannot deactivate yourself.

Deactivate an employee › path Parameters

employee
​string · uuid · required

The employee UUID

Deactivate an employee › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Deactivate an employee › Responses

EmployeeResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
function
​string | null
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

​object
full_access
​boolean
​
permissions
​string[]
is_service_account
​boolean

Service accounts are for machine to machine API access

oauth_provider
​string | null

The provider the employee signs in with instead of a password, such as google.

2fa_active
​boolean

$2fa_active

created_at
​string · date-time

Activate an employee

POST
https://api.clienvy.io/employee/v1
/employees/{employee}/activate

Reactivates a deactivated employee. This takes up a subscription slot, so it fails when the plan is full.

Activate an employee › path Parameters

employee
​string · uuid · required

The employee UUID

Activate an employee › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Activate an employee › Responses

EmployeeResource

id
​string · uuid
first_name
​string
last_name
​string
full_name
​string
function
​string | null
email
​string
last_activity
​string | null · date-time
deactivated_at
​string | null · date-time

Set when the employee is deactivated: no sign in, no subscription slot, not selectable.

​object
full_access
​boolean
​
permissions
​string[]
is_service_account
​boolean

Service accounts are for machine to machine API access

oauth_provider
​string | null

The provider the employee signs in with instead of a password, such as google.

2fa_active
​boolean

$2fa_active

created_at
​string · date-time

List email change requests

GET
https://api.clienvy.io/employee/v1
/employees/{employee}/change-email-requests

Returns the open requests to change the employee's email address, newest first. A request takes effect once the new address confirms it.

List email change requests › path Parameters

employee
​string · uuid · required

The employee UUID

List email change requests › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List email change requests › Responses

Array of EmployeeChangeEmailRequestListResource

id
​string · uuid
email
​string

The address the employee changes to once it is confirmed.

expires_at
​string · date-time
created_at
​string · date-time

Request an email change

POST
https://api.clienvy.io/employee/v1
/employees/{employee}/change-email-requests

Sends a confirmation link to the new address. The address only changes once the link is used, within 24 hours. A new request for the same address replaces the open one.

Request an email change › path Parameters

employee
​string · uuid · required

The employee UUID

Request an email change › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Request an email change › Request Body

email
​string · email · required

Request an email change › Responses

EmployeeChangeEmailRequestListResource

id
​string · uuid
email
​string

The address the employee changes to once it is confirmed.

expires_at
​string · date-time
created_at
​string · date-time

Withdraw an email change request

DELETE
https://api.clienvy.io/employee/v1
/employees/{employee}/change-email-requests/{changeEmailRequest}

Deletes the request, so its confirmation link stops working.

Withdraw an email change request › path Parameters

employee
​string · uuid · required

The employee UUID

changeEmailRequest
​string · uuid · required

The change email request UUID

Withdraw an email change request › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Withdraw an email change request › Responses

EmployeeChangeEmailRequestListResource

id
​string · uuid
email
​string

The address the employee changes to once it is confirmed.

expires_at
​string · date-time
created_at
​string · date-time

List sessions

GET
https://api.clienvy.io/employee/v1
/employees/{employee}/sessions

Returns the sessions the employee is signed in with, most recently used first. Tokens of API integrations and AI clients are not sessions and are left out.

List sessions › path Parameters

employee
​string · uuid · required

The employee UUID

List sessions › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List sessions › Responses

Array of EmployeeSessionListResource

id
​string
method
​string

How the session started: password or oauth-google.

ip_address
​string | null

Empty for a session that started before this was written down.

browser
​string | null
platform
​string | null
is_current
​boolean

Whether this is the session the request is made with.

last_used_at
​string | null · date-time
expires_at
​string · date-time
created_at
​string · date-time

Sign out all sessions

DELETE
https://api.clienvy.io/employee/v1
/employees/{employee}/sessions

Revokes every session of the employee, so they have to sign in again everywhere. Returns the sessions that are left, which is none.

Sign out all sessions › path Parameters

employee
​string · uuid · required

The employee UUID

Sign out all sessions › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Sign out all sessions › Responses

Array of EmployeeSessionListResource

id
​string
method
​string

How the session started: password or oauth-google.

ip_address
​string | null

Empty for a session that started before this was written down.

browser
​string | null
platform
​string | null
is_current
​boolean

Whether this is the session the request is made with.

last_used_at
​string | null · date-time
expires_at
​string · date-time
created_at
​string · date-time

Sign out a session

DELETE
https://api.clienvy.io/employee/v1
/employees/{employee}/sessions/{session}

Revokes the session, so the next request made with it is refused and the employee has to sign in again on that device.

Sign out a session › path Parameters

employee
​string · uuid · required

The employee UUID

session
​string · required

The session id, as listed by "List sessions".

Sign out a session › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Sign out a session › Responses

EmployeeSessionListResource

id
​string
method
​string

How the session started: password or oauth-google.

ip_address
​string | null

Empty for a session that started before this was written down.

browser
​string | null
platform
​string | null
is_current
​boolean

Whether this is the session the request is made with.

last_used_at
​string | null · date-time
expires_at
​string · date-time
created_at
​string · date-time

List security logs

GET
https://api.clienvy.io/employee/v1
/employees/{employee}/security-logs

Returns what happened to the way the employee signs in over the last six months, newest first: every sign in, worked or not, and every change to their password, two-step verification, address, single sign-on and sessions.

List security logs › path Parameters

employee
​string · uuid · required

The employee UUID

List security logs › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List security logs › Responses

Array of EmployeeSecurityLogListResource

id
​string · uuid
type
​EmployeeSecurityLogType · enum
Enum values:
login-succeeded
login-failed
password-changed
password-reset-requested
password-reset
two-factor-enabled
two-factor-disabled
email-change-requested
email
​string

The address it was about: the one a sign in was tried with, the new one for an address change.

login_method
​string | null · enum

How an employee signed in. The value is also the name of the access token the sign in hands out, so a session tells by its token how it started.

password
oauth-google
impersonation
Clienvy support signed in as the employee: a session of its own, never written down or shown to the employee.
Enum values:
password
oauth-google
impersonation
login_failure_reason
​string | null · enum
Enum values:
wrong-password
wrong-two-factor-code
linked-with-google
deactivated
ip_address
​string
browser
​string | null
platform
​string | null
created_at
​string · date-time

List OAuth connections

GET
https://api.clienvy.io/employee/v1
/employees/{employee}/oauth-connections

Returns the AI clients and apps the employee gave access to their account, newest first.

List OAuth connections › path Parameters

employee
​string · uuid · required

The employee UUID

List OAuth connections › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

List OAuth connections › Responses

Array of OAuthConnectionResource

id
​string · uuid
name
​string
permissions
​string[]
full_access
​boolean
last_used_at
​string | null · date-time
created_at
​string | null · date-time

Get an OAuth connection

GET
https://api.clienvy.io/employee/v1
/employees/{employee}/oauth-connections/{oauthConnection}

Returns one AI client or app the employee gave access to their account.

Get an OAuth connection › path Parameters

employee
​string · uuid · required

The employee UUID

oauthConnection
​string · uuid · required

The oauth connection UUID

Get an OAuth connection › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Get an OAuth connection › Responses

OAuthConnectionResource

id
​string · uuid
name
​string
permissions
​string[]
full_access
​boolean
last_used_at
​string | null · date-time
created_at
​string | null · date-time

Revoke an OAuth connection

POST
https://api.clienvy.io/employee/v1
/employees/{employee}/oauth-connections/{oauthConnection}/revoke

Ends the access the employee gave the client: its tokens stop working right away.

Revoke an OAuth connection › path Parameters

employee
​string · uuid · required

The employee UUID

oauthConnection
​string · uuid · required

The oauth connection UUID

Revoke an OAuth connection › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

Revoke an OAuth connection › Responses

OAuthConnectionResource

id
​string · uuid
name
​string
permissions
​string[]
full_access
​boolean
last_used_at
​string | null · date-time
created_at
​string | null · date-time

All employee permissions

GET
https://api.clienvy.io/employee/v1
/permissions/employee

Returns the catalog of assignable permissions, grouped by domain. These are the permission keys (for example relation.view, invoice.create) accepted when setting an employee's permissions or scoping an OAuth connection. Each permission lists the feature modules it belongs to in features. A permission only has an effect while all of those modules are switched on for the organization.

All employee permissions › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

All employee permissions › Responses

​object · required
​object · required

All customer portal permissions

GET
https://api.clienvy.io/employee/v1
/permissions/customer

Returns the catalog of customer portal permissions, grouped like the employee catalog. A contact holds these per company it is linked to, see PUT relation/companies/{company}/contact/{contact}/customer-portal/permissions.

All customer portal permissions › Headers

X-Organization-Id
​string · uuid · required

UUID of the organization (tenant) the request operates on.

All customer portal permissions › Responses

​object · required
​object · required