Skip to main content
PUT
/
api
/
executions
/
{id}
/
cancel
Cancel execution
curl --request PUT \
  --url https://platform.kodexa.ai/api/executions/{id}/cancel \
  --header 'x-api-key: <api-key>'
import requests

url = "https://platform.kodexa.ai/api/executions/{id}/cancel"

headers = {"x-api-key": "<api-key>"}

response = requests.put(url, headers=headers)

print(response.text)
const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};

fetch('https://platform.kodexa.ai/api/executions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.kodexa.ai/api/executions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://platform.kodexa.ai/api/executions/{id}/cancel"

req, _ := http.NewRequest("PUT", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://platform.kodexa.ai/api/executions/{id}/cancel")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.kodexa.ai/api/executions/{id}/cancel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "assistantId": "<string>",
  "changeSequence": 123,
  "context": {},
  "createdOn": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "documentFamilyId": "<string>",
  "endDate": "2023-11-07T05:31:56Z",
  "exceptionDetails": {
    "advice": "<string>",
    "cause": "<unknown>",
    "description": "<string>",
    "documentationUrl": "<string>",
    "errorMessage": "<string>",
    "errorType": "<string>",
    "executedVersion": "<string>",
    "help": "<string>",
    "message": "<string>",
    "optionErrors": {},
    "stackTrace": [
      "<unknown>"
    ],
    "statusCode": 123,
    "validationErrors": [
      {
        "description": "<string>",
        "message": "<string>",
        "option": "<string>"
      }
    ]
  },
  "id": "<string>",
  "idempotencyKey": "<string>",
  "organizationId": "<string>",
  "parentExecutionId": "<string>",
  "pipeline": {
    "exceptions": [
      {
        "advice": "<string>",
        "cause": "<unknown>",
        "description": "<string>",
        "documentationUrl": "<string>",
        "errorMessage": "<string>",
        "errorType": "<string>",
        "executedVersion": "<string>",
        "help": "<string>",
        "message": "<string>",
        "optionErrors": {},
        "stackTrace": [
          "<unknown>"
        ],
        "statusCode": 123,
        "validationErrors": [
          {
            "description": "<string>",
            "message": "<string>",
            "option": "<string>"
          }
        ]
      }
    ],
    "id": "<string>",
    "ref": "<string>",
    "steps": [
      {
        "conditional": "<string>",
        "context": {},
        "end": "<string>",
        "exceptionDetails": {
          "advice": "<string>",
          "cause": "<unknown>",
          "description": "<string>",
          "documentationUrl": "<string>",
          "errorMessage": "<string>",
          "errorType": "<string>",
          "executedVersion": "<string>",
          "help": "<string>",
          "message": "<string>",
          "optionErrors": {},
          "stackTrace": [
            "<unknown>"
          ],
          "statusCode": 123,
          "validationErrors": [
            {
              "description": "<string>",
              "message": "<string>",
              "option": "<string>"
            }
          ]
        },
        "executionPolicy": {
          "backoffBaseSeconds": 123,
          "backoffStrategy": "<string>",
          "maxAttempts": 123,
          "onExhausted": "<string>",
          "timeoutSeconds": 123
        },
        "extensionPackRef": "<string>",
        "id": "<string>",
        "inputId": "<string>",
        "name": "<string>",
        "optionTypes": {},
        "options": {},
        "outputId": "<string>",
        "outputIds": "<string>",
        "processingTime": 123,
        "progress": 123,
        "progressMax": 123,
        "ref": "<string>",
        "start": "<string>",
        "statusMessage": "<string>",
        "stepType": "MODULE"
      }
    ],
    "valid": true
  },
  "priority": 123,
  "processingTime": 123,
  "sessionId": "<string>",
  "startDate": "2023-11-07T05:31:56Z",
  "statusDetails": {
    "detail": "<string>",
    "message": "<string>",
    "progress": 123,
    "progressMax": 123,
    "stepStatus": "<string>"
  },
  "targets": {
    "instances": [
      {
        "contentObjectId": "<string>",
        "documentFamilyId": "<string>",
        "labelsToApply": [
          "<string>"
        ],
        "ref": "<string>",
        "taxonomyRefs": [
          "<string>"
        ],
        "type": "<string>"
      }
    ]
  },
  "updatedOn": "2023-11-07T05:31:56Z",
  "uuid": "<string>"
}

Authorizations

x-api-key
string
header
required

API key for authentication. Create one from the Kodexa platform UI under Settings > Access Tokens.

Path Parameters

id
string<uuid>
required

Unique identifier (UUID) of the execution.

Response

Execution cancelled

An execution records the details and results of a processing session.

assistantId
string | null
changeSequence
integer<int32>

Optimistic locking version number.

context
object
createdOn
string<date-time>

Timestamp when the execution was created.

description
string
documentFamilyId
string | null
endDate
string<date-time> | null
exceptionDetails
object | null
id
string

Unique identifier (UUID) for the execution.

idempotencyKey
string | null
organizationId
string
parentExecutionId
string | null
pipeline
object | null
priority
integer<int32>
processingTime
integer<int64>
sessionId
string | null
startDate
string<date-time> | null
status
enum<string>
Available options:
PENDING,
RUNNING,
SUCCEEDED,
FAILED,
REQUESTED,
SKIPPED,
CANCELLING,
CANCELLED,
PENDING_REPROCESSING,
REPROCESSED
statusDetails
object | null
targets
object | null
updatedOn
string<date-time>

Timestamp when the execution was last updated.

uuid
string

Secondary UUID identifier.