Get SQL Query Metadata

Use the GET /api/v3/query/{queryId}/metadata endpoint of the Data 360 Query API to retrieve the output schema for a completed query without fetching data rows. Use this endpoint to inspect column names, types, and nullability before retrieving a large result set, or to validate query output structure in your integration.

Syntax 

  • HTTP Method: GET
  • Format: REST
  • URI: /api/v3/query/{queryId}/metadata

Path Parameters 

ParameterTypeDescription
queryIdstringRequired. The unique identifier of the query returned from POST /api/v3/query. Example: MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35.

Request Headers 

HeaderValue
AuthorizationBearer {accessToken}
Acceptapplication/json or application/vnd.apache.arrow.stream

Response Structure 

FieldDescription
metadataObject containing column schema information

Examples 

This example shows a metadata retrieval request and response.

Request 

1GET https://{dne_cdpInstanceUrl}/api/v3/query/MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35-464c-9185-1f41-3eb638a71f7a/metadata
2Authorization: Bearer {accessToken}

Response 

1{
2  "metadata": {
3    "columns": [
4      { "name": "ssot__PreferredName__c", "type": "varchar", "nullable": true },
5      { "name": "ssot__MaritalStatusId__c", "type": "varchar", "nullable": true }
6    ]
7  }
8}

Apache Arrow Response 

Set Accept: application/vnd.apache.arrow.stream to receive the Arrow schema as a binary IPC stream.

Notes 

  • This endpoint returns the schema only and does not return data rows.
  • Does not support waitFor query parameters.
  • Does not return query info in response headers.

Related Resources