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

# Create webhook configuration

> Create a new webhook endpoint configuration.

Creates a webhook with an auto-generated signing secret. The secret is
returned only in this response - store it securely immediately.



## OpenAPI

````yaml openapi.json post /v1/webhooks
openapi: 3.1.0
info:
  title: DocIntell API
  description: >-

    # DocIntell API


    **Turn Documents into Data. Keep the Source Safe.**


    Financial document intelligence platform that turns PDFs into queryable data
    while keeping source files secure and compliant.


    ## Features


    - **Document Ingestion**: Upload PDFs with SEC 17a-4 compliant immutable
    storage

    - **Schema Projection**: Query extracted data with custom schemas (not data
    dumps!)

    - **Multi-Schema Support**: Same document, multiple query patterns

    - **Webhook Delivery**: Async notifications on job completion

    - **Row-Level Security**: Multi-tenant isolation built-in


    ## Authentication


    All API endpoints (except `/health`, `/`, `/docs`, and `/redoc`) require API
    key authentication.


    Include your API key in the `Authorization` header:


    ```

    Authorization: Bearer dk_live_<your_key>

    ```


    Test keys start with `dk_test_`, production keys with `dk_live_`.


    ## Rate Limiting


    Per-tenant rate limits:

    - **Document ingestion**: 100 documents/hour

    - **Projection queries**: 1,000 requests/hour

    - **Schema operations**: 10 creates/hour


    Rate limit info is returned in response headers:

    - `X-RateLimit-Limit`: Maximum requests allowed

    - `X-RateLimit-Remaining`: Remaining requests in window

    - `X-RateLimit-Reset`: Unix timestamp when limit resets


    ## Error Handling


    All errors follow RFC 7807 Problem Details format:


    ```json

    {
      "error": "error_code",
      "message": "Human-readable description",
      "details": {}
    }

    ```


    Common error codes:

    - `unauthorized` (401): Missing or invalid API key

    - `rate_limit_exceeded` (429): Too many requests

    - `invalid_file_type` (400): Only PDFs supported

    - `file_too_large` (413): File exceeds size limit (default 100MB,
    configurable via MAX_UPLOAD_SIZE_MB)

    - `job_not_found` (404): Job ID doesn't exist or doesn't belong to tenant


    ## Getting Started


    1. Obtain API key from dashboard

    2. Upload PDF: `POST /v1/documents`

    3. Poll status: `GET /v1/documents/{document_id}/status`

    4. Query results: `POST /v1/documents/{document_id}/project`


    Full documentation: [https://docs.docintel.com](https://docs.docintel.com)
        
  contact:
    name: DocIntell Support
    url: https://docintel.com/support
    email: support@docintel.com
  license:
    name: Proprietary
    url: https://docintel.com/terms
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
  - url: https://api.docintell.com
    description: Production API
  - url: https://api-staging.docintell.com
    description: Staging environment
security:
  - bearerAuth: []
tags:
  - name: health
    description: Health check operations. Verify service and dependency connectivity.
    x-mint-tag-group: System
  - name: api_keys
    description: API key management operations. Create, list, and revoke API keys.
    x-mint-tag-group: Management
  - name: documents
    description: Document ingestion operations. Upload PDFs for extraction.
    x-mint-tag-group: Core
  - name: jobs
    description: >-
      Job status and query operations. Check extraction status and query
      results.
    x-mint-tag-group: Core
  - name: document-types
    description: >-
      Document type schemas. List and retrieve extraction schema definitions for
      financial document types.
  - name: webhooks
    description: >-
      Webhook configuration management. Create, update, and manage webhook
      endpoints for job completion notifications.
    x-mint-tag-group: Integrations
  - name: stats
    description: Analytics and metrics endpoints. Get document, job, and schema statistics.
  - name: views
    description: >-
      View management for consumption layer. Define field subsets for querying
      extraction data.
paths:
  /v1/webhooks:
    post:
      tags:
        - webhooks
      summary: Create webhook configuration
      description: |-
        Create a new webhook endpoint configuration.

        Creates a webhook with an auto-generated signing secret. The secret is
        returned only in this response - store it securely immediately.
      operationId: create_webhook_config_v1_webhooks_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookConfigRequest'
        required: true
      responses:
        '201':
          description: New webhook config with signing secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateWebhookConfigRequest:
      properties:
        url:
          type: string
          maxLength: 2048
          minLength: 1
          title: Url
          description: HTTPS webhook endpoint URL
        events:
          items:
            type: string
            enum:
              - document.uploaded
              - document.processing.completed
              - document.processing.failed
          type: array
          title: Events
          description: List of event types to subscribe to
          default:
            - document.processing.completed
            - document.processing.failed
        is_active:
          type: boolean
          title: Is Active
          description: Whether the webhook is active
          default: true
        retry_enabled:
          type: boolean
          title: Retry Enabled
          description: Whether to retry failed deliveries
          default: true
        max_retries:
          type: integer
          maximum: 10
          minimum: 0
          title: Max Retries
          description: Maximum retry attempts (0-10)
          default: 5
      type: object
      required:
        - url
      title: CreateWebhookConfigRequest
      description: >-
        Request schema for creating a webhook configuration (POST /v1/webhooks).


        A cryptographically secure signing secret will be auto-generated.

        The secret is returned only in the creation response.


        Configure webhook endpoints once and receive notifications for all
        subscribed

        events. This follows the Stripe/Clerk pattern for webhook management.


        Attributes:
            url: HTTPS webhook endpoint URL
            events: List of event types to subscribe to (default: document.processing.completed, document.processing.failed)
            is_active: Whether the webhook is active (default: True)
            retry_enabled: Whether to retry failed deliveries (default: True)
            max_retries: Maximum retry attempts (default: 5)

        Available Events:
            - document.uploaded: Document successfully uploaded and queued
            - document.processing.completed: Extraction completed successfully
            - document.processing.failed: Extraction failed with error
      examples:
        - events:
            - document.processing.completed
            - document.processing.failed
          is_active: true
          max_retries: 5
          retry_enabled: true
          url: https://customer.com/webhooks/docintel
    CreateWebhookConfigResponse:
      properties:
        webhook_config_id:
          type: string
          format: uuid
          title: Webhook Config Id
          description: Unique webhook configuration identifier
        url:
          type: string
          title: Url
          description: HTTPS webhook endpoint URL
        signing_secret:
          type: string
          title: Signing Secret
          description: >-
            Webhook signing secret for HMAC verification (SHOWN ONLY IN THIS
            RESPONSE)
        events:
          items:
            type: string
          type: array
          title: Events
          description: List of event types subscribed to
        is_active:
          type: boolean
          title: Is Active
          description: Whether the webhook is active
        retry_enabled:
          type: boolean
          title: Retry Enabled
          description: Whether to retry failed deliveries
        max_retries:
          type: integer
          title: Max Retries
          description: Maximum retry attempts
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Configuration creation timestamp (ISO 8601)
      type: object
      required:
        - webhook_config_id
        - url
        - signing_secret
        - events
        - is_active
        - retry_enabled
        - max_retries
        - created_at
      title: CreateWebhookConfigResponse
      description: >-
        Response for newly created webhook configuration (includes signing
        secret).


        WARNING: The signing_secret field is shown only in this response.

        Store it securely immediately - it cannot be retrieved again.


        Available Events:
            - document.uploaded: Document successfully uploaded and queued
            - document.processing.completed: Extraction completed successfully
            - document.processing.failed: Extraction failed with error
      examples:
        - created_at: '2024-01-15T10:30:00Z'
          events:
            - document.processing.completed
            - document.processing.failed
          is_active: true
          max_retries: 5
          retry_enabled: true
          signing_secret: whsec_abcdefghijklmnopqrstuvwxyz1234567890ABC
          url: https://customer.com/webhooks/docintel
          webhook_config_id: 550e8400-e29b-41d4-a716-446655440000
    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:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key authentication. Format: dk_test_<key> or dk_live_<key>'

````