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

# Get calculated schedule for a specific week

> Resolve the effective weekly hours for one calendar week by layering
the default template, any week-specific assignment, and schedule
overrides. Only the owning barber or a system administrator can read
the calculated result; pass any date in the target week.



## OpenAPI

````yaml /api-reference/Barbers/openapi.yaml get /barbers/{id}/schedules/weekly
openapi: 3.0.0
info:
  title: Barbers
  version: 0.1.0
  contact:
    name: Guile Engineering
    url: https://www.guile.app
    email: engineering@guile.app
  license:
    name: MIT
    url: https://opensource.org/license/mit
  description: The Barbers API provides operations for barbers on the Guile platform.
servers:
  - url: https://api.guile.app
    variables: {}
  - url: https://guile.fly.dev
    variables: {}
security: []
tags:
  - name: Barbers
    description: Barber profiles, schedules, and settings
paths:
  /barbers/{id}/schedules/weekly:
    get:
      tags:
        - Barbers
      summary: Get calculated schedule for a specific week
      description: |-
        Resolve the effective weekly hours for one calendar week by layering
        the default template, any week-specific assignment, and schedule
        overrides. Only the owning barber or a system administrator can read
        the calculated result; pass any date in the target week.
      operationId: getBarberWeeklySchedule
      parameters:
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/resourceId'
        - name: weekStartDate
          in: query
          required: true
          description: >-
            Any date within the desired week. This will be adjusted to the start
            of that week.
          schema:
            $ref: '#/components/schemas/date'
          explode: false
      responses:
        '200':
          description: |-
            Ok.
            The operation succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/calculatedWeeklySchedule'
        '400':
          description: >-
            Bad Request.

            The request body, request headers, and/or query parameters are not
            well-formed.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/badRequest](https://docs.guile.app/problems/badRequest)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '401':
          description: >-
            Unauthorized.

            The operation requires authentication but no authentication or
            insufficient authentication was given.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unauthorized](https://docs.guile.app/problems/unauthorized)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '403':
          description: >-
            Forbidden.

            The authenticated caller is not authorized to perform the requested
            operation.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/forbidden](https://docs.guile.app/problems/forbidden)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '404':
          description: >-
            Not Found.

            There is no such resource at the request URL.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/notFound](https://docs.guile.app/problems/notFound)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '422':
          description: >-
            Unprocessable Entity.

            The request body and/or query parameters were well-formed but
            otherwise invalid.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/unprocessableEntity](https://docs.guile.app/problems/unprocessableEntity)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
        '429':
          description: >-
            Too Many Requests.

            The client has sent too many requests in a given amount of time.



            This problem response may have one of the following `type` values:

            *
            [https://docs.guile.app/problems/tooManyRequests](https://docs.guile.app/problems/tooManyRequests)
          headers:
            Retry-After:
              required: true
              description: The number of seconds to wait before retrying the request.
              schema:
                type: integer
                format: uint32
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/apiProblem'
      security:
        - BearerAuth: []
components:
  schemas:
    resourceId:
      type: string
      description: >-
        The unique, opaque system identifier for a resource.

        This case-sensitive ID is also used as path parameters in URLs or in
        other

        properties or parameters that reference a resource by ID rather than
        URL.
    date:
      type: string
      pattern: ^\d{4}-\d{2}-\d{2}$
      description: >-
        A date, expressed in `YYYY-MM-DD` [RFC
        3339](https://tools.ietf.org/html/rfc3339)

        `date` format.
    calculatedWeeklySchedule:
      type: object
      required:
        - weekStartDate
        - schedule
        - overrides
      properties:
        weekStartDate:
          type: string
          format: date
          description: Start date of the week, in RFC 3339 date format (YYYY-MM-DD).
        schedule:
          allOf:
            - $ref: '#/components/schemas/barberSchedule'
          description: The calculated schedule for this week.
        weekSpecificSchedule:
          allOf:
            - $ref: '#/components/schemas/weekSpecificSchedule'
          description: Week-specific schedule used for this week, if any.
        overrides:
          type: array
          items:
            $ref: '#/components/schemas/scheduleOverride'
          description: Schedule overrides affecting this week.
      description: Calculated schedule for a specific week.
    apiProblem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
        recovery:
          allOf:
            - $ref: '#/components/schemas/clientFailureRecovery'
          description: The recovery contract for this problem occurrence.
        problems:
          type: array
          items:
            $ref: '#/components/schemas/problem'
          maxItems: 128
          description: |-
            Optional root-causes if there are multiple problems in the request
            or API call processing.
      description: >-
        API problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    barberSchedule:
      type: object
      required:
        - id
        - name
        - schedule
        - isDefault
        - createdAt
        - updatedAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: Unique identifier for the schedule.
        name:
          type: string
          maxLength: 100
          description: The name for this schedule.
        schedule:
          allOf:
            - $ref: '#/components/schemas/DailySchedule'
          description: The daily schedule configuration.
        isDefault:
          type: boolean
          description: Indicates if this is the default schedule.
        createdAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was created, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
        updatedAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was updated, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
      description: A barber schedule resource.
    weekSpecificSchedule:
      type: object
      required:
        - id
        - weekStartDate
        - schedule
        - createdAt
        - updatedAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: Unique identifier for this assignment.
        weekStartDate:
          type: string
          format: date
          description: >-
            Start date of the week (Monday), in RFC 3339 date format
            (YYYY-MM-DD). The provided date will be adjusted to the Monday of
            that week.
        schedule:
          allOf:
            - $ref: '#/components/schemas/barberScheduleReference'
          description: Reference to the assigned schedule.
        createdAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was created, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
        updatedAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was updated, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
      description: A schedule assigned to a specific week.
    scheduleOverride:
      type: object
      required:
        - id
        - startsOn
        - endsOn
        - type
        - createdAt
        - updatedAt
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: Unique identifier for the override.
        startsOn:
          type: string
          format: date
          description: >-
            Start date of the override, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date format (YYYY-MM-DD).
        endsOn:
          type: string
          format: date
          description: >-
            End date of the override (inclusive), in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date format (YYYY-MM-DD). For a single-day override, use the same
            date as `startsOn`.
        startsAt:
          type: string
          format: time
          description: >-
            Start time for each override day (HH:MM).

            Omit with `endsAt` for a full day, or set both for a timed window;
            one bound alone is rejected.
        endsAt:
          type: string
          format: time
          description: >-
            End time for each override day (HH:MM).

            Omit with `startsAt` for a full day, or set both for a timed window;
            one bound alone is rejected.
        type:
          allOf:
            - $ref: '#/components/schemas/scheduleOverrideType'
          description: Type of override.
        description:
          type: string
          maxLength: 255
          description: Reason or description for the override.
        createdAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was created, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
        updatedAt:
          type: string
          format: date-time
          description: |-
            The date-time when this resource was updated, in
            [RFC 3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived and
            immutable.
      description: A schedule override for time off or modified hours.
    uri:
      type: string
      maxLength: 1024
      format: uri
      description: A URI reference to an internal or external resource.
    statusCode:
      type: integer
      format: uint16
      minimum: 100
      maximum: 599
      description: The HTTP status code for a response.
    clientFailureRecovery:
      type: object
      required:
        - outcome
        - retry
      properties:
        outcome:
          allOf:
            - $ref: '#/components/schemas/clientFailureOutcome'
          description: The known outcome of the request.
        retry:
          allOf:
            - $ref: '#/components/schemas/clientRetryDirective'
          description: The safe retry action for the request.
        sessionAction:
          allOf:
            - $ref: '#/components/schemas/clientSessionAction'
          description: The session action required before the request can continue.
        rateLimit:
          allOf:
            - $ref: '#/components/schemas/rateLimit'
          description: The rate limit state that prevented the request.
      description: The recovery contract for a failed client request.
    problem:
      type: object
      required:
        - type
        - title
        - occurredAt
        - id
        - status
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/uri'
          description: A URI reference that identifies the problem type.
        title:
          type: string
          maxLength: 120
          description: >-
            A short, human-readable summary of the problem type. The title is
            usually the same for all

            problems with the same `type`.
        occurredAt:
          type: string
          format: date-time
          description: >-
            The date-time when this problem occurred, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            date-time `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC. This is derived
            and immutable.
        detail:
          type: string
          maxLength: 256
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: >-
            The unique identifier for this problem. This is an immutable opaque
            string.
        status:
          allOf:
            - $ref: '#/components/schemas/statusCode'
          description: >-
            The [HTTP status
            code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)for
            this

            occurrence of the problem.
        instance:
          allOf:
            - $ref: '#/components/schemas/uri'
          maxLength: 2048
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem. This is the URI of an

            API resource that the problem is related to, with a unique error
            correlation ID URI fragment.
        attributes:
          type: object
          additionalProperties: {}
          description: >-
            Additional optional attributes related to the problem. This data
            conforms to the schema

            associated with the error type.
      description: >-
        Standard problem or error response, as per

        [RFC 9457
        application/problem+json](https://tools.ietf.org/html/rfc9457).
    DailySchedule:
      type: object
      properties:
        monday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Monday.
        tuesday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Tuesday.
        wednesday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Wednesday.
        thursday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Thursday.
        friday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Friday.
        saturday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Saturday.
        sunday:
          allOf:
            - $ref: '#/components/schemas/DaySchedule'
          description: Schedule for Sunday.
      description: A barber's typical weekly schedule.
    barberScheduleReference:
      type: object
      required:
        - id
        - name
      properties:
        id:
          allOf:
            - $ref: '#/components/schemas/resourceId'
          description: Unique identifier for the schedule.
        name:
          type: string
          description: Name of the schedule.
      description: Reference to a barber schedule.
    scheduleOverrideType:
      type: string
      enum:
        - timeOff
        - holiday
        - other
      description: Types of schedule overrides.
    clientFailureOutcome:
      type: string
      enum:
        - notApplied
        - unknown
      description: The known outcome of a failed client request.
    clientRetryDirective:
      type: string
      enum:
        - doNotRetry
        - retrySameRequest
        - retrySameRequestAfterDelay
      description: The safe retry action for a failed client request.
    clientSessionAction:
      type: string
      enum:
        - refresh
        - signIn
      description: The session action required before a failed request can continue.
    rateLimit:
      type: object
      required:
        - limit
        - remaining
        - resetsAt
      properties:
        limit:
          type: integer
          format: uint64
          description: The maximum number of requests allowed in the active window.
        remaining:
          type: integer
          format: uint64
          description: The number of requests remaining in the active window.
        resetsAt:
          type: string
          format: date-time
          description: >-
            The date-time when the active window resets, in [RFC
            3339](https://tools.ietf.org/html/rfc3339) date-time
            `YYYY-MM-DDThh:mm:ss.sssZ` format, UTC.
      description: The rate limit state for the request.
    DaySchedule:
      type: object
      required:
        - workingHours
        - breaks
      properties:
        workingHours:
          type: array
          items:
            $ref: '#/components/schemas/WorkingHours'
          description: Working hours for this day.
        breaks:
          type: array
          items:
            $ref: '#/components/schemas/ScheduledBreak'
          minItems: 0
          maxItems: 2
          description: Scheduled breaks for this day.
      description: Schedule configuration for a single day.
    WorkingHours:
      type: object
      required:
        - startsAt
        - duration
      properties:
        startsAt:
          type: string
          format: time
          description: >-
            The start time for this working block, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            time format (HH:MM).
        duration:
          type: string
          format: duration
          description: >-
            Duration of this working block. The value is an

            [ISO 8601
            duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) string.
      description: A working hours block during a day.
    ScheduledBreak:
      type: object
      required:
        - startsAt
        - duration
      properties:
        startsAt:
          type: string
          format: time
          description: >-
            The start time for the break, in [RFC
            3339](https://tools.ietf.org/html/rfc3339)

            time format (HH:MM).
        duration:
          type: string
          format: duration
          description: >-
            Duration of the break. The value is an

            [ISO 8601
            duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) string.
        description:
          type: string
          maxLength: 100
          description: Optional description of the break.
      description: A scheduled break during a work day.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````