Skip to main content

POST - Create new action

Create new action

Request

  • Method: POST
  • Endpoint: /check-lists/actions
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: create-new-action

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Request Body

Required: yes Content-Type: application/json Schema: ActionRequest

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

Example: example-1

{
"name": "Device sounds loudly",
"type": "BOOLEAN"
}

Responses

201 OK

Content-Type: application/json Schema: ActionResponse

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

Example: example-1

{
"id": "873ac391-74cc-4cf7-97ac-27c4bed4f52b",
"name": "Device sounds loudly",
"type": "BOOLEAN"
}

400 Bad request

Content-Type: application/json Schema: ErrorResponse

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

Example: example-1

{
"message": "validation failed",
"code": "validation.failed",
"timestamp": "2023-03-07T05:57:59.315Z",
"details": [
{
"message": "must not be null",
"code": "validation.notnull.failed",
"identifier": "type"
}
]
}

401 Unauthorized

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