# Typeform

Typeform is a forms and surveys platform that creates engaging, conversational forms. The Sling Typeform connector extracts data from the Typeform REST API, supporting forms, responses, workspaces, themes, and images.

{% hint style="success" %}
**CLI Pro Required**: APIs require a [CLI Pro token](https://docs.slingdata.io/sling-cli/cli-pro) or [Platform Plan](https://docs.slingdata.io/sling-platform/platform).
{% endhint %}

## Setup

The following credentials are accepted:

**Secrets:**

* `api_key` **(required)** -> Your Typeform Personal Access Token

### Getting Your Personal Access Token

1. Log in to [Typeform](https://www.typeform.com)
2. Go to your [Account Settings](https://admin.typeform.com/user/tokens)
3. Under **Personal tokens**, click **Generate a new token**
4. Give your token a name (e.g., "Sling Integration")
5. Select the required scopes: **Forms: Read**, **Responses: Read**, **Workspaces: Read**, **Themes: Read**, **Images: Read**
6. Click **Generate token** and copy the token

{% hint style="warning" %}
**Important:** Personal access tokens grant access to your Typeform account data. Keep your token secure and never share it publicly.
{% endhint %}

### Using `sling conns`

Here are examples of setting a connection named `TYPEFORM`. We must provide the `type=api` property:

{% code overflow="wrap" %}

```bash
sling conns set TYPEFORM type=api spec=typeform secrets='{ api_key: your_personal_access_token }'
```

{% endcode %}

### Environment Variable

See [here](https://docs.slingdata.io/sling-cli/environment#dot-env-file-.env.sling) to learn more about the `.env.sling` file.

{% code overflow="wrap" %}

```bash
export TYPEFORM='{ type: api, spec: typeform, secrets: { api_key: "your_personal_access_token" } }'
```

{% endcode %}

### Sling Env File YAML

See [here](https://docs.slingdata.io/sling-cli/environment#sling-env-file-env.yaml) to learn more about the sling `env.yaml` file.

```yaml
connections:
  TYPEFORM:
    type: api
    spec: typeform
    secrets:
      api_key: "your_personal_access_token"
```

## Replication

Here's an example replication configuration to sync Typeform data to a PostgreSQL database:

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: typeform.{stream_name}

streams:
  # sync all endpoints
  '*':
```

**Incremental sync for responses:**

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: typeform.{stream_name}

streams:
  forms:
  workspaces:
  themes:
  images:
  responses:
    mode: incremental
```

## Endpoints

| Endpoint     | Description                        | Incremental | Depends On |
| ------------ | ---------------------------------- | ----------- | ---------- |
| `forms`      | All forms in the account           | No          | —          |
| `responses`  | All responses for each form        | Yes         | `forms`    |
| `workspaces` | All workspaces in the account      | No          | —          |
| `themes`     | All themes in the account          | No          | —          |
| `images`     | All images uploaded to the account | No          | —          |

The connector uses a **queue-based architecture** to handle parent-child relationships. The `forms` endpoint runs first and populates form IDs, which are used by `responses` to iterate over each form.

To discover available endpoints:

```bash
sling conns discover TYPEFORM
```

### Endpoint Details

**`forms`** — Returns all forms in the account with metadata including title, creation date, last update, settings, and theme configuration. Form IDs are queued for the `responses` endpoint.

**`responses`** — Returns all responses submitted to each form, including answers, metadata, submission timestamps, and calculated scores. Supports incremental sync via the `since` parameter. Each response is enriched with the `form_id` for easy association.

**`workspaces`** — Returns all workspaces in the account, including workspace name, associated forms, and sharing settings.

**`themes`** — Returns all themes (both built-in and custom), including colors, fonts, background settings, and screen configurations.

**`images`** — Returns all images uploaded to the account, including file metadata, dimensions, and source URLs.

## Incremental Sync

The `responses` endpoint supports incremental sync using the `since` parameter:

* **First run:** Fetches all responses from the last 30 days
* **Subsequent runs:** Only fetches responses submitted after the last sync timestamp

All other endpoints run in full-refresh mode since the Typeform API does not provide server-side time-based filtering for those resources.

## Rate Limiting

The Typeform API enforces rate limits:

* **Free plan:** 2 requests per second

The connector automatically:

* Uses rate limiting (2 requests/second with concurrency of 2)
* Retries with exponential backoff on 429 (rate limit) responses
* Allows up to 5 retry attempts
* Continues gracefully on 404 responses (e.g., deleted forms)

## Common Use Cases

### Sync All Typeform Data

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: typeform.{stream_name}

streams:
  '*':
```

### Sync Responses Incrementally

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  object: typeform.{stream_name}

streams:
  forms:
    mode: full-refresh
  responses:
    mode: incremental
```

### Extract Forms and Responses for Analytics

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: typeform.{stream_name}

streams:
  forms:
  responses:
    mode: incremental
```

### Sync Workspace and Theme Configuration

```yaml
source: TYPEFORM
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: typeform.{stream_name}

streams:
  workspaces:
  themes:
  images:
```

If you are facing issues connecting, please reach out to us at <support@slingdata.io>, on [discord](https://discord.gg/q5xtaSNDvp) or open a Github Issue [here](https://github.com/slingdata-io/sling-cli/issues).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.slingdata.io/connections/api-connections/typeform.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
