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

# Change a listing's schedule

> Only the fields you send change. `mode` alone changes the mode and keeps the rules and the own hours, as in the portal. `null` for `duration_min` or `confirmation` means „as usual”. `runner` is the email of an active colleague of the firm; `null` leaves the viewings to the holder.



## OpenAPI

````yaml en/openapi.json PATCH /listings/{code}/viewing-schedule
openapi: 3.1.2
info:
  title: Housera API
  version: 1.0.0
  description: >-
    Publish and manage real estate listings on Housera from your CRM or your own
    application, under the same rules as the form on the Housera portal.
servers:
  - url: https://staging.housera.ro/api/v1
    description: 'Sandbox (staging): test data, same rules as production.'
  - url: https://housera.ro/api/v1
    description: 'Production: the real listings on housera.ro.'
security:
  - bearer: []
tags:
  - name: Your listings
  - name: Photos
  - name: Events
  - name: Vocabulary
  - name: Connect with Housera
  - name: Client requests
  - name: The company and its team
  - name: Marketing mandates
  - name: Viewings
  - name: Projects
  - name: Partnerships
  - name: API key
  - name: Statistics
paths:
  /listings/{code}/viewing-schedule:
    patch:
      tags:
        - Viewings
      summary: Change a listing's schedule
      description: >-
        Only the fields you send change. `mode` alone changes the mode and keeps
        the rules and the own hours, as in the portal. `null` for `duration_min`
        or `confirmation` means „as usual”. `runner` is the email of an active
        colleague of the firm; `null` leaves the viewings to the holder.
      operationId: v1.viewing_schedule.listing_update
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
          description: The listing's public code (8 characters, as in its URL on Housera).
        - name: locale
          in: query
          required: false
          schema:
            type: string
            enum:
              - ro
              - en
            default: en
          example: en
          description: >-
            The response language, `ro` or `en`. It changes error messages
            (`title`, `detail`), labels and, when the listing has an approved
            translation in that language, its title and description. Codes are
            the same in every language. It takes precedence over
            `Accept-Language` and over the account's language.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateListingViewingScheduleRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ListingViewingScheduleApiResource'
                    description: The result of the request.
                required:
                  - data
          description: The request succeeded.
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request body is not valid JSON (`malformed_json`).
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The key is missing, revoked or expired (`unauthenticated`).
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The key lacks the required permission (`missing_ability`) or access
            is denied (`forbidden`).
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The listing does not exist or the key has no access to it
            (`not_found`).
        '413':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request body is larger than 1 MB (`payload_too_large`).
        '415':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            The request body isn't declared as JSON (`unsupported_media_type`).
            Send it with `Content-Type: application/json`.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
          description: >-
            The data fails the rules: one entry per field in `errors[]`, each
            with a stable `code`.
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Too many requests. Try again after the number of seconds in
            `Retry-After`.
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: >-
            Housera has temporarily paused writes through the API
            (`api_writes_paused`). Try again after the number of seconds in
            `Retry-After`.
