# API as destination · REST API

> API as a destination turns a workflow's output into a live, read-only JSON feed at a private URL.

HTML version: https://developers.sheetgo.com/api/api-destination/

[Developers](/index.md) › [REST API](/api.md) › [Forms & Integrations](/api.md#api-endpoints)

REST API · 2 endpoints

## API as destination

**Complete for this group.** Each operation below lists its parameters, request body, responses and errors. Every model they use is documented under [Models used on this page](#models), so you do not need another page to build a request. Base URL `https://api.sheetgo.com`; paths are complete, version included (`/rest/beta/…`): append them to the base URL exactly as shown; send `Authorization: Bearer sg_…`. Also in the API's own docs: <https://api.sheetgo.com/rest/reference/api-destination> ([Markdown](https://api.sheetgo.com/rest/reference/api-destination.md)).

**Conventions for every endpoint.** Lists take `page` (from 1) and `per_page` (1-100, default 50), and `total` counts **pages**, not items. Collection URLs end with `/`. `POST …/run` returns `200` when the run is *queued*; poll `GET …/run`. Google Sheets use `provider: "drive"`; column fields take letters (`"E"`). Error bodies and status codes: [REST API › Errors](/api.md#api-errors).

**Python recipes.** [API client helper](/examples.md#recipe-sheetgo-api).

**API as a destination** turns a workflow's output into a live, read-only JSON feed at a private URL. Each workflow run refreshes the data; consumers fetch it on demand with an API key, with pagination, sorting and conditional (ETag) requests.

Use these endpoints to **read** the published data (`GET`) or **inspect** its metadata without downloading it (`HEAD`).

> **`filter` is reserved and does not work yet.** The `GET` endpoint accepts a `filter` query parameter, but it is a placeholder for a future version: the value is ignored and the **full, unfiltered** dataset is returned, with no error and no warning. It exists so a future filter-aware client can call today's server without failing outright. Until filtering ships, narrow the data in the automation itself or filter client-side — never rely on `filter` to scope what a caller receives.

## Operations

#### GET `/rest/beta/api-destination/{public_id}` — Read data from an API-as-Destination endpoint

Reads the rows a workflow published through its `api` destination. Each workflow run refreshes the data; this endpoint serves whatever the last run produced.

Supports pagination (`page`, `page_size`), sorting (`order_by`, `direction`), a single-tab filter (`tab`) and two output shapes (`format`). Responses carry `ETag` and `Last-Modified`, so a conditional request with `If-None-Match` gets a **304** and no body — use it when polling.

Before the workflow's first run the endpoint exists but has no data, and answers 200 with an empty result rather than a 404.

Requires an API key with **both** the `automations` and `api-destination` scopes.

##### Parameters

| Name | In | Type |  | Description |
| --- | --- | --- | --- | --- |
| `public_id` | path | string | required | The destination's public identifier, returned when the automation's `api` destination was created. It is stable across updates to the automation. |
| `format` | query | string | optional | Response format: 'dict' or 'array' Default: `"dict"` |
| `page` | query | integer | optional | Page number (1-based) Default: `1` · Min: `1` |
| `page_size` | query | integer | optional | Rows per page (1–1000; > 1000 is clamped to 1000) Default: `100` |
| `order_by` | query | string | optional | Column name to sort by |
| `direction` | query | one of `"asc"`, `"desc"` | optional | Sort direction Default: `"asc"` |
| `filter` | query | string | optional | **Reserved for a future version — NOT IMPLEMENTED today.** The parameter is accepted so that a future filter-aware client can call this endpoint without a hard failure, but it has no effect: the value is ignored and the **full, unfiltered** dataset is returned. Do not use it to scope a response — filter client-side, or narrow the data in the automation itself. This description will change when filtering ships. |
| `tab` | query | string | optional | Return only this source tab (by name); omit for all tabs |

##### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | Data served (or empty-state pre-publish) | any |
| 304 | Not modified — ETag or Last-Modified matched | — |
| 400 | Invalid query params | — |
| 401 | Auth failed | — |
| 404 | Destination missing / deleted / unbound | — |
| 422 | Validation Error | [`HTTPValidationError`](#model-HTTPValidationError) |
| 500 | Internal error | — |

##### Example request

```
curl -s -X GET "https://api.sheetgo.com/rest/beta/api-destination/PUBLIC_ID" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
```

In the API's own docs: <https://api.sheetgo.com/rest/reference/api-destination#get-rest-beta-api-destination-public-id>

#### HEAD `/rest/beta/api-destination/{public_id}` — Inspect API-as-Destination metadata without downloading data

Same as the `GET`, but returns headers only — use it to check whether the data changed before paying for the body.

Carries the same `ETag` and `Last-Modified` as the `GET`, plus `X-Sheetgo-*` headers describing the row count and columns.

##### Parameters

| Name | In | Type |  | Description |
| --- | --- | --- | --- | --- |
| `public_id` | path | string | required | The destination's public identifier, returned when the automation's `api` destination was created. It is stable across updates to the automation. |

##### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| 200 | Headers populated (or empty-state if pre-publish) | any |
| 401 | Auth failed | — |
| 404 | Destination missing / deleted / unbound | — |
| 422 | Validation Error | [`HTTPValidationError`](#model-HTTPValidationError) |
| 500 | Internal error | — |

##### Example request

```
curl -s -X HEAD "https://api.sheetgo.com/rest/beta/api-destination/PUBLIC_ID" \
  -H "Authorization: Bearer $SHEETGO_API_KEY"
```

In the API's own docs: <https://api.sheetgo.com/rest/reference/api-destination#head-rest-beta-api-destination-public-id>

## Models used on this page

Every request and response model referenced above, including nested ones (2). The full catalogue is on the [Models](/api/models.md) page.

#### `HTTPValidationError`

| Field | Type |  | Description |
| --- | --- | --- | --- |
| `detail` | array of [`ValidationError`](#model-ValidationError) | optional |  |

Used by: [GET /rest/beta/workflows/](/api/workflows.md#get-rest-beta-workflows), [POST /rest/beta/workflows/](/api/workflows.md#post-rest-beta-workflows), [POST /rest/beta/workflows/run/{id}](/api/workflows.md#post-rest-beta-workflows-run-id), [GET /rest/beta/workflows/{id}](/api/workflows.md#get-rest-beta-workflows-id), [PATCH /rest/beta/workflows/{id}](/api/workflows.md#patch-rest-beta-workflows-id), [DELETE /rest/beta/workflows/{id}](/api/workflows.md#delete-rest-beta-workflows-id), [GET /rest/beta/workflows/{id}/collaborators](/api/workflows.md#get-rest-beta-workflows-id-collaborators), [POST /rest/beta/workflows/{id}/collaborators](/api/workflows.md#post-rest-beta-workflows-id-collaborators), [DELETE /rest/beta/workflows/{id}/collaborators](/api/workflows.md#delete-rest-beta-workflows-id-collaborators), [PATCH /rest/beta/workflows/{id}/collaborators/{email}](/api/workflows.md#patch-rest-beta-workflows-id-collaborators-email), [DELETE /rest/beta/workflows/{id}/collaborators/{email}](/api/workflows.md#delete-rest-beta-workflows-id-collaborators-email), [GET /rest/beta/workflows/{id}/destinations](/api/workflows.md#get-rest-beta-workflows-id-destinations), [GET /rest/beta/workflows/{id}/files](/api/workflows.md#get-rest-beta-workflows-id-files), [GET /rest/beta/workflows/{id}/general-access](/api/workflows.md#get-rest-beta-workflows-id-general-access), [PUT /rest/beta/workflows/{id}/general-access](/api/workflows.md#put-rest-beta-workflows-id-general-access), [DELETE /rest/beta/workflows/{id}/general-access](/api/workflows.md#delete-rest-beta-workflows-id-general-access), [POST /rest/beta/workflows/{id}/leave](/api/workflows.md#post-rest-beta-workflows-id-leave), [POST /rest/beta/workflows/{id}/request-access](/api/workflows.md#post-rest-beta-workflows-id-request-access), [GET /rest/beta/workflows/{id}/run](/api/workflows.md#get-rest-beta-workflows-id-run), [POST /rest/beta/workflows/{id}/run](/api/workflows.md#post-rest-beta-workflows-id-run), [GET /rest/beta/workflows/{id}/sources](/api/workflows.md#get-rest-beta-workflows-id-sources), [GET /rest/beta/automations/](/api/automations.md#get-rest-beta-automations), [POST /rest/beta/automations/run/{id}](/api/automations.md#post-rest-beta-automations-run-id), [GET /rest/beta/automations/{id}](/api/automations.md#get-rest-beta-automations-id), [DELETE /rest/beta/automations/{id}](/api/automations.md#delete-rest-beta-automations-id), [GET /rest/beta/automations/{id}/destinations](/api/automations.md#get-rest-beta-automations-id-destinations), [GET /rest/beta/automations/{id}/files](/api/automations.md#get-rest-beta-automations-id-files), [GET /rest/beta/automations/{id}/run](/api/automations.md#get-rest-beta-automations-id-run), [POST /rest/beta/automations/{id}/run](/api/automations.md#post-rest-beta-automations-id-run), [GET /rest/beta/automations/{id}/sources](/api/automations.md#get-rest-beta-automations-id-sources), [GET /rest/beta/workflows/{id}/trigger](/api/triggers.md#get-rest-beta-workflows-id-trigger), [DELETE /rest/beta/workflows/{id}/trigger](/api/triggers.md#delete-rest-beta-workflows-id-trigger), [GET /rest/beta/workflows/{id}/dashboard](/api/dashboards.md#get-rest-beta-workflows-id-dashboard), [DELETE /rest/beta/workflows/{id}/dashboard/elements/{element\_id}](/api/dashboards.md#delete-rest-beta-workflows-id-dashboard-elements-element-id), [GET /rest/beta/workflows/{id}/dashboard/elements/{element\_id}/data](/api/dashboards.md#get-rest-beta-workflows-id-dashboard-elements-element-id-data), [PUT /rest/beta/workflows/{id}/dashboard/publish](/api/dashboards.md#put-rest-beta-workflows-id-dashboard-publish), [GET /rest/beta/workflows/{workflow\_id}/forms/](/api/forms.md#get-rest-beta-workflows-workflow-id-forms), [POST /rest/beta/workflows/{workflow\_id}/forms/](/api/forms.md#post-rest-beta-workflows-workflow-id-forms), [GET /rest/beta/workflows/{workflow\_id}/forms/{form\_id}](/api/forms.md#get-rest-beta-workflows-workflow-id-forms-form-id), [PATCH /rest/beta/workflows/{workflow\_id}/forms/{form\_id}](/api/forms.md#patch-rest-beta-workflows-workflow-id-forms-form-id), [DELETE /rest/beta/workflows/{workflow\_id}/forms/{form\_id}](/api/forms.md#delete-rest-beta-workflows-workflow-id-forms-form-id), [GET /rest/beta/workflows/{workflow\_id}/forms/{form\_id}/responses](/api/forms.md#get-rest-beta-workflows-workflow-id-forms-form-id-responses), [HEAD /rest/beta/workflows/{workflow\_id}/forms/{form\_id}/responses](/api/forms.md#head-rest-beta-workflows-workflow-id-forms-form-id-responses), [GET /rest/beta/automations/{automation\_id}/webhook](/api/webhook.md#get-rest-beta-automations-automation-id-webhook), [GET /rest/beta/workflows/{workflow\_id}/webhooks](/api/webhook.md#get-rest-beta-workflows-workflow-id-webhooks), [GET /rest/beta/api-destination/{public\_id}](/api/api-destination.md#get-rest-beta-api-destination-public-id), [HEAD /rest/beta/api-destination/{public\_id}](/api/api-destination.md#head-rest-beta-api-destination-public-id), [GET /rest/beta/integrations/{provider}/options](/api/integrations.md#get-rest-beta-integrations-provider-options), [GET /rest/beta/outlook/messages](/api/outlook.md#get-rest-beta-outlook-messages), [POST /rest/beta/outlook/messages/batch](/api/outlook.md#post-rest-beta-outlook-messages-batch), [GET /rest/beta/outlook/messages/{message\_id}](/api/outlook.md#get-rest-beta-outlook-messages-message-id), [GET /rest/beta/outlook/messages/{message\_id}/attachments/{attachment\_id}](/api/outlook.md#get-rest-beta-outlook-messages-message-id-attachments-attachment-id), [POST /rest/beta/outlook/send](/api/outlook.md#post-rest-beta-outlook-send), [GET /rest/beta/gmail/messages](/api/gmail.md#get-rest-beta-gmail-messages), [POST /rest/beta/gmail/messages/batch](/api/gmail.md#post-rest-beta-gmail-messages-batch), [GET /rest/beta/gmail/messages/{message\_id}](/api/gmail.md#get-rest-beta-gmail-messages-message-id), [GET /rest/beta/gmail/messages/{message\_id}/attachments/{attachment\_id}](/api/gmail.md#get-rest-beta-gmail-messages-message-id-attachments-attachment-id), [POST /rest/beta/gmail/send](/api/gmail.md#post-rest-beta-gmail-send), [GET /rest/beta/files/{provider}](/api/files.md#get-rest-beta-files-provider), [GET /rest/beta/files/{provider}/roots](/api/files.md#get-rest-beta-files-provider-roots), [GET /rest/beta/files/{provider}/search](/api/files.md#get-rest-beta-files-provider-search), [GET /rest/beta/files/{provider}/{file\_id}](/api/files.md#get-rest-beta-files-provider-file-id), [GET /rest/beta/bigquery/projects](/api/bigquery.md#get-rest-beta-bigquery-projects), [GET /rest/beta/bigquery/projects/{project}/datasets](/api/bigquery.md#get-rest-beta-bigquery-projects-project-datasets), [GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables](/api/bigquery.md#get-rest-beta-bigquery-projects-project-datasets-dataset-tables), [GET /rest/beta/bigquery/projects/{project}/datasets/{dataset}/tables/{table}](/api/bigquery.md#get-rest-beta-bigquery-projects-project-datasets-dataset-tables-table), [POST /rest/beta/bigquery/projects/{project}/validate-query](/api/bigquery.md#post-rest-beta-bigquery-projects-project-validate-query), [POST /rest/auth/refresh](/api/auth.md#post-rest-auth-refresh), [POST /rest/auth/token](/api/auth.md#post-rest-auth-token)

#### `ValidationError`

| Field | Type |  | Description |
| --- | --- | --- | --- |
| `loc` | array of string or integer | required |  |
| `msg` | string | required |  |
| `type` | string | required |  |
