Cancel operation
Requests cancellation after transactionally rechecking that the operation is cancellable. Only operations whose capabilities.cancellable is true accept cancellation: running or action-required campaign and production-enrollment operations. The operation moves to cancelling and later settles as cancelled or another terminal status. Other operations return 409 operation_conflict with the current operation. Retrying with the same Idempotency-Key replays the original receipt.
Requires operations:cancel. Project tokens only access resources in their own project.
curl --request POST \
--url https://api.polymorfa.com/platform/operations/{operationId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.polymorfa.com/platform/operations/{operationId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/operations/{operationId}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/operations/{operationId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"data": {
"operation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "auth_projection_repair",
"resource": {
"type": "<string>",
"id": "<string>"
},
"status": "pending",
"sequence": 2,
"capabilities": {
"cancellable": true,
"watchable": true
},
"progress": {
"code": "<string>",
"current": 123,
"total": 123
},
"result": null,
"error": {
"code": "<string>",
"retryable": true,
"details": {}
},
"actionRequired": {
"code": "<string>",
"details": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
},
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"replayed": true,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": "operation_conflict",
"code": "operation_conflict",
"operation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "auth_projection_repair",
"resource": {
"type": "<string>",
"id": "<string>"
},
"status": "pending",
"sequence": 2,
"capabilities": {
"cancellable": true,
"watchable": true
},
"progress": {
"code": "<string>",
"current": 123,
"total": 123
},
"result": null,
"error": {
"code": "<string>",
"retryable": true,
"details": {}
},
"actionRequired": {
"code": "<string>",
"details": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}Authorizations
Send your team API key or project token as Authorization: Bearer <token>. The credential must have the required permissions. Project tokens can access only their own project.
Headers
Specifies idempotency key for this header parameter.
Value constraints
| Constraint | Accepted input |
|---|---|
| String length | 1 through 255 characters |
1 - 255Path Parameters
Identifier used to retrieve the asynchronous operation.
Value constraints
| Constraint | Accepted input |
|---|---|
| Format | uuid |
Response
Success
Structured data carried by this object.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.polymorfa.com/platform/operations/{operationId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.polymorfa.com/platform/operations/{operationId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/platform/operations/{operationId}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polymorfa.com/platform/operations/{operationId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}false{
"data": {
"operation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "auth_projection_repair",
"resource": {
"type": "<string>",
"id": "<string>"
},
"status": "pending",
"sequence": 2,
"capabilities": {
"cancellable": true,
"watchable": true
},
"progress": {
"code": "<string>",
"current": 123,
"total": 123
},
"result": null,
"error": {
"code": "<string>",
"retryable": true,
"details": {}
},
"actionRequired": {
"code": "<string>",
"details": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
},
"operationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "<string>",
"replayed": true,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"request_id": "<string>",
"request_log_url": "<string>"
},
"data": null,
"docs": "<string>"
}{
"error": "operation_conflict",
"code": "operation_conflict",
"operation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "auth_projection_repair",
"resource": {
"type": "<string>",
"id": "<string>"
},
"status": "pending",
"sequence": 2,
"capabilities": {
"cancellable": true,
"watchable": true
},
"progress": {
"code": "<string>",
"current": 123,
"total": 123
},
"result": null,
"error": {
"code": "<string>",
"retryable": true,
"details": {}
},
"actionRequired": {
"code": "<string>",
"details": {}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}