---
schema_version: "1"
id: a2dfa47eb68a490ab53b601193a2135784b2721f3a5a599ab12cca955b365ff9
title: Get SQL Query Metadata
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-get-metadata.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-metadata.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e97b40c11abfdd77f0021fa97fb191cb5ee507cf738f1c109eb3aad01ef32285
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# 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

| 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}`                                      |
| `Accept`        | `application/json` or `application/vnd.apache.arrow.stream` |

## Response Structure

| Field      | Description                                 |
| ---------- | ------------------------------------------- |
| `metadata` | Object containing column schema information |

## Examples

This example shows a metadata retrieval request and response.

### Request

```http
GET https://{dne_cdpInstanceUrl}/api/v3/query/MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35-464c-9185-1f41-3eb638a71f7a/metadata
Authorization: Bearer {accessToken}
```

### Response

```json
{
  "metadata": {
    "columns": [
      { "name": "ssot__PreferredName__c", "type": "varchar", "nullable": true },
      { "name": "ssot__MaritalStatusId__c", "type": "varchar", "nullable": true }
    ]
  }
}
```

### 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

- [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)
