Skip to main content

POST - Copy task execution

Copy task execution

Request

  • Method: POST
  • Endpoint: /task-executions/{scheduledTaskId}/copy
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: copy-task-execution

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Parameters

NameInRequiredSchemaDescription
scheduledTaskIdpathyesstringresource unique id

Request Body

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

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

Example: example-1

{
"assigneeIds": [
"4f9e4741-3069-4a03-8386-5f3ee45791aa"
],
"startAt": "2023-03-06T18:00:00.000Z",
"endAt": "2023-03-06T21:00:00.000Z",
"deadlined": false
}

Responses

201 CREATED

Content-Type: application/json Schema: TaskExecutionInfoResponse

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

Example: example-1

{
"id": "e30fc67c-f946-414a-b4f9-423eabb90534",
"scheduledTaskId": "d6f4c4ff-f402-45b2-b7d7-b009fd16e44d",
"locationId": "44e089c2-e9ae-469b-9f6b-8be71a47cac6",
"performerId": "8fa4464d-5c26-49a2-934c-84226ec83caa",
"performerHistoryId": 20,
"assigneeIds": [
"3467d855-5478-41a9-b192-5e41b9cbd87d",
"f3e03f65-d557-405d-ac89-a4d3054b8578"
],
"name": "Task 1",
"state": "IN_PROGRESS",
"status": "SUCCESS",
"startAt": "2023-03-07T05:00:00.000Z",
"endAt": "2023-03-07T10:00:00.000Z",
"startedAt": "2023-03-07T05:00:00.000Z",
"endedAt": "2023-03-07T10:00:00.000Z",
"errorCount": 0,
"warningCount": 0,
"priority": "NORMAL",
"seriesId": null,
"deadlined": false,
"published": true,
"edited": false,
"deleted": false,
"stepCount": 10,
"executedStepCount": 3,
"tags": [
"tag-1",
"tag-2"
]
}

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-06T18:38:28.788Z",
"details": [
{
"message": "multiple resources not allowed",
"code": "multiple.resources.not.allowed"
}
]
}

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