Skip to content

Users API

Endpoints for user management. All endpoints require a valid user session.

Get Current User

GET /v1/users/me

Authentication: User session (Bearer)

Response 200 OK

json
{
  "id": "user_abc123",
  "email": "dev@example.com",
  "display_name": "Jane Developer",
  "role": "developer",
  "status": "active",
  "avatar_url": "https://lh3.googleusercontent.com/...",
  "created_at": 1738800000,
  "updated_at": 1738800000
}

List Users

GET /v1/users

Authentication: User session (Bearer, owner/admin)

Response 200 OK

Returns an array of user objects.


Invite User

POST /v1/users/invite

Authentication: User session (Bearer, owner/admin)

Request body

json
{
  "email": "dev@example.com",
  "role": "developer"
}
FieldTypeRequiredDescription
emailstringYesEmail address (must match OIDC provider account)
rolestringYesRole to assign: admin, developer, or qa_viewer

Response 200 OK

Returns the created user object with invited status.

Error responses

StatusCodeDescription
400invalid_inputInvalid email or role
403forbiddenInsufficient permissions
409already_existsUser with this email already exists

Update User Role

PATCH /v1/users/{user_id}/role

Authentication: User session (Bearer, owner/admin)

Request body

json
{
  "role": "admin"
}
FieldTypeRequiredDescription
rolestringYesNew role: admin, developer, or qa_viewer

Response 200 OK

Returns the updated user object.

Error responses

StatusCodeDescription
400invalid_inputInvalid role value
403forbiddenInsufficient permissions
404not_foundUser not found

Transfer Owner

POST /v1/users/transfer-owner

Authentication: User session (Bearer, owner)

Transfers the singleton owner role to an existing active user. The previous owner becomes admin, the instance owner record is updated, and sessions for both affected users are revoked.

Request body

json
{
  "email": "new-owner@example.com"
}
FieldTypeRequiredDescription
emailstringYesActive user who should become the new owner

Response 200 OK

json
{
  "previous_owner": {
    "id": "user_old",
    "email": "owner@example.com",
    "role": "admin",
    "status": "active",
    "created_at": 1738800000,
    "updated_at": 1738800000
  },
  "owner": {
    "id": "user_new",
    "email": "new-owner@example.com",
    "role": "owner",
    "status": "active",
    "created_at": 1738800100,
    "updated_at": 1738800200
  }
}

Error responses

StatusCodeDescription
400invalid_emailInvalid target email
403forbiddenCaller is not the owner
404user_not_foundTarget user does not exist
409user_not_activeTarget user has not signed in yet or is disabled

Disable User

Disable a user account. The user's sessions are invalidated and they cannot sign in.

DELETE /v1/users/{user_id}

Authentication: User session (Bearer, owner/admin)

Response 200 OK

Returns the updated user object with disabled status.

Error responses

StatusCodeDescription
403forbiddenInsufficient permissions
404not_foundUser not found

INFO

This endpoint disables the user rather than permanently deleting them. User records are preserved for the audit trail.


Re-enable User

Re-enable a previously disabled user account.

POST /v1/users/{user_id}/enable

Authentication: User session (Bearer, owner/admin)

Response 200 OK

Returns the updated user object with active status.

Error responses

StatusCodeDescription
403forbiddenInsufficient permissions
404not_foundUser not found

Self-hosted mobile CI, built for Flutter.