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

# Create Data Extraction Action

> Create single data extraction actions for user intent capture.

### Authorizations

<ParamField header="Authorization" type="string" required>
  Enter your ContactSwing JWT Bearer token.
</ParamField>

### Request Body

<ParamField body="name" type="string" required>
  Action display name. Example: `My Data Extraction Action`
</ParamField>

<ParamField body="description" type="string">
  User prompt/description. Example: `"Trigger this action if the user requests data extraction."`
</ParamField>

<ParamField body="action_timing" type="string" required>
  When to trigger: `"DURING"`
</ParamField>

<ParamField body="type" type="string" required>
  Action type: `"SINGLEDATAEXTRACTION"`
</ParamField>

<ParamField body="webhook" type="object" required>
  Data extraction webhook configuration

  <ParamField body="mandatory" type="boolean">
    Require user response before proceeding
  </ParamField>

  <ParamField body="name" type="string">
    Data field name
  </ParamField>

  <ParamField body="description" type="string">
    User prompt/description. Example: `"user interested on buying the product"`
  </ParamField>

  <ParamField body="type" type="string">
    Response type: `"yes/no"`
  </ParamField>

  <ParamField body="sync_data" type="boolean">
    Sync extracted data automatically
  </ParamField>

  <ParamField body="sync_module" type="string">
    Target module: `"customers"`
  </ParamField>

  <ParamField body="sync_field" type="string">
    Database field to store data: `"customer_timezone"`
  </ParamField>
</ParamField>

### Response

**201 Created** - Data extraction action created successfully

<ResponseField name="ctx_id" type="string">Request context ID</ResponseField>

<ResponseField name="data" type="object">
  <ResponseField name="action_id" type="string">New extraction action ID</ResponseField>
  <ResponseField name="name" type="string">Action name</ResponseField>
  <ResponseField name="type" type="string">"SINGLEDATAEXTRACTION"</ResponseField>
</ResponseField>

**400 Bad Request** - Invalid webhook configuration

**401 Unauthorized** - Invalid token
