> ## 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.

# Withdraw several free times

> Withdraws the free times in the list at once. Booked or requested times stay, because their visitor has to be told: you withdraw them one by one.



## OpenAPI

````yaml en/openapi.json POST /listings/{code}/viewings/withdraw
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}/viewings/withdraw:
    post:
      tags:
        - Viewings
      summary: Withdraw several free times
      description: >-
        Withdraws the free times in the list at once. Booked or requested times
        stay, because their visitor has to be told: you withdraw them one by
        one.
      operationId: v1.viewings.withdraw
      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:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slot_ids:
                  type: array
                  items:
                    type: integer
                  minItems: 1
                  maxItems: 400
                  description: The ids of the times to withdraw, from `slots[].id`.
              required:
                - slot_ids
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ViewingAgendaApiResource'
                    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:
    ViewingAgendaApiResource:
      type: object
      properties:
        code:
          type: string
          description: Code.
        duration_min:
          type: integer
          description: 'How long a viewing lasts, in minutes: 15, 30, 45, 60 or 90.'
        confirmation:
          type: string
          description: >-
            `auto`: a booking is confirmed at once. `manual`: the visitor sends
            a request, and you accept or decline it.
        timezone:
          type: string
          description: >-
            The time zone of the listing's place (IANA). The hours are read on
            its clock.
        schedule_mode:
          anyOf:
            - type: string
            - type: string
              enum:
                - inherit
          description: 'How the listing takes its hours: `inherit`, `own` or `on_request`.'
        slots:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: The id of the time or window, for `/viewings/{slot}`.
              kind:
                type: string
                description: >-
                  `viewing` (a time one visitor books) or `open_house` (an open
                  house window).
              starts_at:
                type: string
                description: When the time or window starts (ISO 8601).
              ends_at:
                type: string
                description: When the time or window ends (ISO 8601).
              status:
                type: string
                description: >-
                  `available` (free), `pending` (requested, waiting for your
                  answer) or `booked`.
              request_expires_at:
                type:
                  - string
                  - 'null'
                description: >-
                  When you have to answer a request by. After it, the request
                  expires and the time is free again. Null when the time is not
                  requested.
              visitor:
                type:
                  - object
                  - 'null'
                properties:
                  name:
                    type:
                      - string
                      - 'null'
                    description: Name.
                  email:
                    type:
                      - string
                      - 'null'
                    description: The client's email, if they have one.
                  phone:
                    type:
                      - string
                      - 'null'
                    description: Phone.
                required:
                  - name
                  - email
                  - phone
                description: >-
                  Who booked or requested the time: `name`, `email`, `phone`.
                  Only for a key with the `leads:read` permission, otherwise
                  null.
              open_house:
                type:
                  - object
                  - 'null'
                properties:
                  note:
                    type:
                      - string
                      - 'null'
                    description: Note.
                  rsvp:
                    type: boolean
                    description: RSVP.
                  capacity:
                    type:
                      - integer
                      - 'null'
                    description: Number of places.
                  going:
                    type: integer
                    description: How many people said they're coming.
                  arrived:
                    type: integer
                    description: How many people were marked as arrived.
                  savers_notified:
                    type: boolean
                    description: '`true` once you''ve told the people who saved the listing.'
                  savers_to_notify:
                    type:
                      - integer
                      - 'null'
                    description: >-
                      How many people an announcement would reach now. `null`
                      once the window has been announced.
                  running:
                    type: boolean
                    description: '`true` while the window is under way.'
                required:
                  - note
                  - rsvp
                  - capacity
                  - going
                  - arrived
                  - savers_notified
                  - savers_to_notify
                  - running
                description: >-
                  The state of an open house window, `null` for a viewing:
                  `note`, `rsvp`, `capacity`, `going`, `arrived`,
                  `savers_notified`, `savers_to_notify`, `running`.
              source:
                type: string
                description: >-
                  `schedule`: the hour was generated by the weekly schedule.
                  `manual`: it was put in by hand.
              duration_min:
                type: integer
                description: 'How long a viewing lasts, in minutes: 15, 30, 45, 60 or 90.'
              held:
                type: boolean
                description: >-
                  The hour is kept for a short while for someone signing in to
                  book it. While it is kept, nobody else can book it.
              bookable:
                type:
                  - boolean
                  - 'null'
                description: >-
                  On a free hour: whether a client can book it now (the notice,
                  whoever runs the viewings is not busy at another listing, the
                  hour is not kept). Null on the other hours.
              booked_at:
                type:
                  - string
                  - 'null'
                description: When the hour was booked or asked for.
              proposed_starts_at:
                type:
                  - string
                  - 'null'
                description: >-
                  The hour proposed to the client instead of the booked one,
                  while it waits for their answer. Null otherwise.
              attendance_confirmed_at:
                type:
                  - string
                  - 'null'
                description: When the client answered „Da, vin” to the reminder.
              reminded_day_at:
                type:
                  - string
                  - 'null'
                description: When the client was sent the reminder on the day before.
              reminded_soon_at:
                type:
                  - string
                  - 'null'
                description: When the client was sent the reminder two hours before.
              outcome:
                type:
                  - string
                  - 'null'
                description: Outcome.
              outcome_at:
                type:
                  - string
                  - 'null'
                description: When „Cum a fost?” was answered.
              agent:
                type:
                  - object
                  - 'null'
                properties:
                  name:
                    type: string
                    description: >-
                      The name of the agent's account. The portal shows the name
                      in `display_name`.
                  email:
                    type: string
                    description: >-
                      The agent's email; `null` when we have no real address for
                      them, for example a colleague who came from a CRM with no
                      email on their team record.
                required:
                  - name
                  - email
                description: >-
                  The email of the colleague responsible for the listing, an
                  active member of the company. Only the key of the agency owner
                  or of an administrator can send it. Otherwise you get a
                  warning and the listing stays on the key's account.
              place:
                type:
                  - string
                  - 'null'
                description: Meeting place.
              place_rooms:
                type:
                  - integer
                  - 'null'
                description: >-
                  On a developer's project: how many rooms the flat the client
                  wants to see has.
              seat:
                type: integer
                description: >-
                  On a developer's project, the hour's place: one for each
                  consultant, with the same `starts_at`. 0 elsewhere.
            required:
              - id
              - kind
              - starts_at
              - ends_at
              - status
              - request_expires_at
              - visitor
              - open_house
              - source
              - duration_min
              - held
              - bookable
              - booked_at
              - proposed_starts_at
              - attendance_confirmed_at
              - reminded_day_at
              - reminded_soon_at
              - outcome
              - outcome_at
              - agent
              - place
              - place_rooms
              - seat
          description: >-
            The viewing times. When publishing, the start times. When reading,
            the times and windows that have not passed yet.
      required:
        - code
        - duration_min
        - confirmation
        - timezone
        - schedule_mode
        - slots
      title: ViewingAgendaApiResource
    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
  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.