---
title: "Generate Schedule Slots"
method: POST
path: "/main/Schedule/{id}/$generate"
tags: ["Schedule"]
---

# Generate Schedule Slots

`POST /main/Schedule/{id}/$generate`

The `$generate` operation populates the Slots for a Schedule. It will use the online booking preferences to ensure that the available times adhere to buffer time, lead time and advance booking limit.

## Path parameters

- `id` string, required

## Headers

- `prefer` 'respond-async'

## Request body

- ScheduleScheduleGenerateInput — Schedule resources provide a container for time-slots that can be booked using an appointment. It provides the window of time (period) that slots are defined for and what type of appointments can be booked. The schedule does not provide any information about actual appointments. This separation greatly assists where access to the appointments would not be permitted for security or privacy reasons, while still being able to determine if an appointment might be available.
  - `period` FhirPeriodDateTime
    - `start` string, date-time, nullable
    - `end` string, date-time, nullable
    - `id` string, nullable — ID of the FHIR element (optional)
  - `updatePlanningHorizon` boolean, nullable — Pass true to update the planning horizon. Default is false.

## Response `201`

Schedule resource created

- ScheduleBundleResource — Schedule resources provide a container for time-slots that can be booked using an appointment. It provides the window of time (period) that slots are defined for and what type of appointments can be booked. The schedule does not provide any information about actual appointments. This separation greatly assists where access to the appointments would not be permitted for security or privacy reasons, while still being able to determine if an appointment might be available.
  - `identifier` FhirIdentifier
    - `use` 'usual' | 'official' | 'temp' | 'secondary' | 'old' | 'null', nullable
    - `type` FhirCodeableConcept
      - `coding` FhirCoding[] — defined by a terminology system
        - `system` string, uri, nullable — Identity of the terminology system
        - `code` string, nullable — Symbol in syntax defined by the system
        - `display` string, nullable — Representation defined by the system
        - `userSelected` boolean, nullable — If this coding was chosen directly by the user
        - `id` string, nullable — ID of the FHIR element (optional)
      - `text` string, nullable — Plain text representation of the concept
      - `id` string, nullable — ID of the FHIR element (optional)
    - `system` string, nullable — The namespace for the identifier value
    - `value` string, nullable — The unique identifier
    - `period` FhirPeriodDateTime
      - `start` string, date-time, nullable
      - `end` string, date-time, nullable
      - `id` string, nullable — ID of the FHIR element (optional)
    - `assigner` FhirReference
      - `reference` string, required — The URL (relative or absolute) to the resource being referenced
      - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `type` 'document' | 'message' | 'transaction' | 'transaction-response' | 'batch' | 'batch-response' | 'history' | 'searchset' | 'collection' — document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
  - `timestamp` string, date-time — When the bundle was assembled
  - `total` integer — If search, the total number of matches
  - `link` FhirBundleLink[] — Links related to this Bundle
    - `relation` string
    - `url` string
    - `id` string, nullable — ID of the FHIR element (optional)
  - `entry` FhirBundleEntry[] — Entry in the bundle - will have a resource or information
    - `fullUrl` string, nullable — URI for resource (Absolute URL server address or URI for UUID/OID)
    - `resource` FhirResourceInterface
    - `search` FhirBundleSearch
      - `mode` 'match' | 'include' | 'outcome' — match | include | outcome - why this is in the result set
      - `score` number, nullable — Search ranking (between 0 and 1)
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `text` FhirNarrative
    - `status` 'generated' | 'extensions' | 'additional' | 'empty' — Describes how the narrative was generated
    - `div` string — Limited xhtml content
    - `id` string, nullable — ID of the FHIR element (optional)
  - `contained` AbstractFhirResource[] — Contained, inline Resources
    - `id` string, nullable — Logical id of this artifact
    - `meta` FhirResourceMeta
      - `lastUpdated` string, date-time, nullable — When the resource version last changed
      - `profile` string[] — Profiles this resource claims to conform to
    - `resourceType` string, nullable — Resource Type
  - `id` string, nullable — Logical id of this artifact
  - `meta` FhirResourceMeta
    - `lastUpdated` string, date-time, nullable — When the resource version last changed
    - `profile` string[] — Profiles this resource claims to conform to
  - `resourceType` string, nullable — Resource Type

## Other responses

- `400` — Invalid input
- `403` — Forbidden
- `422` — Unprocessable entity

---

[API](https://skmtc.dev/halaxy/apis/halaxy-api.md) · [All operations](https://skmtc.dev/halaxy/apis/halaxy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/halaxy/halaxy-api/revisions/d72139daaa89/schema)
