Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
actions
Create Data Extraction Action
curl --request POST \
  --url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/actions \
  --header 'Authorization: <authorization>'
{
  "ctx_id": "<string>",
  "data": {
    "action_id": "<string>",
    "name": "<string>",
    "type": "<string>"
  }
}

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Action display name. Example: My Data Extraction Action
action_timing
string
required
When to trigger: "DURING"
type
string
required
Action type: "SINGLEDATAEXTRACTION"
webhook
object
required
Data extraction webhook configuration

Data Extraction Configuration

webhook.mandatory
boolean
Require user response before proceeding
webhook.name
string
Data field name
webhook.description
string
User prompt/description. Example: "user interested on buying the product"
webhook.type
string
Response type: "yes/no"
webhook.sync_data
boolean
Sync extracted data automatically
webhook.sync_module
string
Target module: "customers"
webhook.sync_field
string
Database field to store data

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