Skip to main content
POST
/
v2
/
_actions
Create API 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": {
    "url": "<string>",
    "method": "<string>",
    "mandatory": true,
    "headers": {
      "Content-Type": "<string>"
    },
    "body": [
      {
        "type": "<string>",
        "values": {
          "data": "<string>"
        }
      }
    ],
    "static_body": "<string>",
    "required": [
      "<string>"
    ],
    "response": {
      "prompt": "<string>"
    },
    "run_before_call": true,
    "type": "<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 API Action
description
string
required
Action purpose. Example: Post API Action
action_timing
string
required
When to trigger: "DURING"
type
string
required
Action type: "WEBHOOK"
webhook
object
required
Webhook configuration object
url
string
required
Target API endpoint. Example: "https://api.publicapis.org/entries"
method
string
required
HTTP method. Example: "POST"
mandatory
boolean
Require confirmation before execution. Example: false
headers
object
Content-Type
string
Request headers. Example: {"Content-Type": "application/json"}
body
array
Request body definition. Example: [{"type":"static","values":{"data":"info"}}]
type
string
Webhook type. Example: "static"
values
object
data
string
Webhook data. Example: "Information"
static_body
string
Optional static body payload
required
string[]
List of required fields
response
object
Response handling configuration
prompt
string
run_before_call
boolean
Run pre-call logic. Example: false
type
string
Webhook type. Example: "static"

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
”WEBHOOK”
400 Bad Request - Invalid webhook configuration 401 Unauthorized - Invalid token