Skip to main content

GET - List of users

List of users

Request

  • Method: GET
  • Endpoint: /users
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: list-of-users

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Parameters

NameInRequiredSchemaDescription
limitquerynointegerinclude first N items of a resource collection
offsetquerynonumberexclude first N items of a resource collection
sortquerynostringsort items in a resource collection
qquerynostringThis parameter is used for quick search across text fields.
idquerynostringfilter by ids
firstNamequerynostringfilter by first name
lastNamequerynostringfilter by last name
rolequerynostringfilter by role
statusquerynostringfilter by status
emailquerynostringfilter by email
locationIdquerynostringfilter by locations
tagsquerynostringfilter by tags

Responses

200 OK

Content-Type: application/json Schema: object

Schema
{
"allOf": [
{
"$ref": "#/components/schemas/PageResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserResponse"
}
}
}
}
]
}

Example: example-1

{
"data": [
{
"id": "be63c536-6cf3-4866-8970-37a956e3f403",
"firstName": "John",
"middleName": "Lee",
"lastName": "Fox",
"employeeNo": "1234",
"employeePin": "4321",
"email": "fox.john@gmail.com",
"phone": "80291110099",
"locale": "en-US",
"role": "ADMIN",
"status": "ACTIVE",
"photoId": "a7c6f740-2a42-449c-a03b-b8d36aa4709a",
"locationIds": [
"99b770c0-2396-43d3-b109-85a9d73df7b1",
"e1dfeaba-4318-4411-be91-f8af5214dd02"
],
"tags": [
"tag1",
"tag2"
],
"userLinked": true,
"externalId": "external-user-1",
"gpsTracking": true
}
],
"meta": {
"offset": 0,
"limit": 20,
"count": 1,
"sort": [
{
"property": "id",
"direction": "asc"
}
],
"filter": [
{
"property": "role",
"value": "USER"
},
{
"property": "firstName",
"value": "John"
}
]
}
}

401 Unauthorized

500 Internal Server Error

Content-Type: application/json Schema: ErrorResponse

Schema
{
"$ref": "#/components/schemas/ErrorResponse"
}

Example: example-1

{
"message": "internal server error",
"code": "internal.server.error",
"timestamp": "2023-03-07T05:57:59.315Z"
}