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

# Export Submissions (CSV)

> Export submissions as CSV. Large exports are processed asynchronously. Requires `forms-read`.

# Export Submissions (CSV)

Export submissions for a form as a CSV file. Large exports are processed asynchronously in the background, while smaller exports are processed immediately.

## Authentication & Scope

Requires `forms-read` ability.

## Request

```http theme={null}
POST /open/forms/{id}/submissions/export HTTP/1.1
Host: api.opnform.com
Content-Type: application/json
Authorization: Bearer <token>
```

### Path Parameters

| Parameter | Type   | Description             |
| --------- | ------ | ----------------------- |
| id        | number | Numeric ID of the form. |

### Body Parameters

| Field   | Type   | Required | Description                                                                                                       |
| ------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------- |
| columns | object | Yes      | Keys are field IDs (or `created_at`); values are booleans indicating whether to include the column in the export. |

Example payload exporting two fields and the created\_at timestamp:

```json theme={null}
{
    "columns": {
        "field_name": true,
        "field_email": true,
        "created_at": true
    }
}
```

## Response

The API automatically determines whether to process the export synchronously or asynchronously based on the form size.

### Synchronous Export (Small Forms)

`200 OK` – Returns a CSV file download immediately. The response's `Content-Type` will be `text/csv` and include the `Content-Disposition` header.

### Asynchronous Export (Large Forms)

`200 OK` – Returns a job status object for background processing:

```json theme={null}
{
    "message": "Export started. Large export will be processed in the background.",
    "job_id": "export_abc123def456",
    "is_async": true
}
```

<Note>
  Use the `job_id` to check export progress using the [Export Status
  endpoint](/api-reference/submissions/export-status).
</Note>

### Error Responses

`403 Forbidden` – The token lacks `forms-read` or you don't have access.


## OpenAPI

````yaml post /open/forms/{id}/submissions/export
openapi: 3.0.1
info:
  title: OpnForm API
  description: API for interacting with OpnForm, primarily used for Zapier integration
  version: 1.0.0
servers:
  - url: https://api.opnform.com
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Create and manage workspaces.
  - name: Workspace Users
    description: Manage users within a workspace.
  - name: Forms
    description: Manage and retrieve forms.
  - name: Submissions
    description: Access and manage form submissions.
  - name: Integrations
    description: Manage form integrations (webhooks) via API.
  - name: Zapier
    description: Legacy endpoints for the Zapier integration.
paths:
  /open/forms/{id}/submissions/export:
    post:
      tags:
        - Submissions
      summary: Export Submissions (CSV)
      description: >-
        Export submissions as CSV. Large exports are processed asynchronously.
        Requires `forms-read`.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - columns
              properties:
                columns:
                  type: object
                  additionalProperties:
                    type: boolean
                  description: >-
                    Object mapping field IDs to booleans to include columns in
                    CSV.
      responses:
        '200':
          description: Synchronous export (CSV file) or asynchronous export (job status)
          content:
            application/json:
              schema:
                oneOf:
                  - type: string
                    format: binary
                    description: CSV file download for small forms
                  - type: object
                    description: Job status for large forms
                    properties:
                      message:
                        type: string
                        example: >-
                          Export started. Large export will be processed in the
                          background.
                      job_id:
                        type: string
                        example: export_abc123def456
                      is_async:
                        type: boolean
                        example: true
        '403':
          description: Forbidden
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Personal Access Token
      x-bearer-scopemap:
        workspaces-read: Read access to workspaces
        workspaces-write: Write access to workspaces
        workspace-users-read: Read access to workspace users
        workspace-users-write: Write access to workspace users
        forms-read: Read access to forms
        forms-write: Write access to forms
        manage-integrations: Manage form integrations (webhooks)

````