Cancel an assessment workflow
Learn how to cancel the workflow instance associated with an existing assessment using the API.
Use the POST /assessments/{assessment_id}/cancel-workflow endpoint when an assessment is no longer needed, for example, if it was created in error, or must be terminated due to a change in business context.
Each assessment has a single workflow instance. Canceling the workflow is done at the assessment level; no workflow ID is required.
After a workflow is canceled, no additional workflow steps are run, and the assessment is treated as inactive. Existing assessment data is preserved. The assessment outcome is set to the canceled outcome defined in the assessment template. Learn more about the assessment lifecycle.
Request
To cancel an assessment workflow, send a POST request to the /assessments/{assessment_id}/cancel-workflow endpoint.
The following example cancels the workflow instance associated with an assessment with ID 497f6eca-6276-4993-bfeb-53cbbbba6f08:
curl --request "POST" \
"https://{api_region}/v5/assessments/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel-workflow" \
--header "apikey: API_KEY"Replace {api_region} with the domain from your region's base URL.
To authenticate your request, include the apikey: YOUR_API_KEY header. See Manage API keys for more information.
Response
This endpoint doesn't return a response body. A response code 204 No Content indicates that the assessment workflow was successfully canceled.
To confirm the updated status, retrieve the assessment details using the Get an assessment by ID endpoint. The workflow_state returned should be Cancelled.
Troubleshooting
If you receive a 401 Unauthorized response, make sure the
apikeyheader is included and contains a valid key. Check that you are using the correct base URL for your region, and if IP allow listing is enabled, verify your request originates from an allowed IP address.A response of
404 Not Foundindicates that no assessment with the supplied ID was found. Use the List all assessments endpoint to find the assessment and verify its ID.
For a full list of the possible error codes, view the API reference.