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

# Create Webhook



## OpenAPI

````yaml POST /v1/subscriptions/webhooks
openapi: 3.1.0
info:
  title: Well Document API
  version: 1.0.0
  description: API for uploading and managing financial documents in the Well platform
servers:
  - url: https://api.wellapp.ai
security: []
paths:
  /v1/subscriptions/webhooks:
    post:
      summary: Create webhook subscription
      parameters:
        - $ref: '#/components/parameters/AuthorizationHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookSubscription'
            example:
              type: webhook
              attributes:
                target_url: https://webhook.site/d96a94d9-8458-4956-857e-11c85843baa2
                event: document.processed
                headers:
                  secret: secret
      responses:
        '200':
          description: Subscription created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
              example:
                data:
                  type: webhook
                  id: 6843888f-1aa5-440b-afac-b0edca649ad2
                  attributes:
                    event: document.processed
                    target_url: https://webhook.site/d96a94d9-8458-4956-857e-11c85843baa2
                    headers:
                      secret: secret
                    created_at: '2025-09-22T08:57:03.662Z'
                    active: true
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized - invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      schema:
        type: string
      description: Bearer token for authentication
  schemas:
    WebhookSubscription:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              const: webhook
            attributes:
              type: object
              properties:
                event:
                  type: string
                  enum:
                    - document.processed
                  description: The event type to subscribe to
                target_url:
                  type: string
                  format: uri
                  description: The URL where webhook events will be sent
                headers:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: string
              required:
                - event
                - target_url
              additionalProperties: false
          required:
            - type
            - attributes
          additionalProperties: false
      required:
        - data
      additionalProperties: false
    WebhookResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              const: webhook
            id:
              type: string
              format: uuid
              description: UUID of the webhook subscription
            attributes:
              type: object
              properties:
                event:
                  type: string
                  enum:
                    - document.processed
                  description: The event type subscribed to
                target_url:
                  type: string
                  format: uri
                  description: The URL where webhook events will be sent
                headers:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties:
                    type: string
                  description: Headers that will be included with webhook requests
                created_at:
                  type: string
                  format: date-time
                  description: Timestamp when the webhook was created
                active:
                  type: boolean
                  description: Whether the webhook subscription is active
              additionalProperties: false
          additionalProperties: false
      additionalProperties: false
    BadRequestError:
      type: object
      properties:
        code:
          type: string
          example: SCHEMA_VALIDATION_ERROR
          description: Error code identifier
        status:
          type: integer
          example: 400
          description: HTTP status code
        title:
          type: string
          example: Validation Error
          description: Error title
        message:
          type: string
          example: The request is invalid
          description: Detailed error message
        details:
          type: array
          items:
            type: object
            properties:
              instancePath:
                type: string
                description: Path to the invalid field in the request
              schemaPath:
                type: string
                description: Path to the validation rule in the schema
              keyword:
                type: string
                description: Validation keyword that failed
              params:
                type: object
                description: Parameters related to the validation failure
              message:
                type: string
                description: Human-readable validation error message
          description: Array of detailed validation errors
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta
    UnauthorizedError:
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
          description: Error code identifier
        status:
          type: integer
          example: 401
          description: HTTP status code
        title:
          type: string
          example: Unauthorized
          description: Error title
        message:
          type: string
          example: You are not authorized to access this resource
          description: Detailed error message
        meta:
          type: object
          properties:
            log_id:
              type: string
              format: uuid
              example: 65c669d4-679c-4a8b-b8c0-fbe37699bb5b
              description: Unique identifier for tracking this error in logs
          required:
            - log_id
      required:
        - code
        - status
        - title
        - message
        - meta

````