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

# Subscribe to a Trigger

> Subscribe to a trigger on behalf of your user.



## OpenAPI

````yaml /actionkit/triggers/openapi.json POST /projects/{project_id}/trigger-subscriptions
openapi: 3.0.0
info:
  title: Triggers API
  version: 1.0.0
servers:
  - url: https://actionkit.useparagon.com
    description: US Cloud
security: []
paths:
  /projects/{project_id}/trigger-subscriptions:
    post:
      summary: Subscribe to Trigger
      description: >-
        Create a trigger subscription for this user/credential. Multiple
        subscriptions can be set up for the same trigger and credential.


        Responds only when the trigger subscription is created and set up, ready
        to receive events.
      operationId: subscribeToTrigger
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/CredentialHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                integration:
                  type: string
                  description: >-
                    The integration name for the trigger (e.g., salesforce,
                    hubspot)
                  example: salesforce
                type:
                  type: string
                  description: The trigger type to subscribe to
                  example: SALESFORCE_TRIGGER_RECORD_CREATED
                parameters:
                  type: object
                  description: >-
                    The parameter values to configure this trigger with. If you
                    are collecting these parameters from your users, learn more
                    about rendering UI elements for parameters in [User
                    Configuration](/actionkit/triggers/user-configuration).
                  additionalProperties: true
                  example:
                    recordType: Opportunity
                webhookOverride:
                  $ref: '#/components/schemas/WebhookOverride'
                  description: Optional. If defined, must have `url` specified.
              required:
                - integration
                - type
                - parameters
            example:
              integration: salesforce
              type: SALESFORCE_TRIGGER_RECORD_CREATED
              parameters:
                recordType: Opportunity
              webhookOverride:
                url: https://example.com
                headers: {}
                metadata: {}
      responses:
        '200':
          description: Success - Returns the created trigger subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerSubscription'
              example:
                id: <uuid>
                type: SALESFORCE_TRIGGER_RECORD_CREATED
                parameters:
                  recordType: Opportunity
                status: ACTIVE
                dateCreated: '2025-05-31T00:00:00Z'
                dateLastReceivedEvent: '2025-05-31T00:00:00Z'
                credentialId: <uuid>
                webhookOverride:
                  url: https://example.com
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missingParameters:
                  value:
                    message: >-
                      Required trigger parameters are missing: objectType,
                      filterFormula
                    status: 400
                multipleCredentials:
                  value:
                    message: >-
                      More than one account connected for salesforce. Pass
                      X-Paragon-Credential: [Credential UUID] in headers to
                      select an account to use when subscribing to this trigger.
                    status: 400
                missingWebhookUrl:
                  value:
                    message: >-
                      webhookOverride.url is required when webhookOverride is
                      defined
                    status: 400
      security:
        - BearerAuth: []
components:
  parameters:
    ProjectId:
      name: project_id
      in: path
      required: true
      schema:
        type: string
        description: Your Paragon Project ID
    CredentialHeader:
      name: X-Paragon-Credential
      in: header
      required: false
      schema:
        type: string
        format: uuid
        description: >-
          Specify a credential ID when multiple accounts are connected for the
          same integration
  schemas:
    WebhookOverride:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The webhook URL to receive trigger events
          example: https://example.com
        headers:
          type: object
          description: HTTP headers (case-insensitive) to pass with each webhook request
          additionalProperties:
            type: string
        metadata:
          type: object
          description: >-
            JSON object to include with webhook payload. This will be passed in
            the `triggerSubscriptionMetadata` field of incoming webhook events.
          additionalProperties: true
      required:
        - url
    TriggerSubscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The subscription ID
          example: <uuid>
        type:
          type: string
          description: The trigger type
          example: SALESFORCE_TRIGGER_RECORD_CREATED
        parameters:
          type: object
          description: The trigger configuration parameters
          additionalProperties: true
          example:
            recordType: Opportunity
        status:
          type: string
          enum:
            - ACTIVE
            - ERRORED
          description: >-
            ACTIVE: currently receiving events. ERRORED: errors checking for
            records or repeated webhook delivery issues resulted in the trigger
            being disabled.
        error:
          type: string
          description: The reason for an error (only present when status is ERRORED)
          example: >-
            Failed to check for new records after repeated failures. Last error:
            Request failed with 500 { ... error info ... }
        dateCreated:
          type: string
          format: date-time
          description: The date the subscription was created
          example: '2025-05-31T00:00:00Z'
        dateLastReceivedEvent:
          type: string
          format: date-time
          description: >-
            For polling triggers: date we last checked for new records. For
            webhook triggers: date we last received a webhook event.
          example: '2025-05-31T00:00:00Z'
        credentialId:
          type: string
          format: uuid
          description: The credential ID associated with this subscription
          example: <uuid>
        webhookOverride:
          $ref: '#/components/schemas/WebhookOverride'
          description: Undefined if no webhook override is set for this subscription
      required:
        - id
        - type
        - parameters
        - status
        - dateCreated
        - dateLastReceivedEvent
        - credentialId
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message
        code:
          type: string
          description: Error code
        status:
          type: integer
          description: HTTP status code
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Your [Paragon User
        Token](/getting-started/installing-the-connect-sdk#setup) (JWT), which
        you can generate using your project's signing keys.

````