Users

Endpoint: /api/iam/users/

Manage user accounts in your Alpacon workspace. Use pk=- in place of a user ID to refer to the currently authenticated user.

List users

Retrieve a paginated list of users. Results are ordered by superuser status first, then staff, then active, then by username.

Request

GET /api/iam/users/

Query parameters

ParameterTypeDescription
is_activebooleanFilter by active status
is_staffbooleanFilter by staff status
is_superuserbooleanFilter by superuser status
is_ldap_userbooleanFilter by LDAP user status
shellstringFilter by shell (exact match)
usernamestringFilter by username (exact match)
username__icontainsstringFilter by username (case-insensitive partial match)
added_at__gtedatetimeFilter users added on or after this date
added_at__ltedatetimeFilter users added on or before this date
added_at__gtdatetimeFilter users added after this date
added_at__ltdatetimeFilter users added before this date
exclude_groupUUIDExclude users who belong to this group
searchstringSearch across username, first_name, last_name, email, phone, tags, description, uid, added_at
orderingstringSort field. Options: first_name, last_name, email, tags, uid, is_superuser, is_staff, is_active, date_joined, last_login, added_at, updated_at. Prefix with - for descending
pageintegerPage number
page_sizeintegerResults per page (default: 15, max: 100)

Response

{
  "count": 15,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "a540bf0f-8b37-4f03-8546-dd71c6b03329",
      "auth0_id": "auth0|64a1b2c3d4e5f6a7b8c9d0e1",
      "username": "admin",
      "first_name": "John",
      "last_name": "Doe",
      "email": "admin@example.com",
      "phone": "+1-555-0100",
      "tags": "infrastructure, lead",
      "num_groups": 3,
      "uid": 2000,
      "is_active": true,
      "is_staff": true,
      "is_superuser": true,
      "is_ldap_user": false,
      "date_joined": "2023-01-15T10:00:00Z"
    }
  ]
}

Example

curl -X GET "https://your-workspace.us1.alpacon.io/api/iam/users/?is_active=true&ordering=-date_joined" \
  -H "Authorization: token=\"alpat-xxxxxxxxxxxxxxxxxx\""

Error responses

StatusError codeDescription
400INVALID_REQUESTInvalid parameters
401UNAUTHORIZEDNot authenticated
403FORBIDDENPermission denied
404NOT_FOUNDUser not found