POST /api/v1/query
Use Query API V1 to query Data Cloud data lake across data model, data lake, unified, and linked objects.
- HTTP Method: POST
- Availability: Data Cloud v1.0, Salesforce v51.0
- format: REST
- URI:
/api/v1/query
Parameter | Type | Description |
---|---|---|
limit | integer | Maximum number of records to return. Default: 49,999. Example: 10 |
offset | integer | Number of records to skip before returning results. Example: 100 |
orderby | string | Comma-separated values to sort the results in ascending or descending order. Example: GenderId__c ASC, Occupation__c DESC |
The request body must contain a JSON object with these fields:
Field Name | Field Type | Description |
---|---|---|
sql | string | The SQL query to execute. Must be a valid ANSI standard SQL query. |
The response includes:
data
: Array of record objects containing the requested datastartTime
: ISO 8601 timestamp indicating when the query started executingendTime
: ISO 8601 timestamp indicating when the query finished executingrowCount
: Number of rows returned by the queryqueryId
: Unique identifier for the querydone
: boolean indicating if all results have been returnedmetadata
: Object containing metadata about the fields in the result set
The metadata object contains information about each field on the result set:
Field Name | Field Type | Description |
---|---|---|
type | string | SQL data type of the field |
placeInOrder | integer | Position of the field on the result set |
typeCode | integer | Numeric code representing the SQL data type |
- The maximum number of rows returned is 49,999
- Use the
done
flag to determine if more results are available - When
done
is false, use theorderby
parameter withoffset
to retrieve the next set of records - The API supports ANSI standard SQL queries
- All queries are executed synchronously
- The API supports pagination via
limit
andoffset
parameters