Skip to content

Users API ​

9 endpoints. Request and response schemas are described on the schemas page; the other tags are listed in the API index.

Endpoints ​

GET /api/v1/users ​

List users

List all users (admin only)

Parameters

NameInTypeRequiredDescription
pagequeryintegernoMinimum: 1.
per_pagequeryintegernoMinimum: 1. Maximum: 100.
qquerystringnoSearch query

Responses

StatusDescriptionBody
200List of usersapplication/json: object
400Invalid requestapplication/json: Error
403Admin access required-

Fields of the 200 response (application/json):

FieldTypeRequiredDescription
dataarray of Userno-
pageintegerno-
per_pageintegerno-
totalintegerno-

POST /api/v1/users ​

Create user

Create a new user (admin only)

Request body (required)

application/json: object

FieldTypeRequiredDescription
disabledbooleanno-
emailstring (email)no-
full_namestringno-
must_change_passwordbooleanno-
passwordstringno-
usernamestringyes-

Responses

StatusDescriptionBody
201User createdapplication/json: User
400Invalid requestapplication/json: Error
403Admin access required-
409Conflict with the current stateapplication/json: Error

GET /api/v1/users/{id} ​

Get user

Get details of a specific user (admin only)

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Responses

StatusDescriptionBody
200User detailsapplication/json: User
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404User not found-

PATCH /api/v1/users/{id} ​

Update user

Update a user (admin only). Setting disabled: true keeps the account, blocks login and revokes its sessions and project tokens; disabled: false re-enables it.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Request body (required)

application/json: object

FieldTypeRequiredDescription
disabledbooleanno-
emailstring (email)no-
full_namestringno-
must_change_passwordbooleanno-
passwordstringno-

Responses

StatusDescriptionBody
200User updatedapplication/json: User
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404User not found-

DELETE /api/v1/users/{id} ​

Delete user

Permanently delete a user (admin only). The account row, its API tokens, sessions, project memberships, group links, permission assignments and SSO link are removed; creator/owner references on other objects are cleared. Refused for your own account (400) and for the last enabled admin (409). To keep the account, set disabled with PATCH instead. A later SSO login with the same external ID provisions a fresh user.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Responses

StatusDescriptionBody
204User deleted-
400Cannot delete your own account-
403Forbiddenapplication/json: Error
404User not found-
409Cannot delete the last enabled admin-

GET /api/v1/users/{id}/groups ​

List user's groups

List groups that a user belongs to

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Responses

StatusDescriptionBody
200List of groupsapplication/json: object
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404User not found-

Fields of the 200 response (application/json):

FieldTypeRequiredDescription
dataarray of Groupno-

GET /api/v1/users/{id}/tokens ​

List user's tokens

List the active (not revoked) API tokens of a user (owner or admin)

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Responses

StatusDescriptionBody
200List of tokensapplication/json: object
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404User not found-

Fields of the 200 response (application/json):

FieldTypeRequiredDescription
dataarray of Tokenno-

POST /api/v1/users/{id}/tokens ​

Create token for user

Create an API token for a user (admin only)

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-

Request body (required)

application/json: object

FieldTypeRequiredDescription
expires_atstring (date-time)no-
kindstringyesOne of: access, deploy.
namestringyes-
scopesarray of stringno-

Responses

StatusDescriptionBody
201Token createdapplication/json: TokenCreateResponse
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404The addressed resource was not foundapplication/json: Error

DELETE /api/v1/users/{id}/tokens/{tokenId} ​

Revoke user's token

Revoke an API token for a user (admin only)

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yes-
tokenIdpathstring (uuid)yes-

Responses

StatusDescriptionBody
204Token revoked-
400Invalid request, including a NUL byte in the URL or the bodyapplication/json: Error
403Forbiddenapplication/json: Error
404Token not found-

Free software under the AGPL-3.0-or-later.