Skip to content
Navigation

Create a trigger

POST
https://api.cloudraker.com/triggers
Try it
Request body
Live API request

This request can change data or incur charges for the selected organization.

Authorization

  • bearerAuth
    HTTP
    required

Request body JSON required

  • name
    string
    required
    maxLength: 80 · minLength: 1
  • when
    required

    One of the following:

    • object
      • kind
        string
        required
      • schedule
        required

        One of the following:

        • object
          • kind
            string
            required
          • expression
            string
            required
            maxLength: 200 · minLength: 1
          • timezone
            string
            required
            maxLength: 100 · minLength: 1
        • object
          • kind
            string
            required
          • at
            string
            required
            format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • object
      • kind
        string
        required
      • address
        string
        required
        format: email · maxLength: 254 · pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
      • from
        optional
        array of
        string
        format: email · pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
    • object
      • kind
        string
        required
      • slug
        string
        required
        pattern: ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$
    • object
      • kind
        string
        required
  • open
    object
    required
    • agentIds
      array of
      string
      required
      maxLength: 128 · minLength: 1
    • spaces
      array of
      object
      required
      • spaceId
        string
        required
        maxLength: 128 · minLength: 1
      • access
        read
        or
        commit
        required
    • instruction
      string
      required
      maxLength: 4000 · minLength: 1
    • threadPolicy
      new
      or
      reuse
      required
    • filesFrom
      payload
      or
      none
      required
    • title
      optional
      string
      maxLength: 200
  • permissions
    object
    required
    • runAsUserId
      string
      required
      maxLength: 128 · minLength: 1
  • enabled
    optional
    boolean
    default: true

Returns

201

The trigger and its one-time secret.

JSON
  • data
    object
    required
    • name
      string
      required
      maxLength: 80 · minLength: 1
    • when
      required

      Any of the following:

      • Option 1

        One of the following:

        • object
          • kind
            string
            required
          • schedule
            required

            One of the following:

            • object
              • kind
                string
                required
              • expression
                string
                required
                maxLength: 200 · minLength: 1
              • timezone
                string
                required
                maxLength: 100 · minLength: 1
            • object
              • kind
                string
                required
              • at
                string
                required
                format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
        • object
          • kind
            string
            required
          • address
            string
            required
            format: email · maxLength: 254 · pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
          • from
            optional
            array of
            string
            format: email · pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        • object
          • kind
            string
            required
          • slug
            string
            required
            pattern: ^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$
        • object
          • kind
            string
            required
      • object
        • kind
          string
          required
        • slug
          string
          required
        • secretPreview
          string
          required
    • open
      object
      required
      • agentIds
        array of
        string
        required
        maxLength: 128 · minLength: 1
      • spaces
        array of
        object
        required
        • spaceId
          string
          required
          maxLength: 128 · minLength: 1
        • access
          read
          or
          commit
          required
      • instruction
        string
        required
        maxLength: 4000 · minLength: 1
      • threadPolicy
        new
        or
        reuse
        required
      • filesFrom
        payload
        or
        none
        required
      • title
        optional
        string
        maxLength: 200
    • permissions
      object
      required
      • runAsUserId
        string
        required
        maxLength: 128 · minLength: 1
    • id
      string
      required
      maxLength: 128 · pattern: ^trg_[A-Za-z0-9_-]+$
    • nextRunAt
      required

      Any of the following:

      • string
      • null
    • triggerRef
      string
      required
    • createdAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • updatedAt
      string
      required
      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
    • enabled
      optional
      boolean
      default: true
    • lastRun
      optional
      object
      • status
        opened
        or
        busy
        or
        needs_input
        or
        blocked
        or
        error
        required
      • at
        string
        required
        format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
      • sessionId
        optional
        string
        maxLength: 128 · minLength: 1
      • message
        optional
        string
        maxLength: 1000
    • legacy
      optional
      object
      • channelId
        optional
        string
      • channelType
        optional
        email
        or
        webhook
      • automationId
        optional
        string
  • secret
    string
    required

400

invalid_trigger — the email address does not belong to this organization and environment; invalid_schedule — the schedule is not valid.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

403

run_as_inactive — the executing member is not active in this organization.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

404

space_not_found — a named space does not exist or the executing member may not contribute to it; agent_not_found — a named agent does not exist.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

409

trigger_conflict — that webhook address or email address is already used in this organization, or a channel key rotation is unsettled; trigger_limit — 50 enabled triggers is the maximum; trigger_migration_in_progress — a legacy transfer still owns this source.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

422

agent_not_published — a named agent has no published version.
JSON
  • error
    string
    required

    The sentence a human reads.

  • error_code
    string
    required

    The stable snake_case branch key.

  • issues
    optional
    array of
    object

    Per-field detail, present only on a validation failure.

    • path
      string
      required
    • code
      string
      required
    • message
      string
      required

Type to search…

↑↓ navigate↵ selectEsc close