> ## 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.

# List Referral Hospitals

> Returns the active referral hospitals of the given branch, with their `_id` and `name`, sorted by name. Hospitals the lab marked inactive, and temporary entries, are left out.

Use the `_id`:
- as `referredHospitalOrganization` on [Create Lead or Booking](/crm/endpoint/create_lead), to record who referred the patient;
- as `organization` on [List Tests](/crm/endpoint/list_tests), [List Packages](/crm/endpoint/list_packages) and webhook calls, on a [party-scoped](/crm/party-scoped) account.

The list can be long (a few thousand hospitals for a large lab): fetch it once and search it on your side.



## OpenAPI

````yaml GET /client/crm/hospitals
openapi: 3.0.3
info:
  title: Flabs CRM API
  version: 1.0.0
  description: >-
    Branches, corporates, tests, packages, and lead/booking ingestion for the
    Flabs CRM.
servers:
  - url: https://v2.flabs.in
    description: Production
security: []
paths:
  /client/crm/hospitals:
    get:
      summary: List referral hospitals in a branch
      description: >-
        Returns the active referral hospitals of the given branch, with their
        `_id` and `name`, sorted by name. Hospitals the lab marked inactive, and
        temporary entries, are left out.


        Use the `_id`:

        - as `referredHospitalOrganization` on [Create Lead or
        Booking](/crm/endpoint/create_lead), to record who referred the patient;

        - as `organization` on [List Tests](/crm/endpoint/list_tests), [List
        Packages](/crm/endpoint/list_packages) and webhook calls, on a
        [party-scoped](/crm/party-scoped) account.


        The list can be long (a few thousand hospitals for a large lab): fetch
        it once and search it on your side.
      parameters:
        - in: query
          name: branchID
          required: true
          schema:
            type: string
          description: Branch identifier returned by `GET /client/labs`.
      responses:
        '200':
          description: Referral hospitals returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  hospitals:
                    type: array
                    description: >-
                      Active referral hospitals of the branch, sorted by name.
                      An empty array if the branch has none.
                    items:
                      type: object
                      properties:
                        _id:
                          type: string
                          description: >-
                            Hospital identifier — pass this as
                            `referredHospitalOrganization` on create, or as
                            `organization` on party-scoped calls.
                        name:
                          type: string
                          description: Hospital's name, as set up in the lab software.
              example:
                hospitals:
                  - _id: 6530a4a6f1d2c8b7e9ahos01
                    name: City Care Hospital
                  - _id: 6530a4a6f1d2c8b7e9ahos02
                    name: Sunrise Multispeciality
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
components:
  responses:
    ClientError:
      description: Validation or auth error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            success: false
            status: 400
            message: Bad Request
            error:
              details: first_name is required
    ServerError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            success: false
            status: 500
            message: Internal Server Error
            error:
              details: An unexpected error occurred
  schemas:
    ErrorBody:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
        message:
          type: string
        error:
          type: object
          properties:
            details:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtained from `POST /client/auth/token`.

````

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