---
title: "Create a new key"
method: POST
path: "/places/{place_id}/estates/{estate_id}/keys"
tags: ["Keys"]
---

# Create a new key

`POST /places/{place_id}/estates/{estate_id}/keys`

## Request

- Base URL: `https://api.faireplace.com/api`
- URL: `https://api.faireplace.com/api/places/{place_id}/estates/{estate_id}/keys`
- Auth: HTTP bearer

Creates a new key for a property

## Path parameters

- `place_id` string, uuid, required
- `estate_id` string, uuid, required

## Request body

- CreateEstateKey: Data for creating a new key
  - `key_type` 'CLEF' | 'BADGE_MAGNETIQUE' | 'BADGE_RF' | 'BIOMETRIQUE' | 'CLEF_DUPLIQUEE' | 'TELECOMMANDE', required: Key or access badge type
  - `description` string, required: Key description
  - `brand` string, nullable: Key or badge brand
  - `key_number` string, nullable: Key or badge number
  - `quantity` integer: Key quantity
  - `protected_code` string, nullable: Key protection code
  - `security_level` 'LOW' | 'STANDARD' | 'MEDIUM' | 'HIGH' | 'CRITICAL', required: Key security level
  - `access_restrictions` string, nullable: Access restrictions
  - `emergency_contact` string, nullable: Emergency contact
  - `notes` string, nullable: Internal notes about the key

## Response `201`

Key created successfully

- EstateKey: Key or access badge for a property
  - `id` string, uuid, required: Unique key identifier
  - `tenant_id` string, required: Tenant ID (multi-tenant isolation)
  - `estate_id` string, uuid, required: Property ID
  - `key_type` 'CLEF' | 'BADGE_MAGNETIQUE' | 'BADGE_RF' | 'BIOMETRIQUE' | 'CLEF_DUPLIQUEE' | 'TELECOMMANDE', required: Key or access badge type
  - `description` string, nullable: Key description
  - `brand` string, nullable: Key or badge brand
  - `key_number` string, nullable: Key or badge number
  - `quantity` integer, nullable: Key quantity
  - `protected_code` string, nullable: Key protection code
  - `status` 'ACTIVE' | 'RENDERED' | 'LOST' | 'STOLEN' | 'DAMAGED' | 'REPLACED' | 'ARCHIVED', required: Key status
  - `security_level` 'LOW' | 'STANDARD' | 'MEDIUM' | 'HIGH' | 'CRITICAL', required: Key security level
  - `access_restrictions` string, nullable: Access restrictions
  - `emergency_contact` string, nullable: Emergency contact
  - `is_rendered` boolean, required: Indicates whether the key has been returned
  - `notes` string, nullable: Internal notes about the key
  - `rendered_to` string, nullable: Person to whom the key was handed over
  - `rendered_by` string, nullable: Person who handed over the key
  - `rendered_at` string, date-time, nullable: Date and time when the key was handed over
  - `expected_return_date` string, date-time, nullable: Expected key return date
  - `purpose` string, nullable: Reason for handing over the key
  - `last_status_change_at` string, date-time, nullable: Date and time of the last status change
  - `last_status_change_by` string, nullable: Person who made the last status change
  - `created_at` string, date-time, required: Creation date
  - `updated_at` string, date-time, required: Last modification date

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/faireplace/apis/faireplace-property-management-api.md) · [All operations](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/revisions/69de39762919?raw)
