Skip to main content

PATCH - Patch update user by id

Patch update user by id

Request

  • Method: PATCH
  • Endpoint: /users/{id}
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: patch-update-user

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Parameters

NameInRequiredSchemaDescription
idpathyesstringresource unique id

Request Body

Required: no Content-Type: application/json Schema: UserPatchRequest

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

Example: example-1

{
"employeeNo": "1234",
"employeePin": "4321",
"locale": "en-US"
}

Responses

200 OK

Content-Type: application/json Schema: UserResponse

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

Example: example-1

{
"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
}

400 Bad Request

Content-Type: application/json Schema: ErrorResponse

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

Example: example-1

{
"message": "invalid input data",
"code": "input.data.invalid",
"timestamp": "2023-03-07T05:57:59.315Z",
"details": [
{
"message": "invalid data type",
"code": "data.type.invalid",
"identifier": "id",
"args": [
"[UUID]"
]
}
]
}

401 Unauthorized

404 Not Found

Content-Type: application/json Schema: ErrorResponse

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

Example: example-1

{
"message": "resource wasn't found",
"code": "not.found",
"timestamp": "2023-03-07T05:57:59.315Z"
}

406 Not Acceptable

Content-Type: application/json Schema: ErrorResponse

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

Example: example-1

{
"message": "mismatch in the types of content",
"code": "not.acceptable",
"timestamp": "2023-03-07T05:57:59.315Z"
}

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"
}