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

# List Webhooks

> List all active webhook subscriptions

The `secret` field is excluded from list responses — it's only returned once, on create.

<Note>
  This endpoint returns a flat array, not a paginated response.
</Note>

<RequestExample>
  ```bash curl theme={null}
  curl -X GET 'https://api.anyformat.ai/v2/webhooks/' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python (requests) theme={null}
  import requests

  url = "https://api.anyformat.ai/v2/webhooks/"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  webhooks = response.json()
  for webhook in webhooks:
      print(f"{webhook['id']}: {webhook['url']} ({webhook['events']})")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.anyformat.ai/v2/webhooks/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(data);
  ```

  ```typescript TypeScript theme={null}
  interface WebhookListItem {
    id: string;
    url: string;
    events: string[];
    is_active: boolean;
    created_at: string;
  }

  const response = await fetch('https://api.anyformat.ai/v2/webhooks/', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  if (!response.ok) {
    throw new Error(`API error: ${response.status}`);
  }

  const webhooks: WebhookListItem[] = await response.json();
  console.log(webhooks);
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200 OK) theme={null}
  [
    {
      "id": "wh_1234567890",
      "url": "https://your-server.com/webhooks/anyformat",
      "events": ["extraction.completed", "extraction.failed"],
      "is_active": true,
      "created_at": "2024-03-24T12:00:00.000Z"
    }
  ]
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v2/webhooks/
openapi: 3.1.0
info:
  title: AnyFormat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat lets you define extraction workflows that pull structured data
    from any document — PDFs, images, scanned files, or plain text. Upload a
    file, run it through a workflow, and get back structured fields with
    confidence scores and source evidence.


    ## Quick start


    1. **Create a workflow** in the [AnyFormat
    dashboard](https://app.anyformat.ai) and define the fields you want to
    extract.

    2. **Run the workflow** via `POST /v2/workflows/{workflow_id}/run/` with a
    file attached.

    3. **Fetch results** via `GET
    /v2/workflows/{workflow_id}/files/{collection_id}/results/` once processing
    completes.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/settings](https://app.anyformat.ai/settings).


    ## Versioning


    All endpoints use the `/v2/` path prefix. All responses include
    `X-API-Version`.
  version: 2.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
tags:
  - name: workflows
    description: >-
      Workflows define extraction templates — what fields to extract from
      documents. Create workflows, upload files, run extractions, and fetch
      results.
  - name: files
    description: >-
      File collections group uploaded documents and track their extraction
      progress. Upload files, check status, and retrieve extraction results.
  - name: webhooks
    description: >-
      Webhook subscriptions for asynchronous event notifications. Get notified
      when extractions complete or fail.
  - name: health
    description: Health check endpoints to verify API availability.
paths:
  /v2/webhooks/:
    get:
      tags:
        - webhooks
      summary: List webhooks
      description: |-
        List all webhook subscriptions for the authenticated organization.

        Returns a list of webhooks. Secrets are excluded from the list response
        for security — they are only returned once, when the webhook is created.
      operationId: list_webhooks_v2_webhooks__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/WebhookListItem'
                type: array
                title: Response List Webhooks V2 Webhooks  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WebhookListItem:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the webhook.
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: The URL receiving webhook events.
          examples:
            - https://example.com/webhooks/anyformat
        events:
          items:
            type: string
          type: array
          title: Events
          description: Event types this webhook is subscribed to.
          examples:
            - - extraction.completed
              - extraction.failed
        is_active:
          type: boolean
          title: Is Active
          description: Whether the webhook is currently active.
          examples:
            - true
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when the webhook was created (ISO 8601).
      type: object
      required:
        - id
        - url
        - events
        - is_active
        - created_at
      title: WebhookListItem
      description: Webhook subscription details (secret excluded for security).
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/settings. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````