# Get a business hours schedule definition.

URL: https://docs.dixa.io/openapi/dixa-api/beta/business-hours/getbusiness-hoursschedulesscheduleiddefinition

Get a business hours schedule definition in an organization by providing its ID.

## GET /beta/business-hours/schedules/{scheduleId}/definition

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

### Request example

```bash
curl -X GET 'https://dev.dixa.io/beta/business-hours/schedules/{scheduleId}/definition' \
  -H 'Authorization: <API token>'
```

### Response examples

#### 200

```json
{
  "data": {
    "schedule": {
      "id": "a0d559bf-cdf8-4088-841d-f3807b93272e",
      "name": "Schedule 1",
      "timezone": "Europe/Copenhagen",
      "businessHours": [
        {
          "name": "Monday",
          "dayOfWeek": 1,
          "businessHourType": "Regular",
          "status": "Open",
          "intervals": [
            {
              "startTime": "08:00",
              "endTime": "16:00"
            }
          ],
          "startDate": "2026-01-05"
        },
        {
          "name": "Tuesday",
          "dayOfWeek": 2,
          "businessHourType": "Regular",
          "status": "Open",
          "intervals": [
            {
              "startTime": "08:00",
              "endTime": "16:00"
            }
          ],
          "startDate": "2026-01-06"
        }
      ],
      "exceptions": [
        {
          "name": "New Year",
          "businessHourType": "Holiday",
          "status": "Closed",
          "intervals": [],
          "recurring": {
            "dayOfMonth": 1,
            "monthOfYear": 1
          },
          "startDate": "2026-01-01"
        }
      ]
    }
  }
}
```

#### 400 Invalid value for: path parameter scheduleId, Invalid value extracted from request context

```json
{
  "message": "Invalid value in request"
}
```

#### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

#### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## OpenAPI definition

The operation and the schemas used, from the full spec at https://docs.dixa.io/openapi-specs/dixa-beta.yaml. Request and response examples are above.

```yaml
openapi: 3.0.3
info:
  title: Dixa API
  version: beta
servers:
  - url: https://dev.dixa.io
security:
  - ApiKeyAuth: []
paths:
  /beta/business-hours/schedules/{scheduleId}/definition:
    get:
      tags:
        - Business Hours
      summary: Get a business hours schedule definition.
      description: Get a business hours schedule definition in an organization by
        providing its ID.
      operationId: getBusiness-hoursSchedulesScheduleidDefinition
      parameters:
        - name: scheduleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBusinessHoursScheduleDefinitionOutput"
        "400":
          description: "Invalid value for: path parameter scheduleId, Invalid value
            extracted from request context"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    GetBusinessHoursScheduleDefinitionOutput:
      title: GetBusinessHoursScheduleDefinitionOutput
      type: object
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/GetBusinessHoursScheduleDefinitionResult"
    GetBusinessHoursScheduleDefinitionResult:
      title: GetBusinessHoursScheduleDefinitionResult
      type: object
      required:
        - schedule
      properties:
        schedule:
          $ref: "#/components/schemas/BusinessHoursScheduleDefinition"
    BusinessHoursScheduleDefinition:
      title: BusinessHoursScheduleDefinition
      type: object
      required:
        - id
        - name
        - timezone
      properties:
        id:
          type: string
        name:
          type: string
        timezone:
          type: string
        businessHours:
          type: array
          items:
            $ref: "#/components/schemas/BusinessHourRegular"
        exceptions:
          type: array
          items:
            $ref: "#/components/schemas/BusinessHourException"
    BusinessHourRegular:
      title: BusinessHourRegular
      type: object
      required:
        - name
        - businessHourType
        - status
        - startDate
      properties:
        name:
          type: string
        dayOfWeek:
          type: integer
          format: int32
        businessHourType:
          $ref: "#/components/schemas/BusinessHourRegularType"
        status:
          $ref: "#/components/schemas/BusinessHourStatus"
        intervals:
          type: array
          items:
            $ref: "#/components/schemas/TimeInterval"
        startDate:
          type: string
    BusinessHourRegularType:
      title: BusinessHourRegularType
      oneOf:
        - $ref: "#/components/schemas/Regular1"
    Regular1:
      title: Regular
      type: object
    BusinessHourStatus:
      title: BusinessHourStatus
      oneOf:
        - $ref: "#/components/schemas/Closed"
        - $ref: "#/components/schemas/Open"
    Closed:
      title: Closed
      type: object
    Open:
      title: Open
      type: object
    TimeInterval:
      title: TimeInterval
      type: object
      required:
        - startTime
        - endTime
      properties:
        startTime:
          type: string
        endTime:
          type: string
    BusinessHourException:
      title: BusinessHourException
      type: object
      required:
        - name
        - businessHourType
        - status
        - startDate
      properties:
        name:
          type: string
        businessHourType:
          $ref: "#/components/schemas/BusinessHourExceptionType"
        status:
          $ref: "#/components/schemas/BusinessHourStatus"
        intervals:
          type: array
          items:
            $ref: "#/components/schemas/TimeInterval"
        recurring:
          $ref: "#/components/schemas/Recurring"
        startDate:
          type: string
        nextDate:
          type: string
    BusinessHourExceptionType:
      title: BusinessHourExceptionType
      oneOf:
        - $ref: "#/components/schemas/Exception"
        - $ref: "#/components/schemas/Holiday"
    Exception:
      title: Exception
      type: object
    Holiday:
      title: Holiday
      type: object
    Recurring:
      title: Recurring
      type: object
      properties:
        dayOfMonth:
          type: integer
          format: int32
        monthOfYear:
          type: integer
          format: int32
        holiday:
          type: string
    BadRequest:
      title: BadRequest
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFound:
      title: NotFound
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ServerError:
      title: ServerError
      type: object
      required:
        - message
      properties:
        message:
          type: string
```
