Skip to main content
POST
/
v2
/
_actions
Create Data Extraction Action
curl --request POST \
  --url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_actions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "action_timing": "<string>",
  "type": "<string>",
  "webhook": {
    "mandatory": true,
    "name": "<string>",
    "description": "<string>",
    "type": "<string>",
    "sync_data": true,
    "sync_module": "<string>",
    "sync_field": "<string>"
  }
}
'
{
  "ctx_id": "<string>",
  "data": {
    "action_id": "<string>",
    "name": "<string>",
    "type": "<string>"
  }
}

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.

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Action display name. Example: My Data Extraction Action
description
string
User prompt/description. Example: "Trigger this action if the user requests data extraction."
action_timing
string
required
When to trigger: "DURING"
type
string
required
Action type: "SINGLEDATAEXTRACTION"
webhook
object
required
Data extraction webhook configuration
mandatory
boolean
Require user response before proceeding
name
string
Data field name
description
string
User prompt/description. Example: "user interested on buying the product"
type
string
Response type: "yes/no"
sync_data
boolean
Sync extracted data automatically
sync_module
string
Target module: "customers"
sync_field
string
Database field to store data: "customer_timezone"

Response

201 Created - Data extraction action created successfully
ctx_id
string
Request context ID
data
object
action_id
string
New extraction action ID
name
string
Action name
type
string
”SINGLEDATAEXTRACTION”
400 Bad Request - Invalid webhook configuration 401 Unauthorized - Invalid token