Skip to content

Users

This technical design describes implementation and API for Users.

Users API

POST /api/users/

Creates a new User.

Permissions

Requires authentication and users.create permission.

Request

  • Body parameters
KeyTypeNotes
usernamestringUnique email address
account_typeenumPlease check "details.schema" in OPTIONS /api/users/
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
passwordstring
rolesarrayRoles IDs
delay_activationbool
timezoneenum
is_ip_restriction_enabledbool
allowed_ip_rangeslist
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

POST /api/users/

json
{ 
  "username": <str>, 
  "account_type": <enum>, 
  "first_name": <str>, 
  "last_name": <str>, 
  "job_title": <str>, 
  "company_name": <str>, 
  "phone": <str>, 
  "mobile": <str>, 
  "roles": [<int>],
  "delay_activation": <bool>,
  "is_ip_restriction_enabled": <bool>,
  "allowed_ip_ranges": [<str>]
}

Validations

  • username
    • is valid email
    • is unique
    • is not null
    • max length is 100
  • account_type
    • is a valid choice
  • first_name
    • is string
    • is not null
    • max length is 100
    • min length is 1
  • last_name
    • is string
    • is not null
    • max length is 100
    • min length is 1
  • job_title
    • is string
    • is not null
    • max length is 100
  • company_name
    • is string
    • is not null
    • max length is 100
  • phone
    • is string
    • is not null
    • max length is 20
  • mobile
    • is string
    • is not null
    • max length is 20
  • delay_activation
    • is bool
    • is optional
  • timezone
  • is valid choice
  • password
    • is string
    • is not null
    • password_prevent_reuse
    • password_rotation_interval
    • max_repeating_chars
    • min_letters
    • min_numbers
    • min_symbols
    • min_lower_case
    • min_upper_case
    • min_length
    • validated only for account types: service_internal and service_external
  • is_ip_restriction_enabled
    • is bool
    • is optional
  • allowed_ip_ranges
    • is list of valid combination of IP address and network prefix ([10.0.0.1/32", "2001:db8::/32"]).
    • both Pv4 and IPv6 addresses are allowed.
    • is optional
    • maximum number of items is 10

Restrictions

  • Separate limits for each user account type are enforced (defaults in table below).
  • Limits are configurable per build.
Account typeLimit
Internal1000
External2500
Full100
1 Time Completion5000
Super Admin25
Service Internal1
Service External5
  • The Service Internal account type has the same permissions as Super Admin, except that it cannot change passwords.

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
link_sent_atdatetime
link_sent_byuser
timezoneenum
next_actionsarray
is_ip_restriction_enabledbool
allowed_ip_rangeslist
_metaObject
  • Successful status 201 Created
  • Response body schema
json
{ 
  "id": <int>, 
  "username": <str>, 
  "account_type": <enum>, 
  "first_name": <str>, 
  "last_name": <str>, 
  "job_title": <str>, 
  "company_name": <str>, 
  "phone": <str>, 
  "mobile": <str>, 
  "status": <enum>, 
  "activated_at": <datetime>,
  "password_set_at": <datetime>,
  "password_expires_at": <datetime>, 
  "roles": [<int>], 
  "created_at": <datetime>, 
  "created_by": <user>, 
  "modified_at": <datetime>, 
  "modified_by": <user>,
  "link_sent_at": <datetime>, 
  "link_sent_by": <user>,
  "timezone": <enum>,
  "is_ip_restriction_enabled": <bool>,
  "allowed_ip_ranges": [<str>],
  "next_actions": [<str>],
  "_meta": { 
    "labels": { 
      "roles": [<str>] 
    }, 
    "permissions": { 
      "list": <bool>,
      "view": <bool>,
      "create": <bool>,
      "edit": <bool>,
      "delete": <bool>
    },
    "allowed_account_type_changes": [<str>]
  } 
}

Errors

Standard validation errors and additional custom errors enumerated in the table below:

CauseResponse codeMessage
"roles" provided with non config admin account400 Bad Request"roles": ["Roles can be assigned only to config admin account."]
Wrong delay_activation value400 Bad Request"delay_activation": ["Must be a valid boolean."]
delay_activation not allowed400 Bad Request"delay_activation": [ "delay_activation can not be set with this account type." ]
Limit of accounts has been exceeded400 Bad Request"detail": "Limit of {LIMIT} {account_type} accounts has been exceeded.", "error_code": "ERR_LIMIT_EXCEEDED"
Timezone is not a valid choice400 Bad Request"timezone": ["value is not a valid choice."]
Timezone is null400 Bad Request"timezone": ["This field may not be null."]
Password does not satisfy password complexity requirements400 Bad Request"password": ["Max repeating chars 2"]
Invalid IP address400 Bad Request"allowed_ip_ranges": ["Must be a valid set of IPv4 or IPv6 network addresses."]
Max number of items exceeded400 Bad Request"allowed_ip_ranges": ["Limit of 10 IP restrictions has been exceeded."]
Wrong is_ip_restriction_enabled value400 Bad Request"is_ip_restriction_enabled": ["Must be a valid boolean."]

GET /api/users/

Returns list of Users.

Permissions

Requires authentication and any of:

  1. users.list permission
  2. user_groups.view permission.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

GET /api/users/

Response

The response contains only users for which request user has users.list permission.

KeyTypeNotes
limitint
offsetint
total_countintTotal number of results visible to the user (based on permissions).
filtered_countintNumber of results visible to the user (based on permissions) with filters applied.
nexturlNext page URL (null if there is no next page)
previousurlPrevious page URL (null if there is no previous page)
resultsArrayList of results. Described in the next table.

Response results array

KeyTypeNotes
idint
usernamestring
rolesarrayRoles IDs
account_typeenumPlease check "details.schema" in OPTIONS /api/users/
statusenum
full_namestring
last_logindatetime
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
link_sent_atdatetime
link_sent_byuser
next_actionsarray
_meta.permissionsObjectObject describing permissions.
  • Successful status 200 OK
  • Response body schema
json
{
  "limit": <int>,
  "offset": <int>,
  "filtered_count": <int>,
  "total_count": <int>,
  "next": <str | null>,
  "previous": <str | null>,
  "results": [
    {
      "id": <int>,
      "username": <str>,
      "roles": [<int>],
      "account_type": <enum>,
      "status": <enum>,
      "full_name": <str>,
      "last_login": <datetime>,
      "activated_at": <datetime>,
      "password_set_at": <datetime>,
      "password_expires_at": <datetime>,
      "created_at": <datetime>,
      "created_by": <user>,
      "modified_at": <datetime>,
      "modified_by": <user>,
      "link_sent_at": <datetime>, 
      "link_sent_by": <user>, 
      "next_actions": [<str>],
      "_meta": {
        "permissions": {
          "list": <bool>,
          "view": <bool>,
          "create": <bool>,
          "edit": <bool>,
          "delete": <bool>
        }
      }
    }
  ]
}

Sorting

ParameterExampleNotes
id/api/users/?ordering=idAscending
id/api/users/?ordering=-idDescending (-)
username/api/users/?ordering=usernameAscending
username/api/users/?ordering=-usernameDescending (-)
last_login/api/users/?ordering=last_loginAscending
last_login/api/users/?ordering=-last_loginDescending (-)
activated_at/api/users/?ordering=activated_atAscending
activated_at/api/users/?ordering=-activated_atDescending (-)
password_set_at/api/users/?ordering=password_set_atAscending
password_set_at/api/users/?ordering=-password_set_atDescending (-)
created_at/api/users/?ordering=created_atAscending
created_at/api/users/?ordering=-created_atDescending (-)
modified_at/api/users/?ordering=modified_atAscending
modified_at/api/users/?ordering=-modified_atDescending (-)
link_sent_at/api/users/?ordering=link_sent_atAscending
link_sent_at/api/users/?ordering=-link_sent_atDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterType
idint
usernameemail
full_namestring
account_typeenum
statusenum
rolesset
is_availablebool
is_super_adminbool
last_logindatetime
activated_atdatetime
password_set_atdatetime
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
link_sent_atdatetime
link_sent_byuser

Errors

ErrorResponse codeMessage
Wrong ordering value400 Bad Request"ordering": ["Select a valid choice. {value} is not one of the available choices."]
Wrong status filter value400 Bad Request"status": ["Select a valid choice. {value} is not one of the available choices."]
Wrong link_sent_by filter value400 Bad Request"link_sent_by": ["Select a valid choice. That choice is not one of the available choices."]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

GET /api/users/id/

Returns single User by id.

Permissions

Requires authentication and users.view permission.

Request

  • URL parameters
KeyTypeNotes
idint
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

GET /api/users/id/

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
link_sent_atdatetime
link_sent_byuser
timezoneenum
is_ip_restriction_enabledbool
allowed_ip_rangeslist
next_actionsarray
_metaObject
  • Successful status 200 OK
  • Response body schema:
json
{ 
  "id": <int>, 
  "username": <str>, 
  "account_type": <enum>, 
  "first_name": <str>, 
  "last_name": <str>, 
  "job_title": <str>, 
  "company_name": <str>, 
  "phone": <str>, 
  "mobile": <str>, 
  "status": <enum>, 
  "activated_at": <datetime>,
  "password_set_at": <datetime>,
  "password_expires_at": <datetime>, 
  "roles": [<int>], 
  "created_at": <datetime>, 
  "created_by": <user>, 
  "modified_at": <datetime>, 
  "modified_by": <user>,
  "link_sent_at": <datetime>, 
  "link_sent_by": <user>,
  "timezone": <enum>,
  "is_ip_restriction_enabled": <bool>,
  "allowed_ip_ranges": [<str>],
  "next_actions": [<str>],
  "_meta": { 
    "labels": { 
      "roles": [<str>] 
    }, 
    "permissions": { 
      "list": <bool>,
      "view": <bool>,
      "create": <bool>,
      "edit": <bool>,
      "delete": <bool>
    },
    "allowed_account_type_changes": [<str>]
  } 
}

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
User with "id" does not exist404 Not Found"detail": "Not found."

PATCH /api/users/id/

Updates single User.

Permissions

Requires authentication and users.edit permission.

For changing password, Super Admin account type is required.

Request

  • URL parameters
KeyTypeNotes
idint
  • Body parameters
KeyTypeNotes
usernamestringUnique email address
account_typeenumPlease check table below to determine allowed operations
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
passwordstring
rolesarrayRoles can be provided only to "config admin" account type
delay_activationbool
timezoneenum
is_ip_restriction_enabledbool
allowed_ip_rangeslist
  • Allowed "account_type" changes

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

PATCH /api/users/id/

json
{ 
  "username": <str>, 
  "account_type": <enum>, 
  "first_name": <str>, 
  "last_name": <str>, 
  "job_title": <str>, 
  "company_name": <str>, 
  "phone": <str>, 
  "mobile": <str>, 
  "password": <str>,
  "roles": [<int>],
  "delay_activation": <bool>,
  "is_ip_restriction_enabled": <bool>,
  "allowed_ip_ranges": [<str>]
}

Restrictions

  • Separate limits for each user account type are enforced (defaults in table below).
  • Limits are configurable per build.
Account typeLimit
Internal1000
External2500
Full100
1 Time Completion5000
Super Admin25
Service Internal1
Service External5
  • The Service Internal account type has the same permissions as Super Admin, except that it cannot change passwords.
  • The password can be changed for Service accounts only. Attempts to change the password for other account types are silently ignored.

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
link_sent_atdatetime
link_sent_byuser
timezoneenum
is_ip_restriction_enabledbool
allowed_ip_rangeslist
next_actionsarray
_metaObject
  • Successful status 200 OK
  • Response body schema:
json
{ 
  "id": <int>, 
  "username": <str>, 
  "account_type": <enum>, 
  "first_name": <str>, 
  "last_name": <str>, 
  "job_title": <str>, 
  "company_name": <str>, 
  "phone": <str>, 
  "mobile": <str>, 
  "status": <enum>, 
  "activated_at": <datetime>,
  "password_set_at": <datetime>,
  "password_expires_at": <datetime>, 
  "roles": [<int>], 
  "created_at": <datetime>, 
  "created_by": <user>, 
  "modified_at": <datetime>, 
  "modified_by": <user>, 
  "link_sent_at": <datetime>, 
  "link_sent_by": <user>,
  "timezone": <enum>,
  "is_ip_restriction_enabled": <bool>,
  "allowed_ip_ranges": [<str>],
  "_meta": { 
    "labels": { 
      "roles": [<str>] 
    }, 
    "permissions": { 
      "list": <bool>,
      "view": <bool>,
      "create": <bool>,
      "edit": <bool>,
      "delete": <bool>
    }, 
    "allowed_account_type_changes": [<str>]
  } 
}

Errors

Standard validation errors and additional custom errors enumerated in the table below:

CauseResponse codeMessage
Account type change not allowed400 Bad Request"account_type": ["Account type cannot be changed from {current type} to {new type}."]
Wrong delay_activation value400 Bad Request"delay_activation": ["Must be a valid boolean."]
delay_activation not allowed400 Bad Request"delay_activation": [ "delay_activation can not be set." ]
"roles" provided with non config admin account400 Bad Request"roles": ["Roles can be assigned only to config admin account."]
Limit of accounts has been exceeded400 Bad Request"detail": "Limit of {LIMIT} {account_type} accounts has been exceeded.", "error_code": "ERR_LIMIT_EXCEEDED"
Timezone is not a valid choice400 Bad Request"timezone": ["value is not a valid choice."]
Timezone is null400 Bad Request"timezone": ["This field may not be null."]
Password does not satisfy password complexity requirements400 Bad Request"password": ["Max repeating chars 2"]
Non Super Admin attempts to change password403 Forbidden"detail": "You do not have permission to perform this action."
Invalid IP address400 Bad Request"allowed_ip_ranges": ["Must be a valid set of IPv4 or IPv6 network addresses."]
Max number of items exceeded400 Bad Request"allowed_ip_ranges": ["Limit of 10 IP restrictions has been exceeded."]
Wrong is_ip_restriction_enabled value400 Bad Request"is_ip_restriction_enabled": ["Must be a valid boolean."]
Modifying own allowed_ip_ranges400 Bad Request"allowed_ip_ranges": ["You cannot modify your own IP restriction settings."]
Modifying own is_ip_restriction_enabled400 Bad Request"is_ip_restriction_enabled": ["You cannot modify your own IP restriction settings."]

DELETE /api/users/id/

Deletes single User.

Permissions

Requires authentication and users.delete permission.

Request

  • URL parameters
KeyTypeNotes
idint
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

DELETE /api/users/id/

Response

  • Successful status 204 No Content

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
User with "id" does not exist404 Not Found"detail": "Not found."

OPTIONS /api/users/

Permissions

Requires authentication only.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

OPTIONS /api/users/

Response

  • Successful status 200 OK
  • Response body:
json
{
    "list": {
        "columns": [
            {
                "alias": "id",
                "type": "int",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "username",
                "type": "string",
                "predicates": [
                    "exact",
                    "iexact",
                    "contains",
                    "icontains",
                    "startswith",
                    "istartswith",
                    "endswith",
                    "iendswith"
                ],
                "sort_ok": true
            },
            {
                "alias": "roles",
                "type": "set",
                "predicates": [
                    "containsall",
                    "containssome",
                    "isnull"
                ],
                "sort_ok": false,
                "autocomplete": "/api/roles/autocomplete/?text__icontains="
            },
            {
                "alias": "account_type",
                "type": "enum",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "values": [
                    {
                        "value": "internal",
                        "text": "Internal"
                    },
                    {
                        "value": "external",
                        "text": "External"
                    },
                    {
                        "value": "service_internal",
                        "text": "Service Internal"
                    },
                    {
                        "value": "service_external",
                        "text": "Service External"
                    },
                    {
                        "value": "full",
                        "text": "Full"
                    },
                    {
                        "value": "one_time_completion",
                        "text": "1 Time Completion"
                    },
                    {
                        "value": "super_admin",
                        "text": "Super Admin"
                    }
                ]
            },
            {
                "alias": "status",
                "type": "enum",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "values": [
                    {
                        "value": "created",
                        "text": "Created"
                    },
                    {
                        "value": "pending",
                        "text": "Pending"
                    },
                    {
                        "value": "active",
                        "text": "Active"
                    }
                ]
            },
            {
                "alias": "full_name",
                "type": "string",
                "predicates": [
                    "exact",
                    "iexact",
                    "contains",
                    "icontains",
                    "startswith",
                    "istartswith",
                    "endswith",
                    "iendswith"
                ],
                "sort_ok": false
            },
            {
                "alias": "last_login",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range",
                    "isnull"
                ],
                "sort_ok": true
            },
            {
                "alias": "activated_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range",
                    "isnull"
                ],
                "sort_ok": true
            },
            {
                "alias": "created_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "created_by",
                "type": "user",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "autocomplete": "/api/users/autocomplete/?text__icontains="
            },
            {
                "alias": "modified_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range"
                ],
                "sort_ok": true
            },
            {
                "alias": "modified_by",
                "type": "user",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "autocomplete": "/api/users/autocomplete/?text__icontains="
            },
            {
                "alias": "link_sent_at",
                "type": "datetime",
                "predicates": [
                    "exact",
                    "gt",
                    "gte",
                    "lt",
                    "lte",
                    "range",
                    "isnull"
                ],
                "sort_ok": true
            },
            {
                "alias": "link_sent_by",
                "type": "user",
                "predicates": [
                    "exact",
                    "in"
                ],
                "sort_ok": false,
                "autocomplete": "/api/users/autocomplete/?text__icontains="
            }
        ]
    },
    "details": {
        "schema": [
            {
                "alias": "account_type",
                "type": "enum",
                "required": true,
                "values": [
                    {
                        "value": "internal",
                        "text": "Internal"
                    },
                    {
                        "value": "external",
                        "text": "External"
                    },
                    {
                        "value": "service_internal",
                        "text": "Service Internal"
                    },
                    {
                        "value": "service_external",
                        "text": "Service External"
                    },
                    {
                        "value": "full",
                        "text": "Full"
                    },
                    {
                        "value": "one_time_completion",
                        "text": "1 Time Completion"
                    },
                    {
                        "value": "super_admin",
                        "text": "Super Admin"
                    }
                ]
            },
            {
                "alias": "password",
                "type": "string",
                "schema": [
                    {
                        "alias": "required_for_account_types",
                        "values": [
                            "service_internal",
                            "service_external"
                        ]
                    }
                ]
            },
            {
                "alias": "username",
                "type": "email",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "first_name",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    },
                    {
                        "type": "min_length",
                        "length": 1
                    }
                ]
            },
            {
                "alias": "last_name",
                "type": "string",
                "required": true,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    },
                    {
                        "type": "min_length",
                        "length": 1
                    }
                ]
            },
            {
                "alias": "job_title",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "company_name",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "phone",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "phone"
                    },
                    {
                        "type": "max_length",
                        "length": 20
                    }
                ]
            },
            {
                "alias": "mobile",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "phone"
                    },
                    {
                        "type": "max_length",
                        "length": 20
                    }
                ]
            },
            {
                "alias": "roles",
                "type": "set",
                "required": false,
                "autocomplete": "/api/roles/autocomplete/?text__icontains="
            },
            {
                "alias": "delay_activation",
                "type": "bool",
                "required": false,
                "validators": []
            },
            {
                "alias": "timezone",
                "type": "enum",
                "required": false,
                "values": [
                    { "value": "Africa/Abidjan" },
                    { "value": "America/Chicago"},
                    { "value": "Europe/Reykjavik"}
                // ... 
                ]
            }
        ]
    },
    "restrictions": {
        "limit_internal": 1000,
        "limit_external": 2500,
        "limit_full": 100,
        "limit_one_time_completion": 5000,
        "limit_super_admin": 25,
        "limit_items": 8625
    }
}

