---
schema_version: "1"
id: 6509099d5af9969af19b7bfa0f9e0903b50d5400174116cb6fce58bd00df513a
title: Cancel SQL Query
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-query-api-reference/query-services/query-api-v3-delete.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-delete.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e67df0dc19a4efb80ebaf9cee109972c4b21abe110343733f92ffa251888ae78
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# Cancel SQL Query

Use the `DELETE /api/v3/query/{queryId}` endpoint of the Data 360 Query API to cancel a running query and release its associated server resources. This operation is idempotent — repeated calls for the same query ID always return `204 No Content` with no additional effect. Use this endpoint to free resources when a query is no longer needed or has exceeded an acceptable runtime.

## Syntax

- **HTTP Method**: DELETE
- **Format**: REST
- **URI**: `/api/v3/query/{queryId}`

## Path Parameters

| Parameter | Type   | Description                                                                                                                   |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `queryId` | string | Required. The unique identifier of the query returned from `POST /api/v3/query`. Example: `MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35`. |

## Request Headers

| Header          | Value                               |
| --------------- | ----------------------------------- |
| `Authorization` | `Bearer {accessToken}` or C2C token |

## Response Structure

Always returns `204 No Content`.

## Examples

### Request

```http
DELETE https://{dne_cdpInstanceUrl}/api/v3/query/MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35-464c-9185-1f41-3eb638a71f7a
Authorization: Bearer {accessToken}
```

### Response

```
204 No Content
```

## Related Resources

- [Submit SQL Query](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-post.md)
- [Get SQL Query Status](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-query.md)
- [Query Services Status Codes](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/c360a-api-queryservices-statuscodes.md)
