---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/data-cloud-query-api-reference/c360a-api-queryservices-overview.md
cuppy_section: docs
cuppy_doc: Z9SR-7ZAC
cuppy_doc_uuid: 58cc0ca6-c810-4a92-98ac-27fc492c5d25
cuppy_permalink: https://cuppy.io/salesforce/d/Z9SR-7ZAC
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/data-cloud-query-api-reference/c360a-api-queryservices-overview
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 3b3c22962649c4e7bcbc7ee9653e08b0b104682568d85b68cf19404457ad04e0
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/c360a-api-queryservices-overview.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## Query Data 360 Data using Query API

Use the Data 360 Query API to execute SQL queries against your Data 360 data using Connect REST endpoints and Apex methods. This API supports Data 360 SQL syntax and is optimized for all Data 360 use cases, from simple data retrieval to complex analytics and integration scenarios.

The Query API enables you to:

*   Execute SQL queries against unified data model, data lake, profile, and engagement objects
*   Process large result sets with built-in pagination
*   Access data through REST endpoints or Apex methods
*   Integrate Data 360 data into external applications and workflows

Choose the method that best fits your integration scenario.

Use the Connect REST API for most integration scenarios. It provides comprehensive features and integrates seamlessly with Salesforce Platform capabilities.

*   [**Submit SQL Query**](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=createSqlQuery)

    *   **POST**`https://{dne_cdpInstanceUrl}/services/data/v64.0/ssot/query-sql`
    *   Execute SQL queries synchronously and asynchronously
    *   Returns query ID for tracking and result retrieval. You can pass this `queryId` to [`result_scan`](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/result-scan.html) to query the cached results in a subsequent SQL statement.

*   [**Get SQL Query Status**](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=getSqlQuery)

    *   **GET**`https://{dne_cdpInstanceUrl}/services/data/v64.0/ssot/query-sql/{queryId}`
    *   Check query execution status and metadata
    *   Monitor progress for long-running queries

*   [**Get SQL Query Rows**](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=getSqlQueryRows)

    *   **GET**`https://{dne_cdpInstanceUrl}/services/data/v64.0/ssot/query-sql/{queryId}/rows`
    *   Retrieve query results with pagination support
    *   Handle large datasets efficiently

