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

# Trigger Workflow

> Trigger an API-triggered workflow for a specific contact.



## OpenAPI

````yaml /openapi.json post /v2/workflows/{workflowId}/trigger
openapi: 3.1.0
info:
  title: Conversion API
  version: 2.0.0
  description: >-
    The Conversion API lets you programmatically manage contacts, track custom
    events, and manage their associated data.
servers:
  - url: https://pub-api.conversion.ai/api
security:
  - apiKey: []
paths:
  /v2/workflows/{workflowId}/trigger:
    post:
      summary: Trigger Workflow
      description: Trigger an API-triggered workflow for a specific contact.
      operationId: triggerWorkflow
      parameters:
        - name: workflowId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the workflow to trigger.
          examples:
            example:
              value: d4e5f6a7-b8c9-0123-def0-456789abcdef
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: >-
                    The contact's email address. At least one of `cnvContactId`,
                    `userId`, or `email` is required.
                  examples:
                    - jane@example.com
                cnvContactId:
                  type: string
                  format: uuid
                  description: >-
                    The Conversion contact ID. At least one of `cnvContactId`,
                    `userId`, or `email` is required.
                  examples:
                    - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                userId:
                  type: string
                  description: >-
                    An external user identifier for the contact. At least one of
                    `cnvContactId`, `userId`, or `email` is required.
                  examples:
                    - user_12345
                data:
                  type: object
                  additionalProperties: {}
                  description: >-
                    An optional map of custom data to pass to the workflow as
                    trigger data.
                  examples:
                    - source: backend
                      action: onboarding_complete
                      plan: pro
                      trial_days_remaining: 7
            examples:
              trigger-by-email:
                summary: Trigger by email
                value:
                  email: jane@example.com
                  data:
                    form_id: contact_us
                    page_url: https://example.com/pricing
                    message: Interested in enterprise plan
              trigger-by-contact-id:
                summary: Trigger by contact ID
                value:
                  cnvContactId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  data:
                    source: backend
                    action: onboarding_complete
                    plan: pro
                    trial_days_remaining: 7
              trigger-by-userId:
                summary: Trigger by userId
                value:
                  userId: user_12345
                  data:
                    event: plan_upgraded
                    old_plan: starter
                    new_plan: pro
                    annual: true
      responses:
        '200':
          description: Workflow triggered successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    required:
                      - triggered
                    properties:
                      triggered:
                        type: boolean
                        description: '`true` if the workflow was successfully triggered.'
              examples:
                triggered:
                  summary: Workflow triggered
                  value:
                    data:
                      triggered: true
        '400':
          description: The request was malformed or the workflow cannot be triggered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing-identifier:
                  summary: Missing identifier
                  value:
                    error:
                      code: missing_identifier
                      message: >-
                        at least one of 'cnvContactId', 'userId', or 'email' is
                        required
                workflow-not-active:
                  summary: Workflow not active
                  value:
                    error:
                      code: workflow_not_active
                      message: workflow is not active
                invalid-trigger-type:
                  summary: Invalid trigger type
                  value:
                    error:
                      code: invalid_trigger_type
                      message: workflow trigger type is not API
                contact-not-eligible:
                  summary: Contact not eligible
                  value:
                    error:
                      code: contact_not_eligible
                      message: contact did not meet eligibility criteria
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  summary: Missing or invalid API key
                  value:
                    error:
                      code: unauthorized
                      message: API key is required
        '404':
          description: The workflow or contact was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                workflow-not-found:
                  summary: Workflow not found
                  value:
                    error:
                      code: workflow_not_found
                      message: workflow not found
                contact-not-found:
                  summary: Contact not found
                  value:
                    error:
                      code: contact_not_found
                      message: contact not found
        '409':
          description: The provided identifiers conflict with an existing contact.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                conflicting-identifier:
                  summary: Conflicting identifier
                  value:
                    error:
                      code: conflicting_identifier
                      message: contact found by email but has a different userId
        '500':
          description: An unexpected server error occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                internal:
                  summary: Internal error
                  value:
                    error:
                      code: internal_error
                      message: failed to trigger workflow
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: A machine-readable error code.
              examples:
                - invalid_email
            message:
              type: string
              description: A human-readable error description.
              examples:
                - 'invalid email format: not-an-email'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your Conversion API key. Found in **Settings > Integrations** in the
        dashboard. Format: `sk_live_<key_id>_<secret>`.

````