> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

> Create a new office hours schedule with time shifts. Use when provisioning business-hours coverage schedules programmatically.

# Create an office hours schedule



## OpenAPI

````yaml post /office-hours
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /office-hours:
    post:
      summary: Create an office hours schedule
      description: >-
        Create a new office hours schedule with time shifts. Each shift defines
        a day (or day range) and start/end times. Example: Monday-Friday 9am-5pm
        EST would be one shift with day_of_week "monday_to_friday", start_time
        "09:00:00", end_time "17:00:00", and iana_timezone "America/New_York".
      operationId: createOfficeHours
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOfficeHoursPublicDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OfficeHoursPublicResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    CreateOfficeHoursPublicDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/CreateOfficeHoursPublicDtoInput'
      type: object
      properties:
        name:
          type: string
          description: Schedule name (e.g. "Business Hours", "Weekend Support")
        iana_timezone:
          type: string
          description: >-
            IANA timezone for the schedule (e.g. "America/New_York",
            "Europe/London", "Asia/Tokyo")
        shifts:
          type: array
          items:
            type: object
            properties:
              day_of_week:
                type: string
                enum:
                  - everyday
                  - friday
                  - friday_and_saturday
                  - monday
                  - monday_to_friday
                  - saturday
                  - sunday
                  - sunday_and_monday
                  - sunday_to_thursday
                  - thursday
                  - tuesday
                  - wednesday
                description: >-
                  Day(s) of week: "monday", "tuesday", "wednesday", "thursday",
                  "friday", "saturday", "sunday", "everyday",
                  "monday_to_friday", "sunday_to_thursday",
                  "friday_and_saturday", "sunday_and_monday"
              start_time:
                type: string
                description: Start time in HH:mm:ss format (e.g. "09:00:00")
              end_time:
                type: string
                description: End time in HH:mm:ss format (e.g. "17:00:00")
            required:
              - day_of_week
              - start_time
              - end_time
          description: >-
            Time blocks when support is available. Use day ranges like
            "monday_to_friday" for convenience.
      required:
        - name
        - iana_timezone
        - shifts
    OfficeHoursPublicResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/OfficeHoursPublicResponseDto'
      type: object
      properties:
        id:
          type: string
          description: Office hours schedule ID
        name:
          type: string
          description: Schedule name (e.g. "Weekday Support", "Weekend Hours")
        iana_timezone:
          type: string
          description: IANA timezone (e.g. "America/New_York", "Europe/London")
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        shifts:
          type: array
          items:
            type: object
            properties:
              day_of_week:
                type: string
                enum:
                  - everyday
                  - friday
                  - friday_and_saturday
                  - monday
                  - monday_to_friday
                  - saturday
                  - sunday
                  - sunday_and_monday
                  - sunday_to_thursday
                  - thursday
                  - tuesday
                  - wednesday
                description: >-
                  Day(s) of week: "monday", "tuesday", "wednesday", "thursday",
                  "friday", "saturday", "sunday", "everyday",
                  "monday_to_friday", "sunday_to_thursday",
                  "friday_and_saturday", "sunday_and_monday"
              start_time:
                type: string
                description: Start time in HH:mm:ss format (e.g. "09:00:00")
              end_time:
                type: string
                description: End time in HH:mm:ss format (e.g. "17:00:00")
              id:
                type: string
                description: Shift ID
              created_at:
                type: string
                format: date-time
              updated_at:
                type: string
                format: date-time
            required:
              - day_of_week
              - start_time
              - end_time
              - id
              - created_at
              - updated_at
            additionalProperties: false
          description: The time blocks when support is available
      required:
        - id
        - name
        - iana_timezone
        - created_at
        - updated_at
        - shifts
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````