# Get Google Sheet grant metadata

Return bounded sheet and grid metadata without provider file identifiers.

## Endpoint

`GET /api/v1/workspaces/{workspace_id}/google-sheets/grants/{grant_id}/metadata`

## Authentication

| Class | Authentication | Minimum role | API key |
| --- | --- | --- | --- |
| dashboard-session-api | Dashboard session cookie; POST mutations also require X-CX-Request: 1. | admin | Not allowed |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | path | `string` | Yes | — |
| `grant_id` | path | `string` | Yes | — |

## Request body

This operation has no request body.

## Example

```bash
curl --request GET 'https://operade.ai/api/v1/workspaces/ws_demo/google-sheets/grants/gsgrant_example/metadata' --cookie 'cx_session=YOUR_SESSION_COOKIE'
```

## Responses

| Status | Description | Content |
| --- | --- | --- |
| 4XX | Handled client error | application/json: `ErrorResponse` |
| 200 | Successful Response | application/json: `GoogleSheetMetadataResponse` |

### 4XX application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | ErrorResponse | — | No | Yes | — | — |
| `error` | `object` | ErrorItem | — | No | Yes | — | — |
| `error.code` | `string` | — | — | No | Yes | — | — |
| `error.details` | `object` | — | — | No | No | — | — |
| `error.message` | `string` | — | — | No | Yes | — | — |

### 200 application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | GoogleSheetMetadataResponse | — | No | Yes | — | — |
| `grant_id` | `string` | — | — | No | Yes | — | — |
| `sheets` | `array<GoogleSheetTabMetadata>` | — | — | No | Yes | — | — |
| `sheets[]` | `object` | GoogleSheetTabMetadata | — | No | Yes | — | — |
| `sheets[].column_count` | `integer` | — | — | No | Yes | — | — |
| `sheets[].row_count` | `integer` | — | — | No | Yes | — | — |
| `sheets[].sheet_id` | `integer` | — | — | No | Yes | — | — |
| `sheets[].title` | `string` | — | — | No | Yes | — | — |
| `spreadsheet_name` | `string` | — | — | No | Yes | — | — |

### Response example

```json
{
  "grant_id": "gsgrant_example",
  "spreadsheet_name": "Customers",
  "sheets": [
    {
      "sheet_id": 0,
      "title": "Customers",
      "row_count": 100,
      "column_count": 4
    }
  ]
}
```

## Errors

Reviewed common and route-declared errors are summarized here; the list is not exhaustive. Start with the [distributed error index](/docs/reference/api/errors) to find each code's canonical domain page.

| Status | Code | Description |
| --- | --- | --- |
| 401 | `unauthenticated` | Authentication is missing, invalid, or revoked. |
| 403 | `forbidden` | Only a workspace admin or owner can inspect Google metadata. |
| 404 | `not_found` | The requested spreadsheet grant was not found. |
| 409 | `google_file_unavailable` | The selected spreadsheet or connection is unavailable. |
| 502 | `google_response_too_large` | The spreadsheet metadata exceeds the supported bound. |
| 502 | `google_unavailable` | Google Sheets is temporarily unavailable. |
| 503 | `google_integration_not_configured` | The Google Sheets integration is disabled or incomplete. |

## Related operations

- [Complete Google Sheets OAuth](/docs/api-reference/google-sheets/complete-google-sheets-oauth) — `GET /api/v1/oauth/google-sheets/callback`
- [List Google Sheets connections](/docs/api-reference/google-sheets/list-google-sheets-connections) — `GET /api/v1/workspaces/{workspace_id}/google-sheets/connections`
- [Revoke a Google Sheets connection](/docs/api-reference/google-sheets/revoke-google-sheets-connection) — `POST /api/v1/workspaces/{workspace_id}/google-sheets/connections/{connection_id}/revoke`
