Cancel an operation
POST/v1/operations/:operation_id/cancel
Ask the platform to cancel an operation your bank initiated.
Required scope: connector:operations:cancel.
The cancellation is itself an operation. This call returns 202 Accepted with a new
operation (operation_type OPERATION_CANCEL, resource_family operations) whose
relationships.resource points at the target. Poll that new operation to learn the
result:
| Cancellation operation ends in | Meaning |
|---|---|
SUCCEEDED | The target was cancelled; it is now CANCELLED and any open reviews on it are closed. |
REJECTED with result_code CANCEL_NOT_ALLOWED | The target could not be cancelled: it is already in a final state (or MANUAL_REVIEW), a ledger transaction for it was already submitted, or another cancellation was already requested. The target is unchanged. |
An operation can be cancelled only while it is ACCEPTED, PROCESSING,
PENDING_REVIEW, PENDING_COMMITS or AWAITING_SCREENING and none of its ledger
transactions has been submitted yet. Once the first ledger transaction is submitted, the
operation can no longer be cancelled and completes under normal processing. A transfer
reaches PENDING_REVIEW only after its first ledger transaction has been submitted, so
a transfer waiting for review cannot be cancelled; a reviewer can reject it instead
(it then ends REJECTED with result_code CHECKER_REJECTED).
These problems are reported directly by this call instead of through a cancellation operation:
400 Bad Requestifoperation_idis not a UUID, an attribute is blank, orexpected_target_statedoes not match the target's current state;404 Not Foundif the target operation does not exist;401 Unauthorizedif the target operation belongs to another bank.
Send an Idempotency-Key. Because the key is compared on the request body only, use a
new key for each target operation.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 409
- 415
- 422
- 503
Cancellation accepted for processing. data.id is the id of the new cancellation
operation, not of the target. Poll it with GET /v1/operations/{operation_id}.
Replaying the same Idempotency-Key with the same body returns this document
again.
The request is malformed, or expected_target_state does not match the target
operation's current state.
The bearer token is missing, malformed, expired, signed by an unknown key, or was not issued by the platform IAM for the Lyriq Connector. Obtain a new token and retry. See the Authentication section.
The token is valid but may not perform this request: it lacks the required scope, has
no bank membership, needs an x-dan-bank-id header to choose between several
memberships, names a bank in x-dan-bank-id it has no membership for, or the caller's
bank is suspended or terminated. A new token with the same configuration fails the same
way. See the Authentication section.
The target operation does not exist.
The request conflicts with an earlier request or with the current state of the target:
an Idempotency-Key reused with a different body (IDEMPOTENCY_CONFLICT), a request with
the same key still in progress (IDEMPOTENCY_PENDING), or a target resource in a state
that does not allow the request (STATE_CONFLICT).
The Content-Type header is not exactly application/vnd.api+json.
The request is well-formed JSON but cannot be processed: the body does not match the
expected shape (a missing or unknown member, a wrong type, or a wrong data.type), or it
breaks a business or cross-field rule. Correct the request before retrying.
The request could not be served right now. Either the network is not fully operational
(OUTBOUND_HALTED or READ_ONLY: mutations are refused while read endpoints keep
working; OPERATIONAL_STATE_UNKNOWN: the state could not be determined), or a platform
dependency is temporarily unavailable. No Retry-After header is sent; retry later with
backoff. When retrying a mutation, reuse the same Idempotency-Key and body.