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

# Create Webhook Public

> Create a new webhook.

**Required scope:** `write`

**Important:** The webhook secret is only returned once on creation.
Store it securely to verify webhook signatures.

**Signature verification (Python example):**
```python
import hmac
import hashlib

def verify_signature(payload: str, secret: str, signature: str) -> bool:
    expected = hmac.new(
        secret.encode(),
        payload.encode(),
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)
```

**Headers sent with webhooks:**
- `X-Quikly-Event`: Event type (e.g., "proposal.created")
- `X-Quikly-Signature`: HMAC-SHA256 signature of the payload
- `X-Quikly-Timestamp`: Unix timestamp
- `X-Quikly-Webhook-Id`: ID of the webhook configuration



## OpenAPI

````yaml /openapi/openapi-external.json post /webhooks
openapi: 3.1.0
info:
  title: Quikly.ai External API
  version: 1.0.0
  description: >-
    REST API for external integrations with Quikly.ai. Authenticate using an API
    key passed in the X-API-Key header. Use these endpoints from n8n, Zapier,
    custom scripts, or any HTTP client.
servers: []
security:
  - ApiKeyAuth: []
tags:
  - name: Proposals
    description: Create, read, update, and manage client proposals.
  - name: Profile
    description: Read and update the authenticated user's profile.
  - name: Templates
    description: Manage reusable proposal templates.
  - name: AI Services
    description: >-
      AI-powered analysis: rate recommendations, brief analysis,
      differentiators.
  - name: Public API
  - name: Usage
    description: Query API usage and quota information.
  - name: Webhooks
    description: Manage webhook subscriptions for real-time events.
  - name: Agent
    description: Interact with the AI agent for automated workflows.
  - name: Lead Sessions
    description: Track and manage lead capture sessions.
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create Webhook Public
      description: |-
        Create a new webhook.

        **Required scope:** `write`

        **Important:** The webhook secret is only returned once on creation.
        Store it securely to verify webhook signatures.

        **Signature verification (Python example):**
        ```python
        import hmac
        import hashlib

        def verify_signature(payload: str, secret: str, signature: str) -> bool:
            expected = hmac.new(
                secret.encode(),
                payload.encode(),
                hashlib.sha256
            ).hexdigest()
            return hmac.compare_digest(expected, signature)
        ```

        **Headers sent with webhooks:**
        - `X-Quikly-Event`: Event type (e.g., "proposal.created")
        - `X-Quikly-Signature`: HMAC-SHA256 signature of the payload
        - `X-Quikly-Timestamp`: Unix timestamp
        - `X-Quikly-Webhook-Id`: ID of the webhook configuration
      operationId: create_webhook_public_api_external_v1_webhooks_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSecretResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    WebhookCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Webhook name
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: URL to receive webhook notifications
        events:
          items:
            type: string
          type: array
          minItems: 1
          title: Events
          description: Events to subscribe to
      type: object
      required:
        - name
        - url
        - events
      title: WebhookCreate
      description: Schema for creating a new webhook.
      example:
        events:
          - proposal.created
          - proposal.status_changed
        name: My n8n Automation
        url: https://my-n8n.example.com/webhook/quikly
    WebhookSecretResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
        secret:
          type: string
          title: Secret
        events:
          items:
            type: string
          type: array
          title: Events
        isActive:
          type: boolean
          title: Isactive
        createdAt:
          type: string
          format: date-time
          title: Createdat
      type: object
      required:
        - id
        - name
        - url
        - secret
        - events
        - isActive
        - createdAt
      title: WebhookSecretResponse
      description: Schema for webhook response including secret (only on create).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key obtained from Quikly.ai Settings → API Keys.
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````