# Cancel

If an image processing job is no longer needed or was started in error, you can cancel it before it completes. The job must be in a cancellable state (e.g., not already completed or failed) for the request to be successful.

## Cancel

> Cancel a pending image processing job. If the job has already completed, or if it is not in a cancellable state, this request will fail with a conflict error. Use this to prevent unnecessary costs for jobs started in error.<br>

```json
{"openapi":"3.1.2","info":{"title":"Image API","version":"1.2.0"},"tags":[{"name":"Cancel","description":"If an image processing job is no longer needed or was started in error, you can cancel it before it completes. The job must be in a cancellable state (e.g., not already completed or failed) for the request to be successful.\n"}],"servers":[{"url":"https://api.topazlabs.com/image/v1","description":"Production Base URL"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Authentication via the Topaz generated key in the `X-API-Key` header.\n"}},"responses":{"BadRequestProcess":{"description":"The request contains malformed data in the body, path, or query parameters.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Unauthorized":{"description":"Authentication is required and has failed or has not yet been provided.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Forbidden":{"description":"The API key doesn't have permissions to perform the request.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"NotFound":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"Conflict":{"description":"The request conflicts with the current state.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"TooManyRequests":{"description":"Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}},"InternalServerError":{"description":"Unexpected error on our end.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"code":{"type":"integer","description":"The HTTP status code."},"message":{"type":"string","description":"A human readable error message."}}}}}}}},"paths":{"/cancel/{process_id}":{"delete":{"tags":["Cancel"],"summary":"Cancel","operationId":"cancelTask","description":"Cancel a pending image processing job. If the job has already completed, or if it is not in a cancellable state, this request will fail with a conflict error. Use this to prevent unnecessary costs for jobs started in error.\n","parameters":[{"name":"process_id","in":"path","required":true,"description":"The UUID of the image processing job.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"The image processing job was successfully cancelled. No content returned."},"400":{"$ref":"#/components/responses/BadRequestProcess"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.topazlabs.com/reference/api-endpoints/image/cancel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
