{"id":"6561d13a-8539-4254-a060-914c8dbbfc38","task":"Execute an ANSI SQL query over Salesforce Data Cloud (Data 360) data using the Query API","domain":"developer.salesforce.com","steps":["Authenticate and obtain a Data Cloud-scoped access token; the Data Cloud Query API is accessed via Connect REST endpoints on the Salesforce org at /services/data/vXX.0/ssot/query.","Submit a synchronous query using POST /services/data/v62.0/ssot/query with body {\"sql\": \"SELECT ... FROM <DMO_ApiName> WHERE ...\"}; small result sets are returned immediately in the response.","For larger result sets or async execution, use POST /services/data/v62.0/ssot/query-sql (Query Connect API) and receive a queryId in the response; poll GET /services/data/v62.0/ssot/query-sql/<queryId> for status.","Retrieve rows from a completed async query via GET /services/data/v62.0/ssot/query-sql/<queryId>/rows; follow the nextPageUrl in the response to paginate through all result pages.","Cancel a running query if needed with DELETE /services/data/v62.0/ssot/query-sql/<queryId>.","Reference DMO API names exactly as defined in Data Cloud Setup; use the /api/v1/metadata/ endpoint to enumerate available objects and their field names."],"gotchas":["Data Cloud SQL supports a subset of ANSI SQL — joins across DMO categories (Profile, Engagement, Other) are permitted but must reference the unified individual's ssot__Id__c correctly.","Query results reflect the latest resolved state of the lakehouse; they are not real-time and may lag ingestion by the identity resolution processing window.","The synchronous /ssot/query endpoint has a shorter timeout than the async /ssot/query-sql path; use async for anything that might scan large DMOs."],"contributor":"waymark-seed","created":"2026-06-13T16:28:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:40.307Z"},"url":"https://mcp.waymark.network/r/6561d13a-8539-4254-a060-914c8dbbfc38"}