components:
  schemas:
    UpdateListingViewingScheduleRequest:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/ViewingScheduleMode'
          description: Send mode.
        hours:
          type:
            - object
            - 'null'
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                from:
                  type: string
                  description: The start time, `HH:MM`.
                to:
                  type: string
                  description: The end time, `HH:MM`. `24:00` is the end of the day.
              required:
                - from
                - to
          description: Hours.
        duration_min:
          type:
            - integer
            - 'null'
          enum:
            - '15'
            - '30'
            - '45'
            - '60'
            - '90'
            - null
          description: 'How long a viewing lasts, in minutes: 15, 30, 45, 60 or 90.'
        notice_min:
          type:
            - integer
            - 'null'
          enum:
            - '0'
            - '60'
            - '120'
            - '240'
            - '1440'
            - '2880'
            - null
          description: Booking notice.
        available_from:
          type:
            - string
            - 'null'
          format: date
          description: Availability date.
        confirmation:
          type:
            - string
            - 'null'
          enum:
            - auto
            - manual
            - null
          description: >-
            `auto`: a booking is confirmed at once. `manual`: the visitor sends
            a request, and you accept or decline it.
        runner:
          type:
            - string
            - 'null'
          format: email
          maxLength: 254
          description: Who runs the viewings.
        occupant:
          type: object
          properties:
            notify:
              type: boolean
              description: Whether the person living there is to be told of the viewings.
            phone:
              type:
                - string
                - 'null'
              pattern: ^\+?[0-9 ()\-]{6,32}$
              maxLength: 32
              description: Phone.
          description: >-
            The person living in the home: `notify` and `phone`. Kept with the
            listing's schedule.
        confirm_pending:
          type: boolean
          description: Confirming the waiting requests.
        blocked_dates:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              from:
                type: string
                format: date
                description: The first day or the start time of the range.
              to:
                type:
                  - string
                  - 'null'
                format: date
                description: The last day of the period.
            required:
              - from
          maxItems: 50
          description: The days off, as `{from, to}` date ranges (`Y-m-d`), at most 50.
      title: UpdateListingViewingScheduleRequest
    ListingViewingScheduleApiResource:
      type: object
      properties:
        code:
          type: string
          description: Code.
        mode:
          anyOf:
            - type: string
            - type: string
              enum:
                - inherit
          description: Send mode.
        timezone:
          type: string
          description: >-
            The time zone of the listing's place (IANA). The schedule's hours
            are read on its clock.
        hours:
          type: object
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                from:
                  type: string
                  description: The start time, `HH:MM`.
                to:
                  type: string
                  description: The end time, `HH:MM`. `24:00` is the end of the day.
              required:
                - from
                - to
          description: Hours.
        duration_min:
          type:
            - integer
            - 'null'
          description: 'How long a viewing lasts, in minutes: 15, 30, 45, 60 or 90.'
        notice_min:
          type:
            - string
            - 'null'
          description: Booking notice.
        available_from:
          type:
            - string
            - 'null'
          description: Availability date.
        confirmation:
          type:
            - string
            - 'null'
          description: >-
            `auto`: a booking is confirmed at once. `manual`: the visitor sends
            a request, and you accept or decline it.
        runner:
          type:
            - object
            - 'null'
          properties:
            name:
              type: string
              description: Name.
            email:
              type:
                - string
                - 'null'
              description: The email of the colleague who runs the viewings.
          required:
            - name
            - email
          description: >-
            Who runs the listing's viewings: `name` and `email`. The holder,
            unless the viewings were given to a colleague.
        blocked_dates:
          type: array
          items:
            type: object
            properties:
              from:
                type: string
                description: The first day or the start time of the range.
              to:
                type: string
                description: The last day of the period.
            required:
              - from
              - to
          description: The days off, as `{from, to}` date ranges (`Y-m-d`), at most 50.
        occupant:
          type: object
          properties:
            notify:
              type: boolean
              description: Whether the person living there is to be told of the viewings.
            phone:
              type:
                - string
                - 'null'
              description: Phone.
          required:
            - notify
            - phone
          description: >-
            The person living in the home: `notify` and `phone`. Kept with the
            listing's schedule.
        effective:
          type: object
          properties:
            hours:
              type: object
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    from:
                      type: string
                      description: The start time, `HH:MM`.
                    to:
                      type: string
                      description: The end time, `HH:MM`. `24:00` is the end of the day.
                  required:
                    - from
                    - to
              description: Hours.
            duration_min:
              type: integer
              description: 'How long a viewing lasts, in minutes: 15, 30, 45, 60 or 90.'
            buffer_min:
              type: integer
              description: Break between viewings.
            notice_min:
              type: integer
              description: Booking notice.
            horizon_days:
              type: integer
              description: How far ahead hours show.
            confirmation:
              type: string
              description: >-
                `auto`: a booking is confirmed at once. `manual`: the visitor
                sends a request, and you accept or decline it.
            blocked_dates:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: string
                    description: The first day or the start time of the range.
                  to:
                    type: string
                    description: The last day of the period.
                required:
                  - from
                  - to
              description: The days off, as `{from, to}` date ranges (`Y-m-d`), at most 50.
          required:
            - hours
            - duration_min
            - buffer_min
            - notice_min
            - horizon_days
            - confirmation
            - blocked_dates
          description: >-
            What generates the hours now: the inherited or own hours and the
            rules, with the defaults applied. Read only.
        base_saved:
          type: boolean
          description: >-
            Whether whoever runs the viewings saved a base schedule. Without
            one, `inherit` gives clients no hours.
        pending_requests:
          type: integer
          description: >-
            How many viewing requests wait for your answer. A request you
            answered with another time waits for the client and is not counted.
        confirmed_pending:
          type: object
          properties:
            confirmed:
              type: integer
              description: How many requests were confirmed now.
            still_waiting:
              type: integer
              description: >-
                How many requests still wait after the save (past the cap of
                100, or answered meanwhile).
          required:
            - confirmed
            - still_waiting
          description: >-
            What the save confirmed along, when you asked for `confirm_pending`:
            `confirmed` and `still_waiting`.
      required:
        - code
        - mode
        - timezone
        - hours
        - duration_min
        - notice_min
        - available_from
        - confirmation
        - runner
        - blocked_dates
        - occupant
        - effective
        - base_saved
        - pending_requests
      title: ListingViewingScheduleApiResource
    Problem:
      type: object
      title: Problem
      properties:
        type:
          type: string
          format: uri
          description: The URL of the problem type (RFC 9457).
        title:
          type: string
          description: A short summary of the problem, in the request's language.
        status:
          type: integer
          description: The HTTP status code.
        code:
          type: string
          description: >-
            The stable code of the refusal, the one to handle the error by (the
            list is on the Errors page).
        detail:
          type: string
          description: The explanation, in the request's language.
        existing:
          type: object
          properties:
            code:
              type: string
              description: The existing listing's public code.
            external_ref:
              type:
                - string
                - 'null'
              description: >-
                Your ID for the existing listing, if you set it with `PUT
                /listings/ref/{ref}`. Otherwise `null`.
          required:
            - code
            - external_ref
          description: >-
            Only on `409 duplicate_listing`: the listing you already have for
            the same property.
      required:
        - type
        - title
        - status
        - code
        - detail
    ValidationProblem:
      type: object
      title: ValidationProblem
      properties:
        type:
          type: string
          format: uri
          description: The URL of the problem type (RFC 9457).
        title:
          type: string
          description: A short summary of the problem, in the request's language.
        status:
          type: integer
          description: 'The HTTP status code: `422`.'
        errors:
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
                description: The field it refers to, as a JSON Pointer (`/features/2`).
              code:
                type: string
                description: >-
                  The rule that failed, as a stable code (the list is on the
                  Errors page).
              detail:
                type: string
                description: >-
                  The explanation, in the request's language. The wording can
                  change, so handle the error by `code`.
            required:
              - pointer
              - code
              - detail
          description: One entry for each field that fails the rules.
      required:
        - type
        - title
        - status
        - errors
    ViewingScheduleMode:
      type: string
      enum:
        - inherit
        - own
        - on_request
      title: ViewingScheduleMode
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: 'Authorization: Bearer <key>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.