POST /api/users/id/send-activation-email/

This API endpoint is for resend an activation email for a given user.

Permissions

Requires authentication and a users.edit permission.

Request

  • URL parameters
KeyTypeNotes
idid
  • Headers
Content-Type: application/json
Authorization: JWT access_token

Validations

  • user
    • Valid user ID with account status created or pending.
  • Successful status 201 Created

Errors

CauseResponse codeMessage
User with given id has account already activated.400 Bad Request"detail": "The given account has already been activated."
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid id in URL404 Not Found"detail": ["Not found."]

PATCH /api/users/id/add-roles/

Endpoint to add given roles to existing ones. Batch operation - adds single or multiple roles.

Permissions

Perm to check: users.edit

URL parameters

KeyNotes
idUser ID

Request Schema

  • Headers
Request Method: PATCH
Location: /api/users/{id}/add-roles/ 
Authorization: JWT access_token
  • Body
json
{
    "roles": [7,8]
}

Request example

json
{
    "roles": [7,8]
}

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
_metaObject
  • Successful status 200 OK
  • Response body schema:
json
{
    "id": 4,
    "username": "test@mail.test",
    "account_type": "full",
    "first_name": "User",
    "last_name": "FullPermissions",
    "job_title": "",
    "company_name": "",
    "phone": "",
    "mobile": "",
    "status": "active",
    "activated_at": "2021-11-12T10:21:02.637000+01:00",
    "password_set_at": "2021-11-12T11:11:59.270000+01:00",
    "password_expires_at": null,
    "roles": [
        7,
        8
    ],
    "created_at": "2021-11-12T10:07:41.347000+01:00",
    "created_by": null,
    "modified_at": "2022-03-15T08:53:42.447000+01:00",
    "modified_by": null,
    "_meta": {
        "labels": {
            "roles": [
                "Create permissions",
                "Edit permissions"
            ]
        },
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": true
        }
    }
}

