Trigger Actions

Create New Trigger

post/trigger-actions

Request

  • Base URL: https://api.carbonvoice.app
  • URL: https://api.carbonvoice.app/trigger-actions
  • Auth: one of:
    • API key in header pxtoken
    • OAuth 2 (implicit, authorization URL https://api.carbonvoice.app/oauth/authorize)

Request body

trigger'message.posted.to.channel' | 'schedule' required
run_on_short_messageboolean

Defines if Trigger Action should run on short message

rrulestring

RRULE string for time-based triggers. Required when trigger is TIME. Example: "FREQ=WEEKLY;BYDAY=MO,WE,FR;BYHOUR=9;BYMINUTE=0"

Example request

{
  "actions": [
    {
      "action_id": "run_ai_prompt",
      "entity_type": "ai_prompt",
      "metadata": {
        "conversation_id": "channel_123",
        "send_as_bot": true,
        "message": "Daily standup reminder!",
        "links": [
          "https://pxassets.s3.us-east-2.amazonaws.com/images/v2/logo.png",
          "https://pxassets.s3.us-east-2.amazonaws.com/images/v2/Personal+CarbonLink.svg",
          "https://www.youtube.com/watch?v=36Tn5cektlg"
        ]
      }
    }
  ],
  "filters": [
    {
      "key": "workspace_id",
      "value": "123",
      "operator": "eq"
    }
  ],
  "rrule": "FREQ=WEEKLY;BYDAY=MO,WE,FR;BYHOUR=9;BYMINUTE=0"
}

Response

created_atstring date-time required

The date and time at which the resource was created.

updated_atstring date-time required

The date and time at which the resource was last updated.

idstring required

The primary key of the resource.

client_idstring required
user_idstring required
trigger'message.posted.to.channel' | 'schedule' required
run_on_short_messageboolean

Defines if Trigger Action should run on short message

rrulestring

RRULE string for SCHEDULE triggers

Example response

{
  "actions": [
    {
      "action_id": "run_ai_prompt",
      "entity_type": "ai_prompt",
      "metadata": {
        "conversation_id": "channel_123",
        "send_as_bot": true,
        "message": "Daily standup reminder!",
        "links": [
          "https://pxassets.s3.us-east-2.amazonaws.com/images/v2/logo.png",
          "https://pxassets.s3.us-east-2.amazonaws.com/images/v2/Personal+CarbonLink.svg",
          "https://www.youtube.com/watch?v=36Tn5cektlg"
        ]
      }
    }
  ],
  "filters": [
    {
      "key": "name",
      "operator": "eq"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.