Leases API
Create and manage rental agreements with full French regulatory compliance. The Leases API handles the entire lease lifecycle: creation, tenant assignment, PDF generation, electronic signatures, rent revisions, amendments, and termination.
Quick Example
Code
Common Workflows
Create and sign a lease
POST /api/leases— Create the leasePOST /api/leases/{lease_id}/lessees— Add tenantsPOST /api/leases/{lease_id}/pdf— Generate the documentPOST /api/leases/{lease_id}/signature/initiate— Start e-signature- See the full tutorial
Annual rent revision (IRL)
GET /api/leases/{lease_id}— Get current rentPOST /api/leases/{lease_id}/amendments— Create revision amendmentPUT /api/leases/{lease_id}/rent— Apply new rent amount
Terminate a lease
PUT /api/leases/{lease_id}/lessees/{lessee_id}/end— End tenant's termPUT /api/leases/{lease_id}/status— Set status toTERMINATEDPOST /api/leases/{lease_id}/pdf— Generate final documents
Overview
The Leases API provides complete lease management with support for:
- Lease Lifecycle: Creation, updates, status management, and termination
- Tenant Management: Associate multiple tenants with leases
- Document Management: Upload and manage lease-related documents
- Amendment System: Track lease modifications and changes
- PDF Generation: Create formatted lease documents
- Compliance Checking: French rental law compliance validation
- Rent Management: Complex rent calculations and revisions
Authentication
All endpoints require authentication with the following permissions:
- LeasesRead: For GET operations
- LeasesWrite: For POST and PUT operations
- LeasesDelete: For DELETE operations
Base URL
All lease endpoints are prefixed with /api/leases
Core Lease Operations
List Leases
GET /api/leases
Retrieve all leases for the tenant with optional filtering.
Response:
Code
Create Lease
POST /api/leases
Create a new lease agreement.
Request Body:
Code
Response: 201 Created
Returns the created lease object.
Get Lease
GET /api/leases/{lease_id}
Retrieve a specific lease by ID.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns the lease object.
Update Lease
PUT /api/leases/{lease_id}
Update an existing lease. All fields are optional.
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 200 OK
Returns the updated lease object.
Delete Lease
DELETE /api/leases/{lease_id}
Delete a lease (typically only allowed for draft leases).
Path Parameters:
lease_id(UUID): The lease ID
Response: 204 No Content
Change Lease Status
PUT /api/leases/{lease_id}/status
Change the status of a lease (Active, Terminated, etc.).
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 200 OK
Returns the updated lease object.
Update Lease Rent
PUT /api/leases/{lease_id}/rent
Update lease rent amount with revision tracking.
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 200 OK
Returns the updated lease object.
List Leases by Estate
GET /api/leases/estate/{estate_id}
Retrieve all leases for a specific estate.
Path Parameters:
estate_id(UUID): The estate ID
Response: 200 OK
Returns array of lease objects.
Lease Documents Management
Create Document
POST /api/leases/{lease_id}/documents
Upload a document to a lease.
Path Parameters:
lease_id(UUID): The lease ID
This endpoint uses multipart/form-data to upload the file directly.
Form Fields:
document_type(required, string): The type of document (e.g.,LeaseAgreement)description(optional, string): A description of the documentfile(required, binary): The file to upload
Example:
Code
Response: 201 Created
Returns the created document object.
List Documents
GET /api/leases/{lease_id}/documents
Retrieve all documents for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Code
Get Document
GET /api/leases/{lease_id}/documents/{document_id}
Retrieve a specific document.
Path Parameters:
lease_id(UUID): The lease IDdocument_id(UUID): The document ID
Response: 200 OK
Returns the document object.
Update Document
PUT /api/leases/{lease_id}/documents/{document_id}
Update document metadata.
Path Parameters:
lease_id(UUID): The lease IDdocument_id(UUID): The document ID
Request Body:
Code
Response: 200 OK
Returns the updated document object.
Delete Document
DELETE /api/leases/{lease_id}/documents/{document_id}
Delete a document from a lease.
Path Parameters:
lease_id(UUID): The lease IDdocument_id(UUID): The document ID
Response: 204 No Content
Lease Amendments Management
Create Amendment
POST /api/leases/{lease_id}/amendments
Create an amendment to modify lease terms.
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 201 Created
Returns the created amendment object.
List Amendments
GET /api/leases/{lease_id}/amendments
Retrieve all amendments for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns array of amendment objects.
Get Amendment
GET /api/leases/{lease_id}/amendments/{amendment_id}
Retrieve a specific amendment.
Path Parameters:
lease_id(UUID): The lease IDamendment_id(UUID): The amendment ID
Response: 200 OK
Returns the amendment object.
Update Amendment
PUT /api/leases/{lease_id}/amendments/{amendment_id}
Update an amendment (only for draft amendments).
Path Parameters:
lease_id(UUID): The lease IDamendment_id(UUID): The amendment ID
Request Body:
Code
Response: 200 OK
Returns the updated amendment object.
Delete Amendment
DELETE /api/leases/{lease_id}/amendments/{amendment_id}
Delete an amendment (only for draft amendments).
Path Parameters:
lease_id(UUID): The lease IDamendment_id(UUID): The amendment ID
Response: 204 No Content
Change Amendment Status
PUT /api/leases/{lease_id}/amendments/{amendment_id}/status
Change the status of an amendment.
Path Parameters:
lease_id(UUID): The lease IDamendment_id(UUID): The amendment ID
Request Body:
Code
Response: 200 OK
Returns the updated amendment object.
Lease Tenants (Lessees) Management
Add Tenant to Lease
POST /api/leases/{lease_id}/lessees
Add a tenant to a lease.
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 201 Created
Returns the created lease-tenant association.
List Lease Tenants
GET /api/leases/{lease_id}/lessees
Retrieve all tenants for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns array of lease-tenant associations.
Get Active Tenants
GET /api/leases/{lease_id}/lessees/active
Retrieve only active tenants for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns array of active lease-tenant associations.
Get Lease Tenant
GET /api/leases/{lease_id}/lessees/{lessee_id}
Retrieve specific tenant details for a lease.
Path Parameters:
lease_id(UUID): The lease IDlessee_id(UUID): The tenant ID
Response: 200 OK
Returns the lease-tenant association object.
Update Lease Tenant
PUT /api/leases/{lease_id}/lessees/{lessee_id}
Update tenant information in a lease.
Path Parameters:
lease_id(UUID): The lease IDlessee_id(UUID): The tenant ID
Request Body:
Code
Response: 200 OK
Returns the updated lease-tenant association.
Remove Tenant from Lease
DELETE /api/leases/{lease_id}/lessees/{lessee_id}
Remove a tenant from a lease.
Path Parameters:
lease_id(UUID): The lease IDlessee_id(UUID): The tenant ID
Response: 204 No Content
End Tenant Term
PUT /api/leases/{lease_id}/lessees/{lessee_id}/end
End a tenant's term in a lease.
Path Parameters:
lease_id(UUID): The lease IDlessee_id(UUID): The tenant ID
Request Body:
Code
Response: 200 OK
Returns the updated lease-tenant association.
PDF Generation and Management
Generate PDF
POST /api/leases/{lease_id}/pdf
Generate a PDF document for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Request Body:
Code
Response: 201 Created
Code
List Lease PDFs
GET /api/leases/{lease_id}/pdfs
Retrieve all generated PDFs for a lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns array of PDF objects.
Download PDF
GET /api/leases/pdf/{pdf_id}
Download a generated PDF file.
Path Parameters:
pdf_id(UUID): The PDF ID
Response: 200 OK
Returns PDF file with appropriate headers.
Delete PDF
DELETE /api/leases/pdf/{pdf_id}
Delete a generated PDF file.
Path Parameters:
pdf_id(UUID): The PDF ID
Response: 204 No Content
Compliance Management
Check Lease Compliance
GET /api/leases/{lease_id}/compliance
Check lease compliance with French rental regulations (rent control, high-demand zones). Read-only — does not modify the lease.
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Code
Check and Update Lease Compliance
POST /api/leases/{lease_id}/compliance/update
Check compliance AND automatically update the lease with compliance information (e.g., rent_regulation_compliance_status).
Path Parameters:
lease_id(UUID): The lease ID
Response: 200 OK
Returns the same compliance check response as above, with the lease updated in place.
Cache Management
Get PDF Cache Statistics
GET /api/leases/cache/stats
Retrieve PDF generation cache statistics.
Response: 200 OK
Code
Clear PDF Cache
POST /api/leases/cache/clear
Clear the PDF generation cache.
Response: 200 OK
Code
Data Types and Enums
LeaseStatus
DRAFT- Lease being preparedPENDING_SIGNATURE- Awaiting electronic signatureACTIVE- Currently active leaseNOTICE- Notice period (préavis) in progressFINALISATION- Lease being finalized (état des lieux de sortie)TERMINATED- Lease endedEXPIRED- Lease term expired
LeaseRentFrequency
MONTHLY- Monthly rent paymentsQUARTERLY- Quarterly paymentsANNUALLY- Annual payments
LeaseRevisionIndexType
IRL- Indice de Référence des LoyersICC- Indice du Coût de la ConstructionILAT- Indice des Loyers des Activités TertiairesILC- Indice des Loyers CommerciauxNONE- No revision index
LeaseUsageType
RESIDENTIAL_ONLY- Residential use onlyMIXED_PROFESSIONAL- Mixed residential and professional use
ChargeSettlementMode
PROVISION- Provisional with annual regularizationPERIODIC- Periodic payment of actual costsFLAT_RATE- Fixed charge amount
LeasePaymentTerms
TERME_A_ECHOIR- Payment in advance (terme à échoir)TERME_ECHU- Payment after period (terme échu)
LeasePaymentMethod
VIREMENT_BANCAIRE- Bank transferPRELEVEMENT_AUTOMATIQUE- Direct debitCHEQUE- Check paymentESPECES- Cash paymentCARTE_BANCAIRE- Bank cardMANDAT_CASH- Cash money orderAUTRE- Other payment method
Error Responses
Validation Errors
400 Bad Request
Code
Compliance Errors
422 Unprocessable Entity
Code
Not Found
404 Not Found
Code
Common Use Cases
Creating a Standard Residential Lease
- Create lease with
POST /api/leases - Add tenant with
POST /api/leases/{lease_id}/lessees - Upload signed agreement with
POST /api/leases/{lease_id}/documents - Check compliance with
GET /api/leases/{lease_id}/compliance
Annual Rent Revision
- Check current rent with
GET /api/leases/{lease_id} - Calculate new rent based on IRL index
- Create amendment with
POST /api/leases/{lease_id}/amendments - Update rent with
PUT /api/leases/{lease_id}/rent
Lease Termination Process
- End tenant term with
PUT /api/leases/{lease_id}/lessees/{lessee_id}/end - Change lease status with
PUT /api/leases/{lease_id}/status - Generate final documents with
POST /api/leases/{lease_id}/pdf
Document Management Workflow
- Generate lease PDF with
POST /api/leases/{lease_id}/pdf - Download for signing with
GET /api/leases/pdf/{pdf_id} - Upload signed version with
POST /api/leases/{lease_id}/documents - Track document versions through amendments
Business Rules
- Rent Compliance: All leases subject to French rent control laws
- Deposit Limits: Security deposits cannot exceed legal maximums
- Revision Dates: Rent revisions follow legal timing requirements
- Amendment Tracking: All lease changes must be documented
- Tenant Associations: Primary tenant required for all leases
- Status Transitions: Lease status changes follow defined workflows
- Document Retention: Legal document retention requirements
Integration Notes
- Estate Management: Leases are tied to specific estates
- Contact System: Tenants and agents from contact management
- Financial System: Rent calculations and payment tracking
- Compliance Engine: French rental law validation
- Template System: PDF generation from lease templates
- Notification System: Automated reminders and alerts