Errors

ErrorResponse codeMessage
roles is required400 Bad Request"roles": ["This field is required." ]
roles is empty400 Bad Request"roles": ["This list may not be empty." ]
roles not a list400 Bad Request"roles": ["Expected a list of items but got type "type"."]
roles not an integer list400 Bad Request"roles": ["Incorrect type. Expected pk value, received "type"."]
roles incorrect account400 Bad Request"roles": ["Roles can be assigned only to config admin account."]
Wrong/not existing id404 Not Found
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

PATCH /api/users/id/unassign-roles/

Endpoint to remove given roles from existing ones. Batch operation - removes single or multiple roles.

Permissions

Perm to check: users.edit

URL parameters

KeyNotes
idUser ID

Request Schema

  • Headers
Request Method: PATCH
Location: /api/users/{id}/unassign-roles/ 
Authorization: JWT access_token
  • Body
json
{
    "roles": [7,8]
}

Request example

json
{
    "roles": [7,8]
}

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
_metaObject
  • Successful status 200 OK
  • Response body schema:
json
{
    "id": 4,
    "username": "test@mail.test",
    "account_type": "full",
    "first_name": "User",
    "last_name": "FullPermissions",
    "job_title": "",
    "company_name": "",
    "phone": "",
    "mobile": "",
    "status": "active",
    "activated_at": "2021-11-12T10:21:02.637000+01:00",
    "password_set_at": "2021-11-12T11:11:59.270000+01:00",
    "password_expires_at": null,
    "roles": [],
    "created_at": "2021-11-12T10:07:41.347000+01:00",
    "created_by": null,
    "modified_at": "2022-03-15T08:53:42.447000+01:00",
    "modified_by": null,
    "_meta": {
        "labels": {
            "roles": []
        },
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": true
        }
    }
}

