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

# Workflow Integrations

> Connect third-party apps (HubSpot, Salesforce, Google Sheets, and more) that workflows write enriched data to.

## Overview

Integrations are the connected destinations your workflow Export steps send
enriched records to. Connections are made through a self-hosted Nango instance,
which handles OAuth and token refresh, so Encrata never stores the third-party
credentials. Each connection is referenced by a `connection_id` and a
`provider_config_key` (for example `google-sheet`, `hubspot`, `salesforce`).

## Authentication

Requires a JWT token or API key in the `Authorization` header.

```bash theme={"dark"}
Authorization: Bearer YOUR_TOKEN
```

## List Integrations

```bash theme={"dark"}
GET /api/workflows/integrations
```

Returns the connected accounts for the current user.

### Example response

```json theme={"dark"}
{
  "integrations": [
    {
      "id": "int_abc123",
      "provider": "nango",
      "account_email": "My HubSpot",
      "status": "connected",
      "provider_config_key": "hubspot",
      "created_at": "2026-07-29T10:00:00Z"
    }
  ]
}
```

## List Available Providers

```bash theme={"dark"}
GET /api/workflows/integrations/nango/providers
```

Returns the apps configured on the connected Nango instance, ready to connect.

## Start a Connection

```bash theme={"dark"}
POST /api/workflows/integrations/nango/session
```

Returns a short-lived Connect session token used by the dashboard to open the
Nango Connect UI. In the dashboard this is handled for you on the Integrations
page. The returned `token`, `host`, and `connect_url` are passed to the Nango
frontend SDK.

<ParamField body="integration" type="string">
  Optional provider config key to restrict the connect flow to a single app.
</ParamField>

## Save a Connection

```bash theme={"dark"}
POST /api/workflows/integrations/nango/save
```

Records a completed connection after the Connect UI flow finishes.

<ParamField body="connection_id" type="string" required>
  The Nango connection id returned by the Connect UI.
</ParamField>

<ParamField body="provider_config_key" type="string" required>
  The provider config key (for example `google-sheet`).
</ParamField>

<ParamField body="label" type="string">
  Optional friendly name shown in the dashboard.
</ParamField>

## Disconnect

```bash theme={"dark"}
DELETE /api/workflows/integrations/{id}
```

Removes a connected account. Existing Export steps that reference it will stop
delivering until reconnected.

## Create a Google Sheet

```bash theme={"dark"}
POST /api/workflows/integrations/{id}/sheet
```

Creates a new spreadsheet in the connected Google account and returns its id, so
an Export step can write to it without pasting a spreadsheet URL.

<ParamField body="title" type="string">
  Optional spreadsheet title. Defaults to a generated name.
</ParamField>

### Example response

```json theme={"dark"}
{
  "spreadsheet_id": "1AbCdEf...",
  "spreadsheet_url": "https://docs.google.com/spreadsheets/d/1AbCdEf.../edit",
  "sheet_name": "Sheet1"
}
```
