API REFERENCE

Users API

A user is a person with a login to your AlgaPSA instance. This is the admin-facing API for managing those accounts: create them, set their type, control passwords and two-factor, and read what each one can actually do.

Create a user

username, email, password, and role_ids are required. Set user_type to internal (MSP staff) or client (client-portal user). Every account is created with at least one role: role_ids must be a non-empty array of role ids from your tenant, and a request without it, or with an empty array, returns 400.

A third type, service, is a non-interactive identity that exists only in Enterprise Edition and cannot be created or updated via the REST API — passing user_type: "service" on POST or PUT /api/v1/users returns 400. Service users are excluded from user list responses and seat counts; a direct GET /api/v1/users/{id} for a service user id returns 404. Service users cannot log in interactively and cannot be assigned tickets, tasks, or time entries.

curl
curl https://algapsa.com/api/v1/users \
  -H "X-API-Key: $ALGA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "jdoe",
    "email": "jdoe@northwind.example",
    "password": "set-a-strong-one",
    "first_name": "Jamie",
    "last_name": "Doe",
    "user_type": "internal",
    "role_ids": ["<role-uuid>"]
  }'

Account security

Reset a login with PUT /api/v1/users/{id}/password. Turn two-factor on with POST /api/v1/users/{id}/2fa/enable or clear it with DELETE /api/v1/users/{id}/2fa/disable. Avatar, preferences, and per-user activity each hang off the same /api/v1/users/{id} path.

These calls do not override the tenant sign-in policy. If the tenant requires single sign-on for MSP staff, an internal user who is not an eligible break-glass administrator still cannot sign in with a password, even after a password is set over the API. Clearing two-factor on a break-glass administrator makes them ineligible, so their password sign-in is refused until two-factor is set up again. API keys themselves are not affected by the sign-in policy.

Roles, teams, and access

Membership lives under each user. Read or change roles with GET /api/v1/users/{id}/roles and its POST/PUT/DELETE counterparts; do the same for /api/v1/users/{id}/teams. To see the result of all that without re-deriving it yourself, read GET /api/v1/users/{id}/permissions for the user's effective permissions.

Two floors protect every tenant from locking itself out, and the API enforces them on every write that could break them: assigning, removing, or replacing a user's roles, deactivating a user with PUT /api/v1/users/{id}, and DELETE /api/v1/users/{id}.

  • Every user keeps at least one role. A change that would leave an internal or client user with no roles, including a role replacement with an empty role_ids, returns 400. Role assignment replaces the user's whole set of roles, so send the role to keep together with the new one (for example PUT /api/v1/users/{id}/roles with both ids). If the user is the last active MSP Admin, the 409 below takes precedence.
  • The tenant keeps at least one active MSP Admin. Removing the built-in MSP Admin role from, deactivating, or deleting the last active internal user who holds it returns 409 with A tenant must keep at least one active MSP Admin user. Make someone else an MSP Admin first.

Find users

List and filter with GET /api/v1/users, match by name or email with GET /api/v1/users/search, and read headcount and activity totals from GET /api/v1/users/stats.

Endpoints

Every endpoint links through to its full parameters, request and response schemas, and code samples.

GET/api/v1/usersAlgaPSAAlgaDeskList usersPOST/api/v1/usersAlgaPSAAlgaDeskCreate userGET/api/v1/users/{id}AlgaPSAAlgaDeskGet userPUT/api/v1/users/{id}AlgaPSAAlgaDeskUpdate userDELETE/api/v1/users/{id}AlgaPSAAlgaDeskDelete userDELETE/api/v1/users/{id}/2fa/disableAlgaPSAAlgaDeskDisable user 2FAPOST/api/v1/users/{id}/2fa/enableAlgaPSAAlgaDeskEnable user 2FAGET/api/v1/users/{id}/activityAlgaPSAAlgaDeskGet user activityPOST/api/v1/users/{id}/avatarAlgaPSAAlgaDeskUpload user avatarDELETE/api/v1/users/{id}/avatarAlgaPSAAlgaDeskDelete user avatarPUT/api/v1/users/{id}/passwordAlgaPSAAlgaDeskChange user passwordGET/api/v1/users/{id}/permissionsAlgaPSAAlgaDeskGet user effective permissionsGET/api/v1/users/{id}/preferencesAlgaPSAAlgaDeskGet user preferencesPUT/api/v1/users/{id}/preferencesAlgaPSAAlgaDeskUpdate user preferencesGET/api/v1/users/{id}/rolesAlgaPSAAlgaDeskList user rolesPOST/api/v1/users/{id}/rolesAlgaPSAAlgaDeskAssign user rolesPUT/api/v1/users/{id}/rolesAlgaPSAAlgaDeskReplace user rolesDELETE/api/v1/users/{id}/rolesAlgaPSAAlgaDeskRemove user rolesGET/api/v1/users/{id}/teamsAlgaPSAAlgaDeskList user teamsPOST/api/v1/users/{id}/teamsAlgaPSAAlgaDeskAdd user to team (route currently mapped to user create)DELETE/api/v1/users/{id}/teams/{teamId}AlgaPSAAlgaDeskRemove user from team (route currently mapped to user delete)GET/api/v1/users/activityAlgaPSAAlgaDeskList global user activityPOST/api/v1/users/bulk/createAlgaPSAAlgaDeskBulk create usersPUT/api/v1/users/bulk/deactivateAlgaPSAAlgaDeskBulk deactivate usersGET/api/v1/users/searchAlgaPSAAlgaDeskSearch usersGET/api/v1/users/statsAlgaPSAAlgaDeskGet user stats