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

> Phlebotomist availability for one branch and day, as the lab sees it when assigning a phlebotomist in its CRM: every active phlebotomist of the branch, their shifts that day and a `status`.

- With a `pincode`, only phlebotomists who registered that pincode are listed; without one, every phlebotomist of the branch.
- Without a `date`, today (IST) is used.
- With a `time`, `status` tells you whether a shift covers that time.

`status` is one of:
- `Available`: on shift that day, and a shift covers `time` when you sent one.
- `Outside Slot`: on shift that day, but no shift covers `time`.
- `Not Available`: no shift that day, or on leave (`shifts` is empty).

Like the lab's CRM, `status` checks shifts only, not visits already booked, so an `Available` phlebotomist can still be busy at that exact time. The list is for showing availability: you cannot choose the phlebotomist when booking; the lab assigns one. Pick a time inside an `Available` shift when you create or reschedule a booking.

Errors (the reason is in `error.details`):
- `400`: `branchID` missing or invalid; `date` not a real `YYYY-MM-DD`, before today or more than 60 days ahead; `time` not `HH:mm`.
- `403`: the branch does not belong to your account.



## OpenAPI

````yaml GET /client/crm/booking/slots
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/booking/slots:
    get:
      summary: Get slots
      description: >-
        Phlebotomist availability for one branch and day, as the lab sees it
        when assigning a phlebotomist in its CRM: every active phlebotomist of
        the branch, their shifts that day and a `status`.


        - With a `pincode`, only phlebotomists who registered that pincode are
        listed; without one, every phlebotomist of the branch.

        - Without a `date`, today (IST) is used.

        - With a `time`, `status` tells you whether a shift covers that time.


        `status` is one of:

        - `Available`: on shift that day, and a shift covers `time` when you
        sent one.

        - `Outside Slot`: on shift that day, but no shift covers `time`.

        - `Not Available`: no shift that day, or on leave (`shifts` is empty).


        Like the lab's CRM, `status` checks shifts only, not visits already
        booked, so an `Available` phlebotomist can still be busy at that exact
        time. The list is for showing availability: you cannot choose the
        phlebotomist when booking; the lab assigns one. Pick a time inside an
        `Available` shift when you create or reschedule a booking.


        Errors (the reason is in `error.details`):

        - `400`: `branchID` missing or invalid; `date` not a real `YYYY-MM-DD`,
        before today or more than 60 days ahead; `time` not `HH:mm`.

        - `403`: the branch does not belong to your account.
      parameters:
        - name: branchID
          in: query
          required: true
          schema:
            type: string
          description: From [List Branches](/crm/endpoint/list_branches).
        - name: pincode
          in: query
          required: false
          schema:
            type: string
          example: '400053'
          description: >-
            Patient's pincode. Lists only phlebotomists who registered it in
            their profile; an empty list means nobody at this branch collects
            there. Leave it out to list every phlebotomist of the branch.
        - name: date
          in: query
          required: false
          schema:
            type: string
            format: date
          description: >-
            `YYYY-MM-DD` in IST, from today up to 60 days ahead. Defaults to
            today.
          example: '2026-11-28'
        - name: time
          in: query
          required: false
          schema:
            type: string
            pattern: ^([01]\d|2[0-3]):[0-5]\d$
          description: >-
            `HH:mm` 24-hour in IST. When sent, `status` is `Available` or
            `Outside Slot` for this time.
          example: '09:30'
      responses:
        '200':
          description: Slots returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  pincode:
                    type: string
                    nullable: true
                    description: The pincode asked for, or `null` when none was sent.
                  date:
                    type: string
                    description: >-
                      The day used, `YYYY-MM-DD` in IST (today when none was
                      sent).
                  time:
                    type: string
                    nullable: true
                    description: The time asked for, or `null` when none was sent.
                  phlebotomists:
                    type: array
                    description: >-
                      Sorted by name. Empty when no phlebotomist of the branch
                      registered the pincode.
                    items:
                      type: object
                      properties:
                        phlebotomistID:
                          type: string
                        name:
                          type: string
                        status:
                          type: string
                          enum:
                            - Available
                            - Outside Slot
                            - Not Available
                          description: See above.
                        shifts:
                          type: array
                          description: >-
                            Their shifts that day, in IST. Empty when `Not
                            Available`.
                          items:
                            type: object
                            properties:
                              from:
                                type: string
                                description: 12-hour time, e.g. `08:00 AM`.
                              to:
                                type: string
                                description: 12-hour time, e.g. `04:30 PM`.
                              minutesPerVisit:
                                type: integer
                                description: Length of one visit.
              example:
                pincode: '400053'
                date: '2026-11-28'
                time: '09:30'
                phlebotomists:
                  - phlebotomistID: 65f0000000000000000000d4
                    name: Ravi Kumar
                    status: Available
                    shifts:
                      - from: 08:00 AM
                        to: 10:00 AM
                        minutesPerVisit: 30
                      - from: 04:00 PM
                        to: 05:30 PM
                        minutesPerVisit: 30
                  - phlebotomistID: 65f0000000000000000000d5
                    name: Sunil
                    status: Outside Slot
                    shifts:
                      - from: 12:00 PM
                        to: 01:00 PM
                        minutesPerVisit: 60
                  - phlebotomistID: 65f0000000000000000000d6
                    name: Vikas
                    status: Not Available
                    shifts: []
        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.