Skip to main content
POST
Create a trigger

Authorizations

x-conveyour-token
string
header
required

Your API key token. Contacts endpoints require a Server-only — Full API key — see Authentication.

Query Parameters

teams[]
string[]

Team scope for the request, as one or more team ObjectIds. The brackets are required: PHP keeps only the last value for a repeated plain key, so teams=A&teams=B silently resolves to B alone. On requests with a JSON body you may send teams (no brackets) in the body instead.

Values that are not valid ObjectIds are silently ignored — a mistyped team ID behaves as if no team was sent. See the teams section of the API conventions guide.

Body

application/json
campaign_id
string
required

The campaign this trigger belongs to.

type
string
required

The trigger type. Valid values include lesson, sms, email, and contactupdate (plus other types returned in data.types from GET /api/triggers). Values like send_lesson or send_sms are invalid and fail with "Cannot create trigger".

name
string

Optional display name for the trigger.

delay
integer

Delay in seconds before the trigger fires.

draft
boolean

When true, saves the trigger as a draft (not live).

...
string

Type-specific fields (e.g. lesson_id for the lesson type). See GET /api/triggers data.schemas for the full list per type.

Response

Success.

The common response envelope shared by all ConveYour endpoints.

status
enum<string>

ok on success, failed on error.

Available options:
ok,
failed
message
string

Human-readable description of the result.

data
object

An automation trigger. Each trigger type carries additional type-specific keys beyond the base fields listed here.