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

# Subscribe to webhook events

> Creates a webhook endpoint that receives HTTP POST notifications when specified events occur.



## OpenAPI

````yaml /openapi.json post /webhooks
openapi: 3.1.1
info:
  title: Heffl Public API (Legacy v1)
  version: 1.0.0
  description: >-
    Legacy Heffl REST API v1. Maintained for existing integrations. For new
    projects, use API v2 at https://docs.heffl.com/api-v2/introduction.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v1
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Subscribe to webhook events
      description: >-
        Creates a webhook endpoint that receives HTTP POST notifications when
        specified events occur.
      operationId: webhooks.subscribe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  description: 'Webhook name (e.g. ''Zapier: New Lead'')'
                url:
                  type: string
                  format: uri
                  description: URL to receive webhook POST requests
                events:
                  type: array
                  minItems: 1
                  items:
                    type: string
                  description: Events to subscribe to
              required:
                - name
                - url
                - events
              additionalProperties: {}
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Webhook endpoint public ID
                  name:
                    type: string
                  url:
                    type: string
                  events:
                    type: array
                    items:
                      type: string
                  status:
                    type: string
                  secret:
                    type: string
                    description: Signing secret (one-time reveal)
                  createdAt:
                    type: string
                    format: date-time
                    x-native-type: date
                required:
                  - id
                  - name
                  - url
                  - events
                  - status
                  - secret
                  - createdAt
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````