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

# Create a deployment trigger

> Create a GitHub deployment trigger for a Checkly check or check group.



## OpenAPI

````yaml post /v1/deployment-triggers
openapi: 3.0.0
info:
  title: Checkly Public API
  version: v1
  description: >-
    These are the docs for the newly released Checkly Public API. If you have
    any questions, please do not hesitate to get in touch with us.
servers:
  - url: https://api.checklyhq.com
security:
  - Bearer: []
tags: []
paths:
  /v1/deployment-triggers:
    post:
      tags:
        - Deployment Triggers
      summary: Create a deployment trigger
      description: >-
        Creates a deployment trigger that runs a check (or check group) whenever
        the linked GitHub repository reports a successful deployment. Set
        `useEnvironmentUrl` to run against the deployment’s `environment_url`,
        and `environmentRegexFilter` to restrict which environments trigger a
        run. Idempotent per check/group: a trigger that already exists for the
        same target is returned unchanged.
      operationId: postV1Deploymenttriggers
      parameters:
        - name: x-checkly-account
          in: header
          schema:
            type: string
            description: >-
              Your Checkly account ID, you can find it at
              https://app.checklyhq.com/settings/account/general
            x-format:
              guid: true
          description: >-
            Your Checkly account ID, you can find it at
            https://app.checklyhq.com/settings/account/general
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDeploymentTrigger'
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentTrigger'
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentTrigger'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
components:
  schemas:
    CreateDeploymentTrigger:
      type: object
      properties:
        checkId:
          type: string
          description: The ID of the check to run on deploy.
          nullable: true
          x-format:
            guid: true
        groupId:
          type: number
          description: The ID of the check group to run on deploy.
          nullable: true
          x-constraint:
            sign: positive
        repoId:
          description: The provider-side repository ID, e.g. GitHub’s numeric `id`.
          anyOf:
            - type: number
            - type: string
        repoName:
          type: string
          description: The repository name, e.g. `acme/storefront`.
        repoLink:
          type: string
          description: A link to the repository.
          default: ''
        useEnvironmentUrl:
          type: boolean
          description: >-
            Run the check against the deployment’s `environment_url` instead of
            its own target. API and URL checks get their host swapped; browser
            and multi-step checks receive it as the `ENVIRONMENT_URL`
            environment variable.
          default: true
        includeScreenshots:
          type: boolean
          description: Attach screenshots to the check run posted back to the commit.
          default: false
        provider:
          $ref: '#/components/schemas/provider'
        runLocation:
          $ref: '#/components/schemas/PublicDeploymentTriggerRunLocation'
        environmentRegexFilter:
          type: string
          description: >-
            Only deployments whose environment name matches this regular
            expression trigger a run, e.g. `^(?:Preview|staging)$`.
          default: null
          nullable: true
          maxLength: 255
        environmentUrlRegexFilter:
          type: string
          description: >-
            Only deployments whose environment URL matches this regular
            expression trigger a run.
          default: null
          nullable: true
          maxLength: 255
      required:
        - repoId
        - repoName
    DeploymentTrigger:
      type: object
      properties:
        id:
          type: number
          description: The deployment trigger ID.
        checkId:
          type: string
          description: The check this trigger runs.
          nullable: true
          x-format:
            guid: true
        groupId:
          type: number
          description: The check group this trigger runs.
          nullable: true
        provider:
          type: string
          description: The deployment provider. Always `GITHUB` for this endpoint.
        repoId:
          type: string
          description: The provider-side repository ID.
        repoName:
          type: string
          description: The repository name, e.g. `acme/storefront`.
        repoLink:
          type: string
          description: A link to the repository.
          nullable: true
        useEnvironmentUrl:
          type: boolean
          description: Whether the deployment’s `environment_url` is injected into the run.
        includeScreenshots:
          type: boolean
          description: Whether screenshots are attached to the posted check run.
        environmentRegexFilter:
          type: string
          description: >-
            Only deployments whose environment name matches this regex trigger a
            run.
          nullable: true
        environmentUrlRegexFilter:
          type: string
          description: >-
            Only deployments whose environment URL matches this regex trigger a
            run.
          nullable: true
        runLocation:
          type: string
          description: The region the triggered run executes in.
        created_at:
          type: string
          format: date
        updated_at:
          type: string
          format: date
          nullable: true
    UnauthorizedError:
      type: object
      properties:
        statusCode:
          type: number
          enum:
            - 401
        error:
          $ref: '#/components/schemas/error'
        message:
          type: string
          example: Bad Token
        attributes:
          $ref: '#/components/schemas/attributes'
      required:
        - statusCode
        - error
    ForbiddenError:
      type: object
      properties:
        statusCode:
          type: number
          enum:
            - 403
        error:
          $ref: '#/components/schemas/Model1'
        message:
          type: string
          example: Forbidden
      required:
        - statusCode
        - error
    NotFoundError:
      type: object
      properties:
        statusCode:
          type: number
          enum:
            - 404
        error:
          $ref: '#/components/schemas/Model3'
        message:
          type: string
          example: Not Found
      required:
        - statusCode
        - error
    provider:
      type: string
      description: The deployment provider. Only `GITHUB` is supported.
      default: GITHUB
      enum:
        - GITHUB
    PublicDeploymentTriggerRunLocation:
      type: string
      description: The region the triggered run executes in.
      default: us-east-1
      enum:
        - us-east-1
        - us-east-2
        - us-west-1
        - us-west-2
        - ca-central-1
        - sa-east-1
        - eu-west-1
        - eu-central-1
        - eu-west-2
        - eu-west-3
        - eu-north-1
        - eu-south-1
        - me-south-1
        - ap-southeast-1
        - ap-northeast-1
        - ap-east-1
        - ap-southeast-2
        - ap-southeast-3
        - ap-northeast-2
        - ap-northeast-3
        - ap-south-1
        - af-south-1
    error:
      type: string
      enum:
        - Unauthorized
    attributes:
      type: object
    Model1:
      type: string
      enum:
        - Forbidden
    Model3:
      type: string
      enum:
        - Not Found
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: Bearer
      description: >-
        The Checkly Public API uses API keys to authenticate requests. You can
        get the API Key
        [here](https://app.checklyhq.com/settings/user/api-keys). Your API key
        is like a password: keep it secure!

        Authentication to the API is performed using the Bearer auth method in
        the Authorization header and using the account ID.

        For example, set **Authorization** header while using cURL: `curl -H
        "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"` 

````