# 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"}}}}}}
```