Errors

ErrorResponse codeMessage
roles is required400 Bad Request"roles": ["This field is required." ]
roles is empty400 Bad Request"roles": ["This list may not be empty." ]
roles not a list400 Bad Request"roles": ["Expected a list of items but got type "type"."]
roles not an integer list400 Bad Request"roles": ["Incorrect type. Expected pk value, received "type"."]
roles incorrect account400 Bad Request"roles": ["Roles can be assigned only to config admin account."]
Wrong/not existing id404 Not Found
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

GET /api/users/autocomplete/

List Users based on query parameters.

Permissions

Requires authentication and users.list permission

Request example

  • Headers
Request Method: GET
Location: /api/users/autocomplete/
Authorization: JWT access_token

Response

The response contains only users for which request user has users.list permission.

KeyTypeNotes
limitint
offsetint
total_countintTotal number of items visible to the user (based on permissions).
filtered_countintNumber of items visible to the user (based on permissions) with filters applied.
nextURL / nullNext page URL (null if there is no next page)
previousURL / nullPrevious page URL (null if there is no previous page)
resultsArrayDescribed in the next table.

Response results array

KeyTypeNotes
valueid
textstring

Response example

  • Status 200 OK
  • Body
json
{
  "limit": 100,
  "offset": 0,
  "filtered_count": 2,
  "total_count": 21,
  "next": null,
  "previous": null,
  "results": [
    {
      "value": 21,
      "text": "John Doe",
    },
    {
      "value": 20,
      "text": "Sarah Connor",
    }
  ]
}

