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

# Get Auto-deleted Webhooks

> Retrieve webhooks that Flabs deleted automatically because they returned no `2xx` response for 24 hours. These webhooks receive no events until you [restore](/webhooks/endpoint/reactivate_webhook) them. Webhooks you deleted yourself are not listed.

**Catch-all accounts:** returns the lab's auto-deleted webhooks. **Party-scoped accounts:** you MUST pass a party (`corporateUser` or `organization`) and only that party's webhooks are returned.

## Overview

List the webhooks that Flabs deleted automatically because they returned no `2xx` response for 24 hours. These webhooks receive no events. Use this endpoint to find the webhook you want to [restore](/webhooks/endpoint/reactivate_webhook) after fixing your endpoint.

Webhooks you deleted yourself with [Delete Webhook](/webhooks/endpoint/delete_webhook) are not listed. Active webhooks are returned by [Get All Webhooks](/webhooks/endpoint/get_all_webhooks).

## Endpoint

```
GET https://v2.flabs.in/client/events/getDeactivatedEvents?labID=<labID>
```

```bash theme={null}
curl --request GET \
  --url 'https://v2.flabs.in/client/events/getDeactivatedEvents?labID=64a1b2c3d4e5f60718293a4b' \
  --header 'Authorization: Bearer <authToken>'
```

## Authentication

This endpoint requires a valid Bearer token obtained from the [authentication API](/auth/endpoint/get_auth_token).

## Request Parameters

All parameters are sent as query parameters:

| Parameter | Type | Required | Description |
| - | - | - | - |
| `labID` | string | Yes | Flabs lab (branch) identifier. Fetch via `GET /client/labs` |
| `corporateUser` | string | Cond. | Party-scoped accounts only — list this corporate's webhooks |
| `organization` | string | Cond. | Party-scoped accounts only — list this doctor/hospital's webhooks |

<Note>
  **Catch-all accounts (default):** do not send a party. **Party-scoped accounts:** you must send `corporateUser` **or** `organization` (not both); only that party's webhooks are returned. See [integration modes](/crm/introduction).
</Note>

## Response Fields

Each item in `data` describes one auto-deleted webhook:

| Field | Type | Description |
| - | - | - |
| `_id` | string | Webhook identifier. Pass it to Restore Webhook |
| `events` | array | Event types the webhook was subscribed to |
| `endpoint` | string | URL the webhook delivered to |
| `protocol` | string | Delivery protocol (`https`) |
| `corporateUser` | string | Party-scoped accounts: the corporate the webhook is bound to |
| `organization` | string | Party-scoped accounts: the doctor/hospital it is bound to |
| `autoDeactivatedAt` | string | ISO 8601 timestamp when Flabs deleted the webhook |
| `createdAt` | string | ISO 8601 timestamp when the webhook was registered |
| `updatedAt` | string | ISO 8601 timestamp when the webhook was last updated |

### Responses

```json 200 Auto-deleted webhooks theme={null}
{
  "success": true,
  "message": "Deactivated events fetched successfully",
  "data": [
    {
      "_id": "6ac5e1f2a3b4c5d6e7f80912",
      "events": ["bill.completed", "report.completed"],
      "endpoint": "https://your-domain.com/flabs/webhooks",
      "protocol": "https",
      "autoDeactivatedAt": "2026-10-12T09:46:31.903Z",
      "createdAt": "2026-10-06T07:16:25.217Z",
      "updatedAt": "2026-10-12T09:46:31.903Z"
    }
  ]
}
```

An empty `data` array means none of your webhooks have been deleted automatically.

<Note>
  See [Auto-deleted Webhooks](/webhooks/auto-deactivation) for when and why
  Flabs deletes a webhook, and the emails sent before and when it happens.
</Note>


## OpenAPI

````yaml GET /client/events/getDeactivatedEvents
openapi: 3.0.3
info:
  title: Webhooks API
  version: 1.0.0
  description: >-
    APIs for managing webhook to receive real-time notifications about bill and
    report events.
servers:
  - url: https://v2.flabs.in
    description: Production Server
security: []
paths:
  /client/events/getDeactivatedEvents:
    get:
      summary: Get auto-deleted webhooks
      description: >-
        Retrieve webhooks that Flabs deleted automatically because they returned
        no `2xx` response for 24 hours. These webhooks receive no events until
        you [restore](/webhooks/endpoint/reactivate_webhook) them. Webhooks you
        deleted yourself are not listed.


        **Catch-all accounts:** returns the lab's auto-deleted webhooks.
        **Party-scoped accounts:** you MUST pass a party (`corporateUser` or
        `organization`) and only that party's webhooks are returned.
      parameters:
        - name: labID
          in: query
          required: true
          schema:
            type: string
          description: >-
            Flabs lab (branch) identifier. Fetch the list of labs via GET
            /client/labs.
        - name: corporateUser
          in: query
          required: false
          schema:
            type: string
          description: >-
            Party-scoped accounts only. Return only this corporate's webhooks.
            Pass either `corporateUser` or `organization`, not both.
        - name: organization
          in: query
          required: false
          schema:
            type: string
          description: >-
            Party-scoped accounts only. Return only this doctor/hospital's
            webhooks. Pass either `corporateUser` or `organization`, not both.
      responses:
        '200':
          description: Successfully retrieved auto-deleted webhooks
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Deactivated events fetched successfully
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                          description: Unique identifier for the webhook
                        events:
                          type: array
                          items:
                            type: string
                            enum:
                              - bill.created
                              - bill.deleted
                              - bill.completed
                              - report.completed
                              - lead.created
                              - booking.created
                              - booking.phlebotomist_assigned
                              - booking.phlebotomist_arrived
                              - booking.phlebotomist_sample_collected
                              - booking.phlebotomist_sample_submitted
                              - booking.rescheduled
                              - booking.cancelled
                              - report.send
                              - bill.send
                              - booking.send
                              - phlebotomist.send
                              - quotation.send
                          description: List of subscribed event types
                        endpoint:
                          type: string
                          description: URL the webhook delivers to
                        protocol:
                          type: string
                          enum:
                            - https
                          description: Protocol used for webhook delivery
                        corporateUser:
                          type: string
                          description: >-
                            Party-scoped accounts: the corporate this webhook is
                            bound to (if any).
                        organization:
                          type: string
                          description: >-
                            Party-scoped accounts: the doctor/hospital this
                            webhook is bound to (if any).
                        autoDeactivatedAt:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp when Flabs deleted the webhook
                        createdAt:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp when was created
                        updatedAt:
                          type: string
                          format: date-time
                          description: ISO 8601 timestamp when was last updated
              example:
                success: true
                message: Deactivated events fetched successfully
                data:
                  - _id: <unique id>
                    events:
                      - bill.completed
                    endpoint: https://example.com/webhooks/flabs
                    protocol: https
                    autoDeactivatedAt: '2026-10-12T09:45:46.000Z'
                    createdAt: '2025-08-21T08:57:49.700Z'
                    updatedAt: '2026-10-12T09:45:46.000Z'
        4XX:
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  status:
                    type: integer
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      details:
                        type: string
              example:
                success: false
                status: 401
                message: Unauthorized
                error:
                  details: Invalid client credentials
        5XX:
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  status:
                    type: integer
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      details:
                        type: string
              example:
                success: false
                status: 500
                message: Internal Server Error
                error:
                  details: An unexpected error occurred
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from the authentication endpoint

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.