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

# List webhooks



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/webhooks
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /fleets/{fleetId}/webhooks:
    get:
      tags:
        - Webhooks
      summary: List webhooks
      parameters:
        - schema:
            type: string
            minLength: 1
            example: fleet_abc123
          required: true
          in: path
          name: fleetId
        - schema:
            type: string
            description: Opaque pagination cursor returned by a previous request.
            example: cursor_abc123
          required: false
          description: Opaque pagination cursor returned by a previous request.
          name: cursor
          in: query
        - schema:
            type: string
            description: >-
              Maximum number of items to return. Defaults to 20 and preserves
              parseInt semantics.
            example: '20'
          required: false
          description: >-
            Maximum number of items to return. Defaults to 20 and preserves
            parseInt semantics.
          name: limit
          in: query
      responses:
        '200':
          description: Webhook subscriptions configured for the fleet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSubscriptionsPage'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not authorized for this fleet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Fleet or webhook subscription not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Webhook subscription conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Cerca from '@cerca-dev/sdk';


            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const webhookSubscription of
            client.webhooks.list('fleet_abc123')) {
              console.log(webhookSubscription.id);
            }
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            page = client.webhooks.list(
                fleet_id="fleet_abc123",
            )
            page = page.subscriptions[0]
            print(page.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Webhooks.List(\n\t\tcontext.TODO(),\n\t\t\"fleet_abc123\",\n\t\tcercago.WebhookListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Ruby
          source: |-
            require "cerca"

            cerca = Cerca::Client.new(api_key: "My API Key")

            page = cerca.webhooks.list("fleet_abc123")

            puts(page)
        - lang: CLI
          source: |-
            cerca webhooks list \
              --api-key 'My API Key' \
              --fleet-id fleet_abc123
components:
  schemas:
    WebhookSubscriptionsPage:
      type: object
      properties:
        cursor:
          type:
            - string
            - 'null'
        hasMore:
          type: boolean
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/WebhookSubscription'
      required:
        - cursor
        - hasMore
        - subscriptions
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
    WebhookSubscription:
      type: object
      properties:
        createdAt:
          type: string
        enabled:
          type: boolean
        fleetId:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        id:
          type: string
        updatedAt:
          type: string
        url:
          type: string
      required:
        - createdAt
        - enabled
        - fleetId
        - events
        - id
        - updatedAt
        - url
      description: >-
        Webhook subscription metadata returned by list, get, and update. The
        one-time signing secret is not returned here.
    WebhookEventType:
      type: string
      enum:
        - agent.created
        - agent.updated
        - agent.deleted
        - thread.created
        - thread.status.changed
        - thread.completed
        - thread.failed
        - turn.created
        - turn.completed
        - turn.failed
        - message.created
        - approval.requested
        - approval.resolved
        - approval.granted
        - schedule.created
        - schedule.deleted
        - schedule.triggered
        - connection.attached
        - connection.detached
        - webhook.test
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````