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

# Post v1webhooks



## OpenAPI

````yaml /api-reference/openapi.json post /v1/webhooks
openapi: 3.0.1
info:
  title: Fatorly Integration
  version: v1
servers:
  - url: https://integration.fatorly.com
    description: Production
  - url: https://integration.sandbox.fatorly.com
    description: Sandbox
security:
  - ApiKey: []
tags:
  - name: CreditNotes
  - name: Customers
  - name: Invoices
  - name: Items
  - name: PurchaseCreditNotes
  - name: PurchaseInvoices
  - name: Vendors
  - name: Webhooks
  - name: WhoAmi
  - name: EchoTest
  - name: ThrowTest
paths:
  /v1/webhooks:
    post:
      tags:
        - Webhooks
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V1CreateWebhookRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/V1CreateWebhookRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/V1CreateWebhookRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/V1WebhookCreated'
            application/json:
              schema:
                $ref: '#/components/schemas/V1WebhookCreated'
            text/json:
              schema:
                $ref: '#/components/schemas/V1WebhookCreated'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '401':
          description: Unauthorized — Missing or invalid X-Api-Key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '403':
          description: Forbidden — The API key lacks the scope this operation requires.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '422':
          description: Unprocessable Entity
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '429':
          description: >-
            Too Many Requests — Rate limit exceeded; retry after the Retry-After
            interval.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window (0 when rejected).
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
        '500':
          description: Internal Server Error — Unexpected server error; report the traceId.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemPayload'
components:
  schemas:
    V1CreateWebhookRequest:
      required:
        - targetUrl
        - eventTypes
      type: object
      properties:
        targetUrl:
          type: string
        eventTypes:
          type: array
          items:
            type: string
    V1WebhookCreated:
      required:
        - id
        - targetUrl
        - eventTypes
        - status
        - createdAt
        - secret
      type: object
      properties:
        id:
          type: string
        targetUrl:
          type: string
        eventTypes:
          type: array
          items:
            type: string
        status:
          enum:
            - Draft
            - Pending
            - Sent
            - DeliveryFailed
            - Received
          type: string
          description: >-
            Document status: Draft (created, not submitted), Pending (queued or
            being delivered over Peppol), Sent (delivered), DeliveryFailed
            (submission failed — see submissionError), Received (inbound
            purchase document).
          example: Draft
        createdAt:
          type: string
          format: date-time
        secret:
          type: string
    ProblemPayload:
      required:
        - type
        - title
        - status
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        traceId:
          type: string
          nullable: true
        errors:
          type: array
          nullable: true
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        Your fat_… integration key. Create one in Settings → Integrations → API
        Keys.
      name: X-Api-Key
      in: header

````