Sorting

ParameterExampleNotes
text{build}/api/users/autocomplete//?ordering=textAscending
text{build}/api/users/autocomplete/?ordering=-textDescending (-)

Filtering

For the full description of standard predicates see ALX API standards - Developers guide.

ParameterType
idint
textstring
ErrorResponse codeMessage
Max items in filtering by _in exceeded400 Bad request
Requesting user is not authenticated401 Unauthorized"detail": "Authentication credentials were not provided."
Unauthorized API call403 Forbidden"detail": "You do not have permission to perform this action."

POST /api/users/reset-password/

The method is intended for requesting password reset email, typically when the user forgot his password. In response the system sends the user an email with the link to the reset password page: <Client URL>/ui/accounts/reset-password/<password-reset-token>/ For now, we will use the current email template.

Permissions

Any user.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/users/reset-password/

{
    "email": <email>
}
  • Successful status 200 OK

Errors

ErrorResponse codeMessage
Account locked400 Bad Request{"detail": "Password reset is disabled while your account is locked. Please wait until the lockout ends at "datetime".", "error_code": "ERR_ACCOUNT_LOCKED", "data": "lockout_ends_at": "datetime>" }}
Reset password token invalidated due to SSO-only account type400 Bad Request

GET /api/users/reset-password/token/

The method is intended for the FE use. Before displaying the Password reset page, FE validates the token. If the token is invalid or it is expired, FE redirects the user to the appropriate page.

Permissions

Requires valid token.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/users/reset-password/<token>/

Response

KeyTypeNotes
emailemailUser email
  • Successful status 200 OK
  • Response body schema
json
{ 
    "email": "syl*****e@test.test" 
}

Errors

ErrorResponse codeMessage
Invalid token403 Forbidden"detail": "Authentication credentials were not provided."
Token expired400 Bad Request"detail": "Token expired."
Account locked400 Bad Request{"detail": "Password reset is disabled while your account is locked. Please wait until the lockout ends at "datetime".", "error_code": "ERR_ACCOUNT_LOCKED", "data": "lockout_ends_at": "datetime>" }}
Reset password token invalidated due to SSO-only account type400 Bad Request