*   [**Cancel SQL Query**](https://developer.salesforce.com/docs/data/connectapi/references/spec?meta=cancelSqlQuery)

    *   **DELETE**`https://{dne_cdpInstanceUrl}/services/data/v64.0/ssot/query-sql/{queryId}`
    *   Cancel running queries to free up resources
    *   Useful for query timeout management

The Data 360 REST API is an HTTP interface for executing SQL queries directly against your Data 360 data. It includes improved asynchronous execution, richer schema introspection, and consistent error reporting.

This API uses the `dne_cdpInstanceUrl`, which is separate from your standard Salesforce org URL. See [Data Cloud API (also known as Direct API)](https://developer.salesforce.com/docs/data/data-cloud-dev/guide/custom-app-dev.html#data-cloud-api-also-known-as-direct-api) for instructions on obtaining the instance URL and access token.

*   [**Submit SQL Query**](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-post.html)

    *   **POST**`/api/v3/query`
    *   Execute queries in ASYNC or ADAPTIVE mode
    *   Returns a `queryId` in the `x-hyperdb-status` response header for polling.

*   [**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.html)

    *   **GET**`/api/v3/query/{queryId}`
    *   Poll for query completion status
    *   Returns status, row count, chunk count, and execution statistics.

*   [**Get SQL Query Rows**](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-rows.html)

    *   **GET**`/api/v3/query/{queryId}/rows`
    *   Retrieve results using offset-based pagination.

*   [**Get SQL Query Chunks**](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-chunk.html)

    *   **GET**`/api/v3/query/{queryId}/chunks/{chunkId}`
    *   Retrieve results by chunk ID (preferred for large result sets).

*   [**Get SQL Query Metadata**](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-metadata.html)

    *   **GET**`/api/v3/query/{queryId}/metadata`
    *   Retrieve output schema without fetching data rows.

*   [**Cancel SQL Query**](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-delete.html)

    *   **DELETE**`/api/v3/query/{queryId}`
    *   Cancel a running query and free server resources.

All Data 360 REST API endpoints return JSON by default. [Apache Arrow IPC streaming format](https://arrow.apache.org/docs/format/IPC.html) is also supported as a columnar binary format that reduces payload size and deserialization overhead, making it the better choice for large result sets. These endpoints support Apache Arrow as an alternative to JSON.

*   Submit SQL Query
*   Get SQL Query Rows
*   Get SQL Query Chunks
*   Get SQL Query Metadata.

To request an Arrow response, set the `Accept` header to `application/vnd.apache.arrow.stream`. The response body is a binary Arrow IPC stream rather than JSON. Use an Arrow-compatible client library (such as [PyArrow](https://arrow.apache.org/docs/python/) or the [Apache Arrow Java library](https://arrow.apache.org/docs/java/)) to read the stream.

For server-side integration within your Salesforce org, use Apex methods to query Data 360 data.

The [`sfsqlquery` namespace](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_sfsqlquery.htm) provides object-oriented Apex classes for managing Data 360 SQL query execution with iterators and asynchronous queueables. It includes classes like `SqlStatement`, `SqlRowIterator`, `Row`, `QueryHandle`, and `SqlQueueable` for structured query lifecycle management. This namespace is the recommended approach for querying Data 360 data with Apex.

For workflows and usage patterns, see [Query Data 360 Data with Apex](https://developer.salesforce.com/docs/data/data-cloud-query-guide/guide/dc-apex-query.html).

The `ConnectApi.CdpQuery` class provides Apex methods that mirror the Connect REST API endpoints:

*   [**Submit SQL Query**](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_CdpQuery_static_methods.htm#apex_ConnectAPI_CdpQuery_querySql_1) - Execute SQL queries
*   [**Get SQL Query Status**](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_CdpQuery_static_methods.htm#apex_ConnectAPI_CdpQuery_querySqlStatus_1) - Check query status
*   [**Get SQL Query Rows**](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_CdpQuery_static_methods.htm#apex_ConnectAPI_CdpQuery_querySqlRows_1) - Retrieve paginated results
*   [**Cancel SQL Query**](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_CdpQuery_static_methods.htm#apex_ConnectAPI_CdpQuery_cancelQuerySql_1) - Cancel running queries

Authentication requirements vary by access method.

See [OAuth 2.0 Client Credentials Flow for Server-to-Server Integration](https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_client_credentials_flow.htm&type=5) in Salesforce Help. All REST API calls require a valid OAuth 2.0 access token:

Apex methods use the current user’s session context and permissions automatically. See [Getting Started with Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_intro_get_started.htm) in the Apex Developer Guide.

*   **Filter early**: Use WHERE clauses to reduce data scanned
*   **Select specific columns**: Avoid `SELECT *` statements
*   **Limit results**: Use `LIMIT` for large datasets
*   **Optimize joins**: Include key qualifiers and proper indexing
*   **Consider your data’s indexed field**: Use the DMO’s primary index, or create a [secondary index](https://help.salesforce.com/s/articleView?language=en_US&id=data.c360_a_query_secondary_indexes.htm&type=5) for non-primary fields that you filter or join on frequently.
*   **Implement asynchronous handling**: Data 360 queries use both asynchronous and synchronous responses to optimize performance. Set up your application to handle both synchronous and asynchronous responses.
*   **Paginate result sets**: Use the Connect API `getSqlQueryRows` endpoint with `offset` and `rowLimit`. You can query your `createSqlQuery` results for 24 hours without incurring more consumption charges. Because Data 360 stores results, `getSqlQueryRows` returns data faster than calls to `createSqlQuery`.

Include key qualifier fields in table joins for optimal performance:

When key qualifiers aren’t configured on data lake object fields, the value is null. Use `IS NOT DISTINCT FROM` for null-safe joins.

*   [Query Services Status Codes](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/c360a-api-queryservices-statuscodes.html) - Error handling reference
*   [Get Started With Data 360 SQL](https://developer.salesforce.com/docs/data/data-cloud-query-guide/guide/dc-query-section.html) - SQL tutorial and examples
*   [Data 360 Metadata API](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/c360a-api-metadata-api.html) - Explore available data objects
*   [API Limits and Guidelines](https://help.salesforce.com/s/articleView?id=data.c360_a_limits_and_guidelines.htm&type=5) - Usage limits and best practices
*   [_Salesforce Developers Blog:_ Boost Data 360 Integrations with the New Query Connect API](https://developer.salesforce.com/blogs/2025/08/boost-data-cloud-integrations-with-the-new-query-connect-api)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
