> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a procedure trigger

> A procedure trigger: its spec, revision, whether it is enabled, whose access its runs use, when it next fires, how many runs it started and why its latest firing failed, if it did.

Its spec is `name`, `procedureId`, `version`, `projectId`, `schedule`, `folder`, `event` and `inputs`: send those, with `enabled` (and `runAs` to enable it), to createProcedureTrigger to copy it under a new `name`, or with `expectedRevision` set to its `revision` to replaceProcedureTrigger. The other fields are the trigger’s state, and a request that sends them is refused. Whose access the runs use is never copied: a request enables the trigger only with its own `enabled: true` and `runAs: "self"`.

Name it by `id` or `name`. A trigger whose procedure the caller may not run is not found, and so is one listProcedureTriggers leaves out. Read-only and safe to retry.

Alpha: this operation may change or be removed without notice.



## OpenAPI

````yaml /openapi.json get /procedures/triggers/{id}
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.canary.effectiveai.app/api/v2
    description: Canary
security:
  - bearerAuth: []
paths:
  /procedures/triggers/{id}:
    get:
      tags:
        - Procedure triggers
      summary: Get a procedure trigger
      description: >-
        A procedure trigger: its spec, revision, whether it is enabled, whose
        access its runs use, when it next fires, how many runs it started and
        why its latest firing failed, if it did.


        Its spec is `name`, `procedureId`, `version`, `projectId`, `schedule`,
        `folder`, `event` and `inputs`: send those, with `enabled` (and `runAs`
        to enable it), to createProcedureTrigger to copy it under a new `name`,
        or with `expectedRevision` set to its `revision` to
        replaceProcedureTrigger. The other fields are the trigger’s state, and a
        request that sends them is refused. Whose access the runs use is never
        copied: a request enables the trigger only with its own `enabled: true`
        and `runAs: "self"`.


        Name it by `id` or `name`. A trigger whose procedure the caller may not
        run is not found, and so is one listProcedureTriggers leaves out.
        Read-only and safe to retry.


        Alpha: this operation may change or be removed without notice.
      operationId: getProcedureTrigger
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: The trigger’s `id`, or its `name`.
          required: true
          description: The trigger’s `id`, or its `name`.
          name: id
          in: path
      responses:
        '200':
          description: The trigger.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ProcedureTrigger'
        '400':
          description: Invalid trigger id, query or body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: The caller may not read procedure triggers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: No such trigger, or the caller cannot read it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '409':
          description: The trigger changed while this was being done. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '422':
          description: >-
            invalid_trigger: the trigger cannot be saved or changed as asked,
            such as a procedure version that is not published, inputs that do
            not match it, a cron expression that fires more than hourly, a
            folder or project that does not exist, or a trigger whose kind or
            state does not allow this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: Procedure triggers are temporarily unavailable. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2ProcedureTrigger:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The trigger’s id. Its `name` also identifies it in the item paths.
        name:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[a-z0-9][a-z0-9._-]*$
          description: >-
            The trigger’s name, unique in the workspace: lowercase letters,
            digits, dots, underscores and hyphens, at most 128. It cannot be
            changed, and a deleted trigger’s name stays taken.
        procedureId:
          type: string
          maxLength: 256
          pattern: ^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$
          description: The procedure the trigger runs.
        version:
          anyOf:
            - type: string
              enum:
                - live
            - type: integer
              minimum: 0
              exclusiveMinimum: true
              maximum: 9007199254740991
              description: Immutable positive procedure version
          description: >-
            The version to run: `live`, which follows the procedure’s live
            version at each firing, or a version number to pin one.
        projectId:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: >-
            The project (listProjects `id`) the trigger’s runs belong to, or
            null for none. The procedure must be installed in it.
        schedule:
          type: object
          nullable: true
          properties:
            expressions:
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 255
              minItems: 1
              maxItems: 10
              description: >-
                Cron expressions (minute hour day-of-month month day-of-week), 1
                to 10. Each must fire at most once an hour.
            timezone:
              type: string
              minLength: 1
              maxLength: 255
              description: >-
                The IANA time zone the expressions are read in, such as
                `America/Chicago`.
          required:
            - expressions
            - timezone
          additionalProperties: false
          description: >-
            Fire on a schedule. Exactly one of `schedule`, `folder` and `event`
            is set.
        folder:
          type: object
          nullable: true
          properties:
            uri:
              type: string
              minLength: 1
              maxLength: 2048
              description: >-
                The folder to watch, as a Vault URI such as
                `team://claims/incoming`.
            input:
              type: string
              minLength: 1
              maxLength: 255
              description: >-
                The procedure input that receives each new file, as `{ "uri":
                "artifact://<id>" }`.
          required:
            - uri
            - input
          additionalProperties: false
          description: Fire for each new file in a folder.
        event:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - email_received
                  description: An email arrived at one of the workspace’s email addresses.
                match:
                  type: object
                  properties:
                    senderEmails:
                      type: array
                      items:
                        type: string
                        format: email
                      minItems: 1
                      maxItems: 100
                      description: >-
                        Only email from one of these senders, compared without
                        regard to case. Omit to take every email the address
                        accepts.
                  additionalProperties: false
                input:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    The procedure input that receives the event, with its
                    `payload`. It must not also be a static input.
              required:
                - type
                - input
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - rsl_log_written
                  description: >-
                    A program’s log kept a write: opening it, or a write that
                    recorded entries. Previews, refused writes and retried
                    writes fire nothing.
                match:
                  type: object
                  properties:
                    programs:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                      minItems: 1
                      maxItems: 100
                      description: Only writes to logs of these programs.
                    steps:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                      minItems: 1
                      maxItems: 100
                      description: >-
                        Only writes that recorded an entry with one of these
                        step names, such as `signed_off`.
                    roles:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                      minItems: 1
                      maxItems: 100
                      description: Only writes made in one of these program roles.
                    statuses:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                      minItems: 1
                      maxItems: 100
                      description: >-
                        Only writes that left the log at one of these statuses,
                        such as `ready` or `refused`.
                  additionalProperties: false
                input:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    The procedure input that receives the event, with its
                    `payload`. It must not also be a static input.
              required:
                - type
                - input
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - procedure_run_terminal
                  description: >-
                    A procedure run in the workspace finished: completed, failed
                    or cancelled.
                match:
                  type: object
                  properties:
                    procedureId:
                      type: string
                      maxLength: 256
                      pattern: ^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$
                      description: Only runs of this procedure.
                    outcomes:
                      type: array
                      items:
                        type: string
                        enum:
                          - completed
                          - failed
                          - cancelled
                      minItems: 1
                      description: Only runs that ended this way.
                  additionalProperties: false
                input:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: >-
                    The procedure input that receives the event, with its
                    `payload`. It must not also be a static input.
              required:
                - type
                - input
              additionalProperties: false
            - nullable: true
          description: >-
            The workspace event that starts a run. `match` narrows which events
            of the type do; each field given must hold, and an omitted `match`
            takes every event of the type.
        inputs:
          type: object
          additionalProperties:
            nullable: true
          description: >-
            Static input values by name, as getProcedureVersion describes them,
            given to every run.
        kind:
          type: string
          enum:
            - schedule
            - folder
            - event
          description: Which firing source is set.
        revision:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            The spec’s revision: 1 when created, one more after each
            replaceProcedureTrigger.
        enabled:
          type: boolean
          description: >-
            Whether the trigger fires. Create and replace set it from their
            `enabled`; enableProcedureTrigger and disableProcedureTrigger change
            it.
        runAs:
          type: object
          nullable: true
          properties:
            userId:
              type: string
              description: The person the trigger’s runs act as.
            state:
              type: string
              enum:
                - valid
                - stale
              description: >-
                `valid` for the current revision. `stale`: recorded for an
                earlier revision or no longer usable; enable the trigger again.
          required:
            - userId
            - state
          description: >-
            Whose access the trigger’s runs use, or null before it is enabled.
            Create and replace do not take it back: send `enabled: true` with
            `runAs: "self"` to run as yourself.
        nextRunAt:
          type: string
          nullable: true
          format: date-time
          description: >-
            When the schedule next fires while the trigger is enabled; null for
            folder and event triggers.
        runCount:
          type: integer
          minimum: 0
          description: Runs the trigger started.
        lastError:
          type: object
          nullable: true
          properties:
            message:
              type: string
              description: For people.
            at:
              type: string
              format: date-time
          required:
            - message
            - at
          description: >-
            Why the latest firing did not start a run, until a later one does;
            null when none failed.
        runTriggerId:
          type: string
          description: >-
            What the runs this trigger starts carry as `cause.triggerId`. Pass
            it as `triggerId` to listProcedureRuns to list them.
      required:
        - id
        - name
        - procedureId
        - version
        - projectId
        - schedule
        - folder
        - event
        - inputs
        - kind
        - revision
        - enabled
        - runAs
        - nextRunAt
        - runCount
        - lastError
        - runTriggerId
      description: >-
        A procedure trigger. Its spec is `name`, `procedureId`, `version`,
        `projectId`, `schedule`, `folder`, `event` and `inputs`: send those,
        with `enabled` (and `runAs` to enable it), to createProcedureTrigger to
        copy it under a new `name`, or with `expectedRevision` set to its
        `revision` to replaceProcedureTrigger. The other fields are the
        trigger’s state, and a request that sends them is refused.
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            businessCode:
              type: string
              description: The rater’s own refusal code, for business_rejection.
            violations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Authored or built-in constraint code
                  message:
                    type: string
                    description: Authored message for the failed constraint
                  path:
                    type: string
                    description: Input path of the offending value; empty for the request
                  value:
                    nullable: true
                    description: Offending input value, size-bounded by the runtime
                  constraint:
                    type: string
                    description: The constraint the value failed, as text
                  cite:
                    type: string
                    nullable: true
                    description: >-
                      Filing citation of the constraint, when the source cites
                      one
                required:
                  - code
                  - message
                  - path
                  - value
                  - constraint
                  - cite
                additionalProperties: false
              maxItems: 256
              description: >-
                Each input constraint the submission failed, for invalid_inputs
                and business_rejection.
            violationsTruncated:
              type: boolean
              description: >-
                True when the rater reported more violations than violations
                holds.
            executionId:
              type: string
              description: >-
                The recorded execution of a failed rating, for rater rating
                failures.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: Not currently returned.
          required:
            - code
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.