Skip to main content
POST
/
actions
Register a new action
curl --request POST \
  --url https://api.flowent.chat/api/v1/gateway/actions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "send_email",
  "description": "Send an email to a specified recipient",
  "webhook_url": "https://your-server.com/actions/send_email",
  "json_schema": {
    "type": "object",
    "properties": {
      "recipient": {
        "type": "string",
        "description": "Email address of the recipient"
      },
      "subject": {
        "type": "string",
        "description": "Email subject line"
      },
      "body": {
        "type": "string",
        "description": "Email body content"
      }
    },
    "required": [
      "recipient",
      "subject",
      "body"
    ]
  }
}
'
{
  "action": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_id": "123e4567-e89b-12d3-a456-426614174001",
    "name": "send_email",
    "description": "Send an email to a specified recipient",
    "json_schema": {
      "type": "object",
      "properties": {
        "recipient": {
          "type": "string",
          "description": "Email address of the recipient"
        },
        "subject": {
          "type": "string",
          "description": "Email subject line"
        },
        "body": {
          "type": "string",
          "description": "Email body content"
        }
      },
      "required": [
        "recipient",
        "subject",
        "body"
      ]
    },
    "webhook_url": "https://your-server.com/actions/send_email",
    "created_at": "2023-01-01T12:00:00Z",
    "updated_at": "2023-01-01T12:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

JWT token obtained from token exchange

Body

application/json
name
string
required

Action name (lowercase, underscores, no spaces)

Required string length: 1 - 100
Example:

"send_email"

description
string
required

Human-readable description of the action

Required string length: 1 - 500
Example:

"Send an email to a specified recipient"

webhook_url
string<uri>
required

URL where the action will be executed (must be HTTPS in production)

Example:

"https://your-server.com/actions/send_email"

json_schema
object
required

JSON Schema defining the action's parameters

Example:
{
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
}
},
"required": ["recipient", "subject", "body"]
}

Response

Action created successfully

action
object