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

# Create a webhook

> Creates a webhook config bound to a Definition you own, mints an HMAC signing secret, and stores it in secure secret storage. The `signing_secret` is returned **exactly once** in this response — store it now, it is never shown again. On a secret-storage failure the record is rolled back and 503 is returned.



## OpenAPI

````yaml /openapi.json post /webhooks
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /webhooks:
    post:
      tags:
        - webhooks
      summary: Create a webhook
      description: >-
        Creates a webhook config bound to a Definition you own, mints an HMAC
        signing secret, and stores it in secure secret storage. The
        `signing_secret` is returned **exactly once** in this response — store
        it now, it is never shown again. On a secret-storage failure the record
        is rolled back and 503 is returned.
      operationId: create_webhook_webhooks_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookConfigCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookConfigCreateResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Admin role required
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: Not found — also returned on cross-tenant access (never 403)
          content:
            application/json:
              example:
                detail: Definition not found
        '422':
          description: Validation error (see body for field details)
          content:
            application/json:
              example:
                detail: Validation error
        '429':
          description: Rate limit exceeded — retry after the Retry-After header
          content:
            application/json:
              example:
                detail: Rate limit exceeded
        '503':
          description: Secret storage operation failed
          content:
            application/json:
              example:
                detail: Webhook secret create failed, record cleaned up
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    WebhookConfigCreate:
      properties:
        definition_id:
          type: string
          title: Definition Id
        description:
          type: string
          maxLength: 200
          minLength: 1
          title: Description
        mode:
          type: string
          enum:
            - trigger
            - resume
          title: Mode
          default: trigger
        provider:
          type: string
          enum:
            - standard
            - stripe
            - five9
            - custom
          title: Provider
          default: standard
        input_template:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Template
        dispatch_retry:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Dispatch Retry
        rate_limit:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Rate Limit
        enabled:
          type: boolean
          title: Enabled
          default: true
      additionalProperties: false
      type: object
      required:
        - definition_id
        - description
      title: WebhookConfigCreate
      description: POST /webhooks body. Admin-authored; sender never touches this surface.
      example:
        definition_id: def_a1b2c3d4
        description: Inbound Stripe payment webhook
        enabled: true
        input_template:
          amount: '{{ payload.data.object.amount }}'
        mode: trigger
        provider: standard
        rate_limit: 1000
    WebhookConfigCreateResponse:
      properties:
        id:
          type: string
          title: Id
        definition_id:
          type: string
          title: Definition Id
        org_id:
          type: string
          title: Org Id
        description:
          type: string
          title: Description
        mode:
          type: string
          title: Mode
        provider:
          type: string
          title: Provider
        input_template:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Template
        dispatch_retry:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Dispatch Retry
        rate_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rate Limit
        enabled:
          type: boolean
          title: Enabled
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        signing_secret:
          type: string
          title: Signing Secret
        receive_url:
          type: string
          title: Receive Url
      type: object
      required:
        - id
        - definition_id
        - org_id
        - description
        - mode
        - provider
        - input_template
        - dispatch_retry
        - rate_limit
        - enabled
        - created_at
        - updated_at
        - signing_secret
        - receive_url
      title: WebhookConfigCreateResponse
      description: |-
        POST response — the ONLY place the signing secret + receive URL appear.

        Show-once at create (and on explicit rotate); the read model omits both.
      example:
        created_at: '2026-07-09T09:00:00Z'
        definition_id: def_a1b2c3d4
        description: Inbound Stripe payment webhook
        enabled: true
        id: wh_1a2b3c4d5e6f
        mode: trigger
        org_id: org_e5f6g7h8
        provider: standard
        rate_limit: 1000
        receive_url: /webhooks/acme/wh_1a2b3c4d5e6f
        signing_secret: whsec_...
        updated_at: '2026-07-09T09:00:00Z'
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````