# SourceAuth

OAuth2 refresh for an API source.

⚠️ `refresh_params` typically carries a client secret and a refresh token.
Automation interface payloads are NOT encrypted at rest, and the engine
ROTATES the refresh token in place after a successful refresh
(sheetgo-microservices getvalues/service_api.py:71-77) — so the stored
value can change without any API call.

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 |
| --- | --- | --- | --- | --- |
| `auth_method` | string | yes | Only `oauth2` is supported. The engine refreshes the token on a 401/403 and retries. | const: `"oauth2"` |
| `auth_type` | string | no | Scheme used in the Authorization header after a refresh, e.g. `Bearer`. | default: `"Bearer"` |
| `refresh_url` | string | yes | Token endpoint called to refresh. |  |
| `refresh_headers` | object with values of string, nullable | no | Extra headers sent with the refresh request. |  |
| `refresh_params` | object with values of string, nullable | no | Form body of the refresh request, e.g. `client_id`, `client_secret`, `refresh_token`. Write-only: never returned by a read. |  |

## 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)
- [SourceAPI](https://dev-api.sheetgo.com/rest/reference/models/SourceAPI.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.
