# Cancel / Clear data from a previously run query `CancelQuery` `DELETE /api/SqlBackground/{executionId}` - [OpenAPI fragment](https://www.lusid.com/docs/api/luminesce/endpoints/sql-background-execution/CancelQuery.json) - [Rendered page](https://www.lusid.com/docs/api/luminesce/endpoints/sql-background-execution/CancelQuery) Cancel the query (if still running) / clear the data (if already returned) The following error codes are to be anticipated with standard Problem Detail reports: 401 Unauthorized 403 Forbidden 404 Not Found : The requested query result doesn't exist and is not running or the calling user did not run the query. ## Referenced schemas - [BackgroundQueryCancelResponse](https://www.lusid.com/docs/api/luminesce/schemas/BackgroundQueryCancelResponse.txt) [< Sql Background Execution](https://www.lusid.com/docs/api/luminesce/endpoints/sql-background-execution/llms.txt)