Calendar & Scheduling

Practitioner Rotas

Endpoints to manage Practitioner Rotas in Trybe.

get/shop/practitioner-rotas

List a practitioner's rotas

listPractitionerRotas

Returns a paginated list of the active PractitionerRotas of the practitioner identified by practitioner_id, ordered by start_date. Rotas that have already ended are not included. Requires the ROTAS_VIEW permission on the practitioner's first site.

Query parameters

  • practitioner_idobject-idrequired

    The ID of the practitioner whose rotas to list.

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

Responses

  • 200

    A paginated list of PractitionerRota objects across all practitioners the caller can see.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

post/shop/practitioner-rotas

Create a practitioner rota

createPractitionerRota

Creates a new PractitionerRota for the practitioner identified by practitioner_id in the request body. An open-ended rota that overlaps the new rota's start is shortened to end the day before.

Request body

  • practitioner_idobject-idrequired

    Practitioner the new rota applies to. The caller must have SCHEDULE_MANAGE (or equivalent) on every site the practitioner works at — otherwise the request is rejected with 403.

  • start_datedaterequired

    The date from which this rota is active (YYYY-MM-DD).

  • end_datedateoptionalnullable

    The date on which this rota ends. Omit or pass null for an open-ended rota.

  • The number of weeks in the rolling schedule cycle.

  • availability_rulesobject[]required

    The availability rules for this rota.

Responses

  • 201

    A single PractitionerRota object.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

get/shop/practitioner-rotas/{practitionerRotaId}

Retrieve a practitioner rota by ID

getPractitionerRota

Returns the PractitionerRota identified by practitionerRotaId. The rota record includes the practitioner_id it belongs to.

Path parameters

Responses

  • 200

    A single PractitionerRota object.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/shop/practitioner-rotas/{practitionerRotaId}

Update a practitioner rota by ID

updatePractitionerRota

Updates the PractitionerRota identified by practitionerRotaId. The practitioner the rota belongs to cannot be changed; create a new rota and delete the old one if you need to move the schedule between practitioners.

Path parameters

Request body

  • start_datedaterequired

    The date from which this rota is active (YYYY-MM-DD).

  • end_datedateoptionalnullable

    The date on which this rota ends. Pass null for an open-ended rota.

  • The number of weeks in the rolling schedule cycle.

  • availability_rulesobject[]required

    The availability rules for this rota.

Responses

  • 200

    A single PractitionerRota object.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/shop/practitioner-rotas/{practitionerRotaId}

Delete a practitioner rota by ID

deletePractitionerRota

Deletes the PractitionerRota identified by practitionerRotaId. Any future availability windows generated from this rota are invalidated, but existing bookings are retained.

Path parameters

Responses

  • 204

    PractitionerRota deleted successfully.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found