POST /api/users/reset-password/token/password/

The method is intended for resetting users password following password reset request. The caller is identified by the token.

Permissions

Requires valid token.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/users/reset-password/<token>/password/

{
    "password": <string>
}

Validations

  • password
    • password_prevent_reuse
    • password_rotation_interval
    • max_repeating_chars
    • min_letters
    • min_numbers
    • min_symbols
    • min_lower_case
    • min_upper_case
    • min_length

Response

  • Successful status 201 Created
json
{ 
    "refresh": "REFRESH_TOKEN", 
    "access": "ACCESS_TOKEN"
}

Errors

ErrorResponse codeMessage
Invalid token403 Forbidden"detail": "Authentication credentials were not provided."
Invalid password400 Bad Request"password": ["Max repeating chars 2"]
Account locked400 Bad Request{"detail": "Password reset is disabled while your account is locked. Please wait until the lockout ends at "datetime".", "error_code": "ERR_ACCOUNT_LOCKED", "data": "lockout_ends_at": "datetime>" }}
Reset password token invalidated due to SSO-only account type400 Bad Request

OPTIONS /api/users/reset-password/token/password/

Permissions

Any user.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
OPTIONS /api/users/reset-password/<token>/password/

Response

  • Successful status 200 OK
  • Response body:
json
{
    "details": { 
    "schema": [
        {
            "alias": "password", 
            "type": "string", 
            "required": true 
            }
        ]
    } 
}

PATCH /api/users/me/

Updates information about logged user.

Permissions

Requires authentication.

Allowed parameters

KeyTypeNotes
usernamestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring

Any parameter not listed above are silently ignored if passed.

Request

  • Headers
Request Method: PATCH
Content-Type: application/json
Location: /api/users/me/
Authorization: JWT access_token
  • Sample request body
json
{
    "username": "alx.dev@autologyx.com",
    "first_name": "John",
    "last_name": "Smith"
}

Validations

  • username
    • is valid email
    • is unique
    • is not null
    • max length is 100
  • first_name
    • is string
    • is not null
    • max length is 100
    • min length is 1
  • last_name
    • is string
    • is not null
    • max length is 100
    • min length is 1
  • job_title
    • is string
    • is not null
    • max length is 100
  • company_name
    • is string
    • is not null
    • max length is 100
  • phone
    • is string
    • is not null
    • max length is 20
  • mobile
    • is string
    • is not null
    • max length is 20

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
user_groups_membershiparray
_metaObject
  • Successful status 200 OK
  • Response body schema
json
{
    "id": 2,
    "username": "alx.dev@autologyx.com",
    "account_type": "super_admin",
    "first_name": "John",
    "last_name": "Smith",
    "job_title": "",
    "company_name": "",
    "phone": "",
    "mobile": "",
    "status": "active",
    "activated_at": null,
    "password_set_at": "2021-11-05T13:57:07.228000+01:00",
    "password_expires_at": null,
    "roles": [],
    "created_at": "2021-11-05T13:56:26.726000+01:00",
    "created_by": null,
    "modified_at": "2021-11-16T15:32:53.479000+01:00",
    "modified_by": null,
    "user_groups_membership": [],
    "_meta": {
        "labels": {
            "roles": [],
            "user_groups_membership": [],
        },
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": false
        }
    }
}

Errors

Standard validation errors.

PATCH /api/users/me/set-password/

Updates logged user password.

Permissions

Requires authentication.

Service accounts are not allowed.

Allowed parameters

KeyTypeNotes
old_passwordstring
new_passwordstring

Any parameter not listed above are silently ignored if passed.

Request

  • Headers
Request Method: PATCH
Content-Type: application/json
Location: /api/users/me/set-password/
Authorization: JWT access_token
  • Sample request body
json
{
    "old_password": "some_old_pass",
    "new_password": "some_old_pass"
}

Validations

  • old_password
    • is valid password
    • is required
    • is not null
  • new_password
    • is string
    • meets security rules
    • is required
    • is not null

Response

KeyTypeNotes
refreshstringJWT token to refresh JWT access token
accessstringJWT token to access ALX API endpoints
  • Successful status 200 OK
  • Response body schema
json
{
    "refresh": "refresh_token",
    "access": "access_token"
}

Errors

CauseResponse status codeResponse message
old_password is not provided400 Bad Request"old_password": ["This field is required."]
old_password is NULL400 Bad Request"old_password": ["This field may not be null."]
old_password is blank string400 Bad Request"old_password": ["This field may not be blank."]
old_password is not a string400 Bad Request"old_password": ["Not a valid string."]
old_password does not match current password400 Bad Request"old_password": ["Invalid password."]
new_password is not provided400 Bad Request"new_password": ["This field is required."]
new_password is NULL400 Bad Request"new_password": ["This field may not be null."]
new_password is blank_string400 Bad Request"new_password": ["This field may not be blank."]
new_password is not a string400 Bad Request"new_password": ["Not a valid string."]
new_password does not match security rule about number of repeating chars400 Bad Request"new_password": ["Can have only "number" repeating consecutive chars"]
new_password does not match security rule about number of letters400 Bad Request"new_password": ["Must be more complex (must contain "number" or more letters)"]
new_password does not match security rule about number of digits400 Bad Request"new_password": ["Must be more complex (must contain "number" or more digits)"]
new_password does not match security rule about number of special characters400 Bad Request"new_password": ["Must be more complex (must contain "number" or more special characters)"]
new_password does not match security rule about number of uppercase characters400 Bad Request"new_password": ["Must be more complex (must contain "number" or more uppercase characters)"]
new_password does not match security rule about number of lowercase characters400 Bad Request"new_password": ["Must be more complex (must contain "number" or more lowercase characters)"]
new_password does not match security rule about length400 Bad Request"new_password": ["Invalid Length (Must be "number" characters or more)"]
new_password does not match security rule about re-using password from the past400 Bad Request"new_password": ["Password used in the past"]
Reset password token invalidated due to SSO-only account type400 Bad Request
Service account attempts to change password403 Forbidden"detail": "You do not have permission to perform this action."

