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

# Trigger a workflow via webhook

> Executes a workflow using a webhook URL with the API key embedded in the path. Designed for third-party services that cannot set custom headers (Slack, Discord, Linear, Zoom, etc.).

Supports the same two execution modes as the API trigger:

- **Asynchronous** (default): Returns immediately with an empty (`null`) response body. Use `X-Pf-Run-Id` and `X-Pf-Automation-Id` response headers to [poll for results](/api-reference/async-polling).

- **Synchronous**: Set `x-api-wait: true`. Waits up to 60 seconds for results.

**Note**: Webhook triggers support JSON and form-encoded data only. File attachments are not supported.



## OpenAPI

````yaml post /ext/webhook/{apiKey}/triggers/{triggerId}
openapi: 3.0.1
info:
  title: AI Workflow API
  description: API for triggering and managing AI-powered workflows
  version: 1.0.0
servers:
  - url: https://triggers.app.pinkfish.ai
security:
  - apiKeyAuth: []
paths:
  /ext/webhook/{apiKey}/triggers/{triggerId}:
    post:
      summary: Trigger a workflow via webhook
      description: >-
        Executes a workflow using a webhook URL with the API key embedded in the
        path. Designed for third-party services that cannot set custom headers
        (Slack, Discord, Linear, Zoom, etc.).


        Supports the same two execution modes as the API trigger:


        - **Asynchronous** (default): Returns immediately with an empty (`null`)
        response body. Use `X-Pf-Run-Id` and `X-Pf-Automation-Id` response
        headers to [poll for results](/api-reference/async-polling).


        - **Synchronous**: Set `x-api-wait: true`. Waits up to 60 seconds for
        results.


        **Note**: Webhook triggers support JSON and form-encoded data only. File
        attachments are not supported.
      parameters:
        - name: apiKey
          in: path
          required: true
          schema:
            type: string
          description: The API key for authentication (embedded in URL)
        - name: triggerId
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the trigger
        - name: x-api-wait
          in: header
          required: false
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
          description: >-
            Set to `true` for synchronous execution (waits up to 60 seconds for
            results). Set to `false` or omit for asynchronous (fire-and-forget)
            execution.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              event: issue_created
              issue_id: '12345'
      responses:
        '200':
          description: >-
            Workflow triggered successfully.


            **Async mode** (`x-api-wait: false`): Response body is `null`. Use
            the `X-Pf-Run-Id` and `X-Pf-Automation-Id` headers to [poll for
            results](/api-reference/async-polling).


            **Sync mode** (`x-api-wait: true`): Response body contains the full
            workflow results if completed within 60 seconds.
          headers:
            X-Pf-Run-Id:
              schema:
                type: string
              description: >-
                The unique identifier for this workflow run. Use this to poll
                for status and results.
            X-Pf-Automation-Id:
              schema:
                type: string
              description: >-
                The automation/workflow ID. Use this together with `X-Pf-Run-Id`
                to poll for status and results.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      required:
        - error
        - message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````