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

# Retrieve a trigger

> Retrieves a single trigger by ID.



## OpenAPI

````yaml /api-reference/v2.json get /triggers/{trigger_id}
openapi: 3.1.1
info:
  title: Deck API
  version: 2.0.0
servers:
  - url: https://api.deck.co/v2
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Agents
  - name: Components
  - name: Credentials
  - name: Event Destinations
  - name: Events
  - name: Sessions
  - name: Sources
  - name: Storage
  - name: Task Runs
  - name: Tasks
  - name: Test
  - name: Triggers
paths:
  /triggers/{trigger_id}:
    get:
      tags:
        - Triggers
      summary: Retrieve a trigger
      description: Retrieves a single trigger by ID.
      operationId: getTrigger
      parameters:
        - name: trigger_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the trigger (prefixed with `trg_`).
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
        '400':
          description: Bad request — validation error or malformed input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized.
        '403':
          description: Forbidden.
        '404':
          description: Not found — the requested resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict — the request is valid but cannot be completed in the
            current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable content — the request body is understood but contains
            invalid values.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TriggerResponse:
      required:
        - id
        - object
        - name
        - description
        - status
        - condition
        - task_id
        - credential_ids
        - credential_filter
        - input
        - skip_if
        - concurrency_max
        - created_at
        - updated_at
        - request_id
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the trigger, prefixed with `trg_`.
        object:
          type: string
          description: Always `trigger`.
        name:
          type: string
          description: Display name for the trigger.
        description:
          type:
            - 'null'
            - string
          description: Description of the trigger's purpose.
        status:
          type: string
          description: >-
            `active` or `inactive`. Inactive triggers keep their configuration
            and fire nothing.
        condition:
          $ref: '#/components/schemas/TriggerCondition'
        task_id:
          type: string
          description: >-
            The task this trigger runs. Prefixed with `task_`. Fixed at
            creation.
        credential_ids:
          type:
            - 'null'
            - array
          items:
            type: string
          description: >-
            Explicit credentials the trigger targets. `null` when the trigger
            uses `credential_filter`.
        credential_filter:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TriggerCredentialFilter'
          description: >-
            Credential scope the trigger fans out across. `null` when the
            trigger uses `credential_ids`.
        input:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/JsonElement'
          description: >-
            Input passed to every run this trigger creates, matching the task's
            `input_schema`.
        skip_if:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TriggerSkipIf'
          description: Skip condition evaluated per credential before a run is created.
        concurrency_max:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
          description: >-
            Maximum simultaneous runs from this trigger. `null` means no
            per-trigger cap.
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was created.
        updated_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the resource was last updated.
        request_id:
          type: string
          description: >-
            Unique identifier for the API request. Include this when contacting
            support.
      description: >-
        A trigger object. Triggers create task runs on a schedule across a set
        of credentials.
    ValidationErrorResponse:
      required:
        - errors
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
          description: RFC 9110 problem type URI.
        title:
          type:
            - 'null'
            - string
          description: Short summary of the validation failure.
        status:
          type:
            - 'null'
            - integer
          description: HTTP status code.
          format: int32
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Validation errors grouped by field name.
        traceId:
          type:
            - 'null'
            - string
          description: Request trace identifier.
      description: Validation error returned for malformed requests (HTTP 400).
    ErrorResponse:
      required:
        - errors
        - request_id
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/TaskRunError'
          description: One or more errors that describe what went wrong.
        request_id:
          type: string
          description: Unique identifier for this request, useful for tracing.
      description: Standard error response.
    TriggerCondition:
      required:
        - type
        - cron
        - timezone
      type: object
      properties:
        type:
          type: string
          description: The condition type. Always `schedule`.
        cron:
          type: string
          description: >-
            Standard 5-field cron expression: minute, hour, day of month, month,
            day of week.
        timezone:
          type: string
          description: >-
            IANA timezone name the schedule is evaluated in (e.g.
            `America/New_York`). Day boundaries and DST shifts follow local
            time.
      description: 'When the trigger fires: a cron expression evaluated in a timezone.'
    TriggerCredentialFilter:
      required:
        - source_ids
        - status
      type: object
      properties:
        source_ids:
          type: array
          items:
            type: string
          description: >-
            Match credentials on any of these sources. IDs prefixed with `src_`.
            Pass `["*"]` to match every source in the organization; the wildcard
            must be the only entry.
        status:
          type: array
          items:
            type: string
          description: >-
            Allowlist of credential statuses to fan out to, typically
            `unverified` and `verified`. There is no default, and an empty list
            is rejected. `invalid` / `deleted` credentials never match.
      description: A scope of credentials, resolved each time the trigger fires.
    JsonElement:
      description: Arbitrary JSON value.
    TriggerSkipIf:
      required:
        - last_run
      type: object
      properties:
        last_run:
          $ref: '#/components/schemas/TriggerSkipLastRun'
      description: >-
        Skip condition evaluated per credential before a run is created. When
        met, the credential is skipped for that fire and no run is created.
    TaskRunError:
      required:
        - type
        - code
        - message
      type: object
      properties:
        type:
          type: string
          description: >-
            Error category (e.g. `source`, `auth`, `task`, `rate_limit`).
            Determines the class of failure.
        code:
          type: string
          description: Machine-readable error code. Use this for programmatic handling.
        message:
          type: string
          description: >-
            Human-readable explanation. Do not rely on this for logic — it may
            change.
        field:
          type:
            - 'null'
            - string
          description: The input field that caused the error, when applicable.
      description: Error details for a failed task run. Same structure as API-level errors.
    TriggerSkipLastRun:
      required:
        - result
        - within_seconds
      type: object
      properties:
        result:
          type: string
          description: 'Task run result to match: `success`, `failure`, or `unknown`.'
        within_seconds:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          format: int64
          description: Time window in seconds, measured back from the fire time.
      description: >-
        Skips a credential when its most recent completed run of the trigger's
        task finished with `result` within `within_seconds`.
  securitySchemes:
    BearerAuth:
      type: http
      description: Secret key (sk_live_...)
      scheme: bearer
      bearerFormat: JWT

````