> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowyte.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Sheets

> Log every call to a spreadsheet — map captured fields to real columns, no code.

Connect Google Sheets once, then provision a **log a row** action as a [skill](/concepts/skills).
The agent collects fields from the caller and appends a row to the tab you choose — a lead log, an
order record, a callback list. Mapping is config, not code.

## Connect

Google Sheets uses OAuth. Begin the connect, then finish consent in a browser.

```bash theme={null}
curl -X POST https://builder.flowyte.com/api/v1/integrations/google_sheets/connect \
  -H "Authorization: Bearer flowyte_sk_…"
# → { "data": { "oauthUrl": "https://…" } }   # open this in a browser to grant access
```

The browser-only callback completes the connection; it cannot be finished with an API key. After
consent, `GET /integrations` lists `google_sheets` as `connected`.

## Resolve the target sheet

Before you map columns, confirm the connected account can read the spreadsheet. Pass a Sheets URL
or bare id as `ref` and get back the title, its tabs, and each tab's header row — so you map
captured params to the **real** column names.

```bash theme={null}
curl -G https://builder.flowyte.com/api/v1/integrations/google_sheets/spreadsheet \
  -H "Authorization: Bearer flowyte_sk_…" \
  --data-urlencode "ref=https://docs.google.com/spreadsheets/d/SHEET_ID/edit"
```

<Note>
  This read-only helper uses only the granted spreadsheet scope. A `409 integration_not_connected`
  means Sheets isn't connected; a `404 sheet_not_accessible` means the link is wrong or the file
  isn't shared with the connected account.
</Note>

## Provision the skill

List the actions, then provision onto an agent. The column mapping is part of the skill's config —
finish it in the dashboard if the action lands as a draft.

<CodeGroup>
  ```bash curl theme={null}
  curl https://builder.flowyte.com/api/v1/integrations/google_sheets/actions \
    -H "Authorization: Bearer flowyte_sk_…"

  curl -X POST \
    https://builder.flowyte.com/api/v1/agents/AGENT_ID/integrations/google_sheets/provision \
    -H "Authorization: Bearer flowyte_sk_…" \
    -H "Content-Type: application/json" \
    -d '{ "actions": ["append_row"] }'
  ```

  ```js Node theme={null}
  await fetch(
    "https://builder.flowyte.com/api/v1/agents/AGENT_ID/integrations/google_sheets/provision",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer flowyte_sk_…",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ actions: ["append_row"] }),
    },
  );
  ```

  ```python Python theme={null}
  import requests

  requests.post(
      "https://builder.flowyte.com/api/v1/agents/AGENT_ID/integrations/google_sheets/provision",
      headers={"Authorization": "Bearer flowyte_sk_…"},
      json={"actions": ["append_row"]},
  )
  ```
</CodeGroup>

## In the API

| Action           | Endpoint                                                        | Scope                |
| ---------------- | --------------------------------------------------------------- | -------------------- |
| Connect          | `POST /integrations/google_sheets/connect`                      | `integrations:write` |
| Resolve a sheet  | `GET /integrations/google_sheets/spreadsheet?ref=…`             | `integrations:read`  |
| List actions     | `GET /integrations/google_sheets/actions`                       | `integrations:read`  |
| Provision skills | `POST /agents/{agentId}/integrations/google_sheets/provision`   | `skills:write`       |
| Remove skills    | `DELETE /agents/{agentId}/integrations/google_sheets/provision` | `skills:write`       |
| Disconnect       | `DELETE /integrations/google_sheets`                            | `integrations:write` |

<Warning>
  Provisioning edits the **draft**. [Publish](/concepts/agents) so live calls write rows.
</Warning>
