---
title: "Create an appointment"
url: "https://real-estate-agency.apim.eu/apis/viewing-appointments/versions/70b37971-1301-4569-bd6c-e68e8b19e7e2/operations/createAppointment"
---

> Full API specification: https://real-estate-agency.apim.eu/apis/viewing-appointments/versions/70b37971-1301-4569-bd6c-e68e8b19e7e2.md

# Create an appointment

`POST` `/appointments`

Operation ID: `createAppointment`

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Created
- `400` - The request doesn't match the schema
- `409` - Time conflict with an existing appointment

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Viewing Appointments
  version: 1.0.0
servers:
  - url: https://api.realestateagency.example/v1
    description: Production
  - url: https://sandbox.api.realestateagency.example/v1
    description: Sandbox
paths:
  /appointments:
    post:
      tags:
        - Appointments
      summary: Create an appointment
      operationId: createAppointment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AppointmentInput"
            examples:
              single:
                summary: Individual viewing
                value:
                  property_id: prop_8f2c1a
                  type: individual
                  start: 2026-09-03T16:00:00+02:00
                  duration_minutes: 30
                  meeting_point: In front of the main entrance, 148 Elm Street
              group:
                summary: Group viewing with twelve slots
                value:
                  property_id: prop_8f2c1a
                  type: group
                  start: 2026-09-05T11:00:00+02:00
                  duration_minutes: 60
                  slots: 12
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Appointment"
        "400":
          $ref: "#/components/responses/ValidationError"
        "409":
          description: Time conflict with an existing appointment
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                code: conflict
                message: There is already an appointment for this property at that time.
                details:
                  - field: start
                    reason: overlap
security:
  - apiKey: []
components:
  schemas:
    AppointmentInput:
      type: object
      required:
        - property_id
        - type
        - start
      properties:
        property_id:
          type: string
          example: prop_8f2c1a
        type:
          $ref: "#/components/schemas/AppointmentType"
        start:
          type: string
          format: date-time
          example: 2026-09-03T16:00:00+02:00
        duration_minutes:
          type: integer
          minimum: 10
          maximum: 240
          default: 30
        slots:
          type: integer
          minimum: 1
          description: "Only evaluated when `type: group`."
          example: 12
        meeting_point:
          type: string
          maxLength: 200
          example: In front of the main entrance, 148 Elm Street
        note:
          type: string
          maxLength: 500
          example: Please bring photo ID; the unit is currently occupied.
    Appointment:
      allOf:
        - $ref: "#/components/schemas/AppointmentInput"
        - type: object
          properties:
            id:
              type: string
              example: appt_9a44
            status:
              $ref: "#/components/schemas/AppointmentStatus"
            confirmations_count:
              type: integer
              example: 8
            waitlist_count:
              type: integer
              example: 2
            created_at:
              type: string
              format: date-time
              example: 2026-08-20T11:02:10Z
    Error:
      type: object
      description: Uniform error format across all Real Estate Agency APIs.
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: validation_failed
        message:
          type: string
          example: The appointment start time is missing.
        details:
          type: array
          items:
            $ref: "#/components/schemas/ErrorDetail"
    AppointmentType:
      type: string
      enum:
        - individual
        - group
        - virtual
      example: individual
    AppointmentStatus:
      type: string
      enum:
        - scheduled
        - confirmed
        - completed
        - cancelled
      example: confirmed
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          example: start
        reason:
          type: string
          example: missing
  responses:
    ValidationError:
      description: The request doesn't match the schema
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: |
        Every call carries an API key in the `apikey` header. You generate the
        key in the Real Estate portal under "My Apps"; it's shown exactly once.

        Each key has the scopes it's allowed to use attached to it. If one is
        missing, the API responds with `403` and `code: "scope_missing"`; the
        missing scope is in `details[].field`.
```
