Skip to main content

POST - Create new issue

Create new issue

Request

  • Method: POST
  • Endpoint: /issues
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: create-new-issue

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Request Body

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

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

Example: example-1

{
"name": "Issue",
"description": "Description",
"typeId": "cfd47385-fc8e-4727-a1b5-383e1842af1b",
"priority": "MAJOR",
"assigneeId": "46ed469f-38f9-44fc-b6d5-9ec34f1e03cd",
"untilDate": "2023-12-31T00:00:00.000Z",
"locationId": "663745ce-daf9-4c0b-8616-e12ed40e6a34",
"pointId": "59623848-fb58-4e19-b686-724d42d53c95",
"email": "manager@mail.com",
"mediaIds": [
"44100168-11b1-4396-b863-96872820ab5f"
]
}

Responses

201 CREATED

Content-Type: application/json Schema: IssueResponse

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

Example: example

{
"id": "4adbc000-3095-42f3-bddd-d8a1da1ab2bd",
"name": "Issue",
"description": "Description",
"typeId": "cfd47385-fc8e-4727-a1b5-383e1842af1b",
"status": "OPEN",
"priority": "MAJOR",
"assigneeId": "46ed469f-38f9-44fc-b6d5-9ec34f1e03cd",
"seen": false,
"untilDate": "2023-12-31T00:00:00.000Z",
"locationId": "663745ce-daf9-4c0b-8616-e12ed40e6a34",
"pointId": "59623848-fb58-4e19-b686-724d42d53c95",
"email": "manager@mail.com",
"mediaIds": [
"44100168-11b1-4396-b863-96872820ab5f"
],
"lastModifiedAt": "2023-03-07T05:57:59.315Z",
"createdBy": "d3b4eb7b-567b-4e09-8646-09b648bf3bd6"
}

400 Bad request

Content-Type: application/json Schema: ErrorResponse

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

Example: example

{
"value": {
"message": "validation failed",
"code": "validation.failed",
"timestamp": "2023-03-07T05:57:59.315Z",
"details": [
{
"message": "must not be blank",
"code": "validation.notblank.failed",
"identifier": "name"
}
]
}
}

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