OPTIONS /api/users/me/

Permissions

Requires authentication

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
OPTIONS /api/users/me/

Response

  • Successful status 200 OK
  • Response body:
json
{
    "details": {
        "schema": [
            {
                "alias": "username",
                "type": "email",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "first_name",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    },
                    {
                        "type": "min_length",
                        "length": 1
                    }
                ]
            },
            {
                "alias": "last_name",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    },
                    {
                        "type": "min_length",
                        "length": 1
                    }
                ]
            },
            {
                "alias": "job_title",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "company_name",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "max_length",
                        "length": 100
                    }
                ]
            },
            {
                "alias": "phone",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "phone"
                    },
                    {
                        "type": "max_length",
                        "length": 20
                    }
                ]
            },
            {
                "alias": "mobile",
                "type": "string",
                "required": false,
                "validators": [
                    {
                        "type": "phone"
                    },
                    {
                        "type": "max_length",
                        "length": 20
                    }
                ]
            },
            {
                "alias": "timezone",
                "type": "enum",
                "required": false,
                "values": [
                    { "value": "Africa/Abidjan" },
                    { "value": "America/Chicago"},
                    { "value": "Europe/Reykjavik"}
                // ... 
                ]
            }
        ]
    }
}

GET /api/users/me/

Permissions

Requires authentication

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/users/me/

Response

KeyTypeNotes
idint
usernamestring
account_typestring
first_namestring
last_namestring
job_titlestring
company_namestring
phonestring
mobilestring
statusenum
activated_atdatetime
password_set_atdatetime
password_expires_atdatetime
rolesarray
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
user_groups_membershiparray
timezoneenum
_metaObject
  • Successful status 200 OK
  • Response body schema
json
{
    "id": 2,
    "username": "alx.dev@autologyx.com",
    "account_type": "super_admin",
    "first_name": "ALX",
    "last_name": "Developer",
    "job_title": "",
    "company_name": "",
    "phone": "",
    "mobile": "",
    "status": "active",
    "activated_at": null,
    "password_set_at": "2021-11-05T13:57:07.228000+01:00",
    "password_expires_at": null,
    "roles": [],
    "created_at": "2021-11-05T13:56:26.726000+01:00",
    "created_by": null,
    "modified_at": "2021-11-16T15:32:53.479000+01:00",
    "modified_by": null,
    "user_groups_membership": [],
    "timezone": "UTC",
    "_meta": {
        "labels": {
            "roles": [],
            "user_groups_membership": [],
        },
        "permissions": {
            "list": true,
            "view": true,
            "create": true,
            "edit": true,
            "delete": false
        }
    }
}

Errors

ErrorResponse codeMessage
Invalid token403 Forbidden"detail": "Authentication credentials were not provided."

GET /api/users/stats/

Permissions

Requires authentication and users.view permission.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/users/stats/

Response

KeyTypeNotes
internalobject
externalobject
fullobject
one_time_completionobject
super_adminobject

Response account_type object

KeyTypeNotes
countintThe current number of accounts of the corresponding type.
limitintThe max number of accounts of the corresponding type.
  • Successful status 200 OK
  • Response body schema
json
{
  "internal": {
    "count": <int>,
    "limit": <int>
  },
  "external": {
    "count": <int>,
    "limit": <int>
  },
  "full": {
    "count": <int>,
    "limit": <int>
  },
  "one_time_completion": {
    "count": <int>,
    "limit": <int>
  },
  "super_admin": {
    "count": <int>,
    "limit": <int>
  }
}

Errors

Standard validation errors.

GET /api/users/permissions/

Returns logged-in User permissions.

Permissions

Requires authentication.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

GET /api/users/permissions/

Response

KeyTypeNotes
company_detailsobject
authentication_objectsobject
custom_componentsobject
filesobject
object_classesobject
object_recordsobject
object_class_formsobject
object_modelsobject
rolesobject
outbound_mail_setupobject
message_templatesobject
sequencesobject
single_sign_onobject
tasksobject
task_templatesobject
task_group_templatesobject
ui_configobject
usersobject
standard_authenticationobject
user_groupsobject
integrationsobject
  • Successful status 200 OK
  • Response body schema
