# Queries

These are a collection of endpoints that allow you to view users on your Console.

# Get User

GET /api/v1/user/get

Retrieves a user's details.

Required Parameters

auth_token string
A valid auth token
email string
The email address of the user to be returned

Response

JSON structure with the user's details.

Example

curl https://EXAMPLE.canary.tools/api/v1/user/get \
  -d auth_token=EXAMPLE_AUTH_TOKEN  \
  -d email=EXAMPLE_EMAIL \
  -G
Copied!
1
2
3
4
Response
{
  "result": "success",
  "user": {
    "access_level": "admin",
    "disabled": false,
    "email": "<user_email>",
    "id": "<user_id>",
    "managed_flocks": "",
    "no_direct_login": false,
    "note": "Example User Note",
    "saml_provisioned": false,
    "summary_email_enabled": true,
    "supervisor": false,
    "totp_enabled": true,
    "watched_flocks": "",
    "webauthn_credential": "",
    "webauthn_enabled": false
  }
}
Copied!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# Get User Auth

GET /api/v1/user/auth

Retrieves a user's authorization details.

Required Parameters

auth_token string
A valid auth token
email string
The email address of the user to be returned

Response

JSON structure with the user's authorization details.

Example

curl https://EXAMPLE.canary.tools/api/v1/user/auth \
  -d auth_token=EXAMPLE_AUTH_TOKEN  \
  -d email=EXAMPLE_EMAIL \
  -G
Copied!
1
2
3
4
Response
{
  "access_level": 1,
  "email": "<user_email>",
  "is_sso_login": false,
  "managed_flocks": [],
  "result": "success",
  "saml_login": false,
  "watched_flocks": []
}
Copied!
1
2
3
4
5
6
7
8
9

# Filter Users

GET /api/v1/users/filter

List all users that match a specified `filter_str`.

Required Parameters

auth_token string
A valid auth token
filter_str string
String to match on

Response

JSON structure with the list of filtered users.

Example

curl https://EXAMPLE.canary.tools/api/v1/users/filter \
  -d auth_token=EXAMPLE_AUTH_TOKEN  \
  -d filter_str='EXAMPLE_FILTER_STRING' \
  -G
Copied!
1
2
3
4
Response
{
  "result": "success",
  "users": [
    {
      "access_level": "1",
      "disabled": "None",
      "email": "<user_email>",
      "id": "<user_id>",
      "note": "",
      "supervisor": "False",
      "totp_enabled": "True"
    }
  ]
}
Copied!
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# List Users

GET /api/v1/users/list

List all users and their roles.

Required Parameters

auth_token string
A valid auth token

Response

JSON structure with the list of users.

Example

curl https://EXAMPLE.canary.tools/api/v1/users/list \
  -d auth_token=EXAMPLE_AUTH_TOKEN  \
  -G
Copied!
1
2
3
Response
{
  "result": "success",
  "users": [
    {
      "access_level": "1",
      "disabled": "None",
      "email": "<user_email>",
      "id": "<user_id>",
      "managed_flocks": "",
      "note": "",
      "supervisor": "False",
      "totp_enabled": "True",
      "watched_flocks": "",
      "webauthn_enabled": false
    },
    ...
  ]
}
Copied!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18