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

# Create Document from Airtable

> Trigger document generation for an Airtable record via the API

When your automation's data source is set to **Airtable**, you only need to pass the Airtable record ID. All field mapping, line items, and output settings are pulled from the DocsAutomator app automatically.

<Info>
  For setup instructions on connecting Airtable to DocsAutomator, see the [Airtable integration guide](/integrations-api/airtable).
</Info>

## Endpoint

```
POST https://api.docsautomator.co/createDocument
```

## Request Body

<ParamField body="docId" type="string" required>
  The automation ID. Find it on the automation's settings page or via `GET /automations`.
</ParamField>

<ParamField body="recId" type="string" required>
  The Airtable record ID (e.g., `rec1234567890`). DocsAutomator fetches all mapped fields from this record automatically.
</ParamField>

<ParamField body="async" type="boolean" default="false">
  When `true`, returns immediately with a `jobId` (HTTP 202). Poll [`GET /job/{jobId}`](/api-reference/documents/get-job-status) for the result.
</ParamField>

<ParamField body="webhookParams" type="object">
  Custom parameters passed through to webhook notifications as `webhookParams` (plus an identical `additionalParams` copy kept only for legacy integrations). The triggering `recId` is folded in automatically (for body and query-string triggers alike); your own keys are never overwritten.
</ParamField>

<ParamField body="skipEsign" type="boolean" default="false">
  When `true`, skips e-signing for this request even if the automation has e-signing enabled. The document is generated and delivered normally (Drive save, email, webhook), but no signing session is started and no signing invitations are sent. Useful for two-step approval flows: generate a draft for review first, then re-run without `skipEsign` to send the document for signing. Also accepted as a query parameter (`?skipEsign=true`) on GET requests.
</ParamField>

<ParamField body="actingUserEmail" type="string">
  Email address of the team member generating this document. When the automation's email delivery (or e-signature email settings) has **Send from the team member who generates the document** enabled, the email is sent from this member's own connected Gmail or Outlook account instead of the configured sender. The address must match a mailbox connected to the workspace; otherwise DocsAutomator falls back to the automation's configured sender. Also accepted as a query parameter, which is handy in Airtable button or formula fields: append `&actingUserEmail=member@company.com` to the generation URL. An `X-Acting-User-Email` request header is supported too and takes precedence. The in-app Generate button passes this automatically.
</ParamField>

<ParamField body="docTemplateLink" type="string">
  Override the automation's Google Doc template URL for this request only.
</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.docsautomator.co/createDocument \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "docId": "YOUR_AUTOMATION_ID",
      "recId": "rec1234567890"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.docsautomator.co/createDocument", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      docId: "YOUR_AUTOMATION_ID",
      recId: "rec1234567890",
    }),
  });

  const result = await response.json();
  console.log(result.pdfUrl);
  ```

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

  response = requests.post(
      "https://api.docsautomator.co/createDocument",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      json={
          "docId": "YOUR_AUTOMATION_ID",
          "recId": "rec1234567890",
      },
  )

  result = response.json()
  print(result["pdfUrl"])
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "message": "success",
  "pdfUrl": "https://files.docsautomator.co/..."
}
```

Additional fields like `googleDocUrl`, `savePdfGoogleDriveUrl`, and e-signature fields are included depending on your automation's configuration. See the [API data source page](/api-reference/documents/create-from-api#response) for the full list.