json
{
  "company_details": {
    "edit": <bool>,
    "view": <bool>
  },
  "authentication_objects": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "custom_components": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "files": {
    "store": <bool>,
    "list": <bool>,
    "delete": <bool>
  },
  "integrations": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "object_classes": {
    "list": <bool>,
    "create": <bool>
  },
  "object_records": {
    "create": <bool>,
    "list": <bool>
  },
  "object_class_forms": {
    "list": <bool>
  },
  "object_models": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>
  },
  "roles": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "outbound_mail_setup": {
    "view": <bool>,
    "edit": <bool>
  },
  "message_templates": {
    "list": <bool>
  },
  "sequences": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "single_sign_on": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "tasks": {
    "list": <bool>
  },
  "task_templates": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "task_group_templates": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "ui_config": {
    "view": <bool>,
    "create": <bool>
  },
  "users": {
    "list": <bool>,
    "view": <bool>,
    "create": <bool>,
    "edit": <bool>,
    "delete": <bool>
  },
  "standard_authentication": {
    "view": <bool>,
    "edit": <bool>
  },
  "user_groups": {
    "create": <bool>,
    "list": <bool>
  }
}

Sorting

Not available.

Filtering

Not available.

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."

GET /api/users/id/user-groups/

Returns list of groups where a given user is a member.

Permissions

Requires authentication and users.view permission.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

GET /api/users/id/user-groups/

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of results visible to the user (based on permissions).
filtered_countintNumber of results visible to the user (based on permissions) with filters applied.
nexturlNext page URL (null if there is no next page)
previousurlPrevious page URL (null if there is no previous page)
resultsArrayList of results. Described in the next table.

Response results array

KeyTypeNotes
idintUser Group id
namestringUser Group name
added_atdatetimetimestamp when the user was added to a user group
created_atdatetimetimestamp when the User Group was created
created_byuseruser (object) who created the User Group
modified_atdatetimetimestamp when the User Group was modified
modified_byuseruser (object) who modified the User Group
num_of_membersintnumber of group members
num_of_ownersintnumber of group owners
_meta.permissionsObjectObject describing permissions.
  • Successful status 200 OK
  • Response body schema
json
{
  "limit": <int>,
  "offset": <int>,
  "filtered_count": <int>,
  "total_count": <int>,
  "next": <str | null>,
  "previous": <str | null>,
  "results": [
    {
      "id": <int>,
      "name": <str>,
      "added_at": <datetime>,
      "created_by": <user>,
      "modified_at": <datetime>,
      "modified_by": <user>,
      "num_of_members": <int>,
      "num_of_owners": <int>,
      "_meta": {
        "permissions": {
          "list": <bool>,
          "view": <bool>,
          "create": <bool>,
          "edit": <bool>,
          "delete": <bool>
          "edit_perm_sets": <bool>
          "edit_members": <bool>
          "edit_owners": <bool>
        }
      }
    }
  ]
}

Sorting

ParameterExampleNotes
id/api/users/?ordering=idAscending
id/api/users/?ordering=-idDescending (-)
name/api/users/?ordering=nameAscending
name/api/users/?ordering=-nameDescending (-)
added_at/api/users/?ordering=added_atAscending
added_at/api/users/?ordering=-added_atDescending (-)
num_of_members/api/users/?ordering=num_of_membersAscending
num_of_members/api/users/?ordering=-num_of_membersDescending (-)
num_of_owners/api/users/?ordering=num_of_ownersAscending
num_of_owners/api/users/?ordering=-num_of_ownersDescending (-)
created_at/api/users/?ordering=created_atAscending
created_at/api/users/?ordering=-created_atDescending (-)
modified_at/api/users/?ordering=modified_atAscending
modified_at/api/users/?ordering=-modified_atDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterType
idint
nameemail
added_atdatetime
num_of_membersint
num_of_ownersint
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser

Errors

ErrorResponse codeMessage
Wrong ordering value400 Bad Request"ordering": ["Select a valid choice. {value} is not one of the available choices."]
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
Invalid id in URL404 Not Found"detail": ["Not found."]

OPTIONS /api/users/id/user-groups/

Permissions

Requires authentication only.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema

OPTIONS /api/users/id/user-groups/

Response

  • Successful status 200 OK
  • Response body:
json
{
  "list": {
    "columns": [
      {
        "alias": "id",
        "type": "int",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      },
      {
        "alias": "name",
        "type": "string",
        "predicates": [
          "exact",
          "iexact",
          "contains",
          "icontains",
          "startswith",
          "istartswith",
          "endswith",
          "iendswith" 
        ],
        "sort_ok": true
      },
      {
        "alias": "added_at",
        "type": "datetime",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      },
      {
        "alias": "created_by",
        "type": "user",
        "predicates": [
          "exact",
          "in" 
        ],
        "sort_ok": false,
        "autocomplete": "/api/users/autocomplete/?text__icontains=" 
      },
      {
        "alias": "modified_by",
        "type": "user",
        "predicates": [
          "exact",
          "in" 
        ],
        "sort_ok": false,
        "autocomplete": "/api/users/autocomplete/?text__icontains=" 
      },
      {
        "alias": "num_of_members",
        "type": "int",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      },
      {
        "alias": "num_of_owners",
        "type": "int",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      },
      {
        "alias": "created_at",
        "type": "datetime",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      },
      {
        "alias": "modified_at",
        "type": "datetime",
        "predicates": [
          "exact",
          "gt",
          "gte",
          "lt",
          "lte",
          "range" 
        ],
        "sort_ok": true
      }
    ]
  }
}

GET /api/users/ws-auth/

Permissions

Requires authentication

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/users/ws-auth/

Response

KeyTypeNotes
uuidstringThe UUID is a standard unique identifier generated by the system and is valid for 5 minutes. The UUID can be used only once, it will expire when use.
  • Successful status 200 OK
  • Response body schema
json
{
    "uuid": "f1b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b",
}

Errors

ErrorResponse codeMessage
Invalid token401 Unauthorized"detail": "Authentication credentials were not provided."