# SourceAPI

Request an HTTP endpoint and use the JSON it returns as source data.

Cannot be combined with file, folder or webhook sources — see
validate_api_automation.

Type: object

Fields typed as another model are documented on that model's page; fetch it before filling the field.

| Field | Type | Required | Description | Allowed values / default / constraints |
| --- | --- | --- | --- | --- |
| `type` | string | yes | Marks this source as an **API request**: Sheetgo calls your endpoint and turns the response into rows. Cannot be combined with file, folder or webhook sources. | const: `"api"` |
| `endpoint` | string | yes | URL to request. Supports `{{Tab!Ref}}` cell references — see the Cell References section. |  |
| `method` | string | no | HTTP method. Only GET and POST can read data. | one of: `"get"`, `"post"`; default: `"get"` |
| `headers` | object with values of string, nullable | no | HTTP headers sent with the request, e.g. `{"Authorization": "Bearer …"}`. Supports `{{Tab!Ref}}` cell references. **Write-only** — never returned by a read, and a PUT that omits it clears it. |  |
| `body` | string, nullable | no | Request body, sent as JSON when the endpoint expects it. Supports `{{Tab!Ref}}` cell references. Do not put credentials here — unlike `headers`, it is returned by reads. |  |
| `data_root` | string, nullable | no | Dotted path to the list of records inside the response, e.g. `data.orders`. Omit to let Sheetgo detect it. |  |
| `header_root` | string, nullable | no | Dotted path to a list of column names inside the response, used as the header row. |  |
| `pagination` | [PaginationCursor (type = "cursor")](https://dev-api.sheetgo.com/rest/reference/models/PaginationCursor.md) or [PaginationPage (type = "page")](https://dev-api.sheetgo.com/rest/reference/models/PaginationPage.md) or [PaginationOffset (type = "offset")](https://dev-api.sheetgo.com/rest/reference/models/PaginationOffset.md) or [PaginationQueryOffset (type = "query-offset")](https://dev-api.sheetgo.com/rest/reference/models/PaginationQueryOffset.md) or [PaginationLink (type = "link")](https://dev-api.sheetgo.com/rest/reference/models/PaginationLink.md) or [PaginationHeaderLink (type = "header-link")](https://dev-api.sheetgo.com/rest/reference/models/PaginationHeaderLink.md), nullable | no | How to walk a paginated endpoint. Omit for a single request. |  |
| `auth` | [SourceAuth](https://dev-api.sheetgo.com/rest/reference/models/SourceAuth.md), nullable | no | OAuth2 token refresh. **Write-only** — never returned by a read, and a PUT that omits it clears it. |  |
| `name` | string, nullable | no | Label for this source. Also used as the destination tab name when several sources are transferred without a merge. Defaults to `API`. |  |

## Used by

- [GET /rest/beta/automations/](https://dev-api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations)
- [GET /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations-id)
- [GET /rest/beta/workflows/](https://dev-api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows)
- [GET /rest/beta/workflows/{id}](https://dev-api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows-id)
- [PATCH /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#patch-rest-beta-automations-id)
- [PATCH /rest/beta/workflows/{id}](https://dev-api.sheetgo.com/rest/reference/workflows.md#patch-rest-beta-workflows-id)
- [POST /rest/beta/automations/](https://dev-api.sheetgo.com/rest/reference/automations.md#post-rest-beta-automations)
- [POST /rest/beta/workflows/](https://dev-api.sheetgo.com/rest/reference/workflows.md#post-rest-beta-workflows)
- [PUT /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#put-rest-beta-automations-id)
- [AutomationCreate](https://dev-api.sheetgo.com/rest/reference/models/AutomationCreate.md)
- [AutomationModel](https://dev-api.sheetgo.com/rest/reference/models/AutomationModel.md)
- [AutomationReplace](https://dev-api.sheetgo.com/rest/reference/models/AutomationReplace.md)
- [WorkflowAutomationModel](https://dev-api.sheetgo.com/rest/reference/models/WorkflowAutomationModel.md)

---

More: start page https://dev-api.sheetgo.com/rest/reference.md, everything in one file https://dev-api.sheetgo.com/rest/llms-full.txt, OpenAPI https://dev-api.sheetgo.com/rest/openapi.json.
