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

# Enregistrer des photos d’état des lieux téléversées

> **Accès** : `rentals.operate`

Étape 3 sur 3 : enregistre, tout ou rien, les fichiers envoyés par `PUT`, désignés par `uploadId` ; `data` suit l’ordre de `items`.

**Contrôles** : chaque fichier est vérifié avant toute écriture (reçu, taille, format réel). Un élément refusé fait refuser le lot en 422 `UPLOAD_INVALID`, un `errors[]` par élément : `upload_incomplete` (refaites le `PUT`), `upload_expired` (préparez un nouveau téléversement), `too_small`, `too_big`, `invalid_format`, `upload_conflict` (déjà enregistré autrement), `duplicate`. `uploadId` inconnu ou retiré depuis → 422 `REFERENCE_NOT_FOUND`.

**Rejeu** : l’identité est `uploadId`, sans `Idempotency-Key` ; le même lot renvoie les mêmes photos.

**Compteur** : la photo `DASHBOARD` remplace celle de sa phase (`effects.replacedPhotoIds`). Les photos `DEPARTURE` envoyées avant le départ figurent dans le contrat de départ.



## OpenAPI

````yaml /openapi.json post /rentals/{rentalId}/photos
openapi: 3.1.0
info:
  title: API Lexio
  version: 1.0.1
  description: >-
    # API Lexio v1


    L’API Lexio permet à un loueur de véhicules, ou à une plateforme partenaire
    autorisée par lui, de chiffrer, réserver, suivre et administrer ses
    locations depuis un serveur. Chaque appel agit sur l’organisation Lexio d’un
    seul loueur.


    - **Adresse de base** : `https://api.lexio.rent/api/external/v1`

    - **Authentification** : `Authorization: Bearer lck_…`, une clé créée par le
    loueur dans Lexio.

    - **Format** : JSON en UTF-8 ; erreurs RFC 9457 avec un `code` stable.

    - **Spécification OpenAPI 3.1** :
    [https://docs.lexio.rent/openapi.json](https://docs.lexio.rent/openapi.json),
    à importer dans votre client HTTP ou à utiliser pour générer un client.

    - **Contact** (support technique, demande d’accès, organisation de test) :
    contact@lexio.rent.


    Vocabulaire : une **location** (`/rentals`) est un contrat de location d’un
    véhicule ; un **lieu** (`/locations`) est une adresse de départ ou de
    retour.


    ## Guides


    1. [Démarrage rapide](https://docs.lexio.rent/demarrage-rapide) : de la
    recherche d’un véhicule à l’annulation.

    2. [Authentification et scopes](https://docs.lexio.rent/authentification) :
    clés du loueur et clés partenaires, scopes, plans.

    3. [Montants et TVA](https://docs.lexio.rent/montants-et-tva) : HT, TTC,
    devises, caution et franchise.

    4. [Cycle de vie d’une location](https://docs.lexio.rent/cycle-de-vie) :
    statuts et actions possibles.

    5. [Limites de débit](https://docs.lexio.rent/limites),
    [Pagination](https://docs.lexio.rent/pagination), [Idempotence et
    reprise](https://docs.lexio.rent/idempotence).

    6. [Synchronisation par événements](https://docs.lexio.rent/synchronisation)
    : suivre les changements sans webhook.

    7. [Versions et évolutions](https://docs.lexio.rent/versions),
    [Erreurs](https://docs.lexio.rent/erreurs).

    8. [Intégration d’une plateforme de
    réservation](https://docs.lexio.rent/integration-broker) : parcours
    partenaire, paiement.

    9. [Ce qui se gère dans
    Lexio](https://docs.lexio.rent/ce-qui-se-gere-dans-lexio) et [Historique des
    versions](https://docs.lexio.rent/historique).
  contact:
    name: Support Lexio
    email: contact@lexio.rent
    url: https://docs.lexio.rent
servers:
  - url: https://api.lexio.rent/api/external/v1
    description: Production
security:
  - ApiKey: []
tags:
  - name: Organisation
    description: >-
      Réglages de l’organisation liée à la clé : devise, fuseau, TVA, horaires,
      règles de réservation.
  - name: Offre
    description: >-
      Disponibilités et devis : ce qui est réservable, à quel prix, avant de
      créer une location.
  - name: Locations
    description: >-
      Les contrats de location : création, lecture, modification de notes,
      suppression.
  - name: Modifications
    description: >-
      Changer les dates, le véhicule, la protection, le titulaire ou les options
      d’une location, ou l’annuler.
  - name: Départ et retour
    description: >-
      Remise des clés et retour du véhicule : kilométrage, carburant, photos,
      état des lieux.
  - name: Paiements
    description: Encaissements, cautions et remboursements enregistrés sur une location.
  - name: Événements
    description: >-
      Flux des changements à relire pour synchroniser votre système, sans
      webhook.
  - name: Clients
    description: Fiches des clients particuliers et entreprises.
  - name: Flotte
    description: Véhicules, leur archivage et leurs indisponibilités.
  - name: Catalogue
    description: >-
      Catégories, lieux, options, franchises, cautions et forfaits kilométriques
      proposés à la location.
  - name: Tarification
    description: Saisons, remises de durée, paliers de délai et réglages de prix.
  - name: Entretien
    description: Alertes et historique d’entretien des véhicules.
paths:
  /rentals/{rentalId}/photos:
    post:
      tags:
        - Départ et retour
      summary: Enregistrer des photos d’état des lieux téléversées
      description: >-
        **Accès** : `rentals.operate`


        Étape 3 sur 3 : enregistre, tout ou rien, les fichiers envoyés par
        `PUT`, désignés par `uploadId` ; `data` suit l’ordre de `items`.


        **Contrôles** : chaque fichier est vérifié avant toute écriture (reçu,
        taille, format réel). Un élément refusé fait refuser le lot en 422
        `UPLOAD_INVALID`, un `errors[]` par élément : `upload_incomplete`
        (refaites le `PUT`), `upload_expired` (préparez un nouveau
        téléversement), `too_small`, `too_big`, `invalid_format`,
        `upload_conflict` (déjà enregistré autrement), `duplicate`. `uploadId`
        inconnu ou retiré depuis → 422 `REFERENCE_NOT_FOUND`.


        **Rejeu** : l’identité est `uploadId`, sans `Idempotency-Key` ; le même
        lot renvoie les mêmes photos.


        **Compteur** : la photo `DASHBOARD` remplace celle de sa phase
        (`effects.replacedPhotoIds`). Les photos `DEPARTURE` envoyées avant le
        départ figurent dans le contrat de départ.
      operationId: registerRentalPhotos
      parameters:
        - in: path
          name: rentalId
          schema:
            examples:
              - 9c2d7e4a-5b1f-4d3c-8a6e-0f1b2c3d4e5f
            type: string
            format: uuid
          required: true
          description: Identifiant de la location.
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            example:
              items:
                - uploadId: 3f6b1c2a-7d8e-4f90-a1b2-c3d4e5f60718
                  takenAt: '2026-06-10T09:58:12+02:00'
                - uploadId: 8a9b0c1d-2e3f-4a5b-9c6d-7e8f9a0b1c2d
                  takenAt: '2026-06-10T09:59:40+02:00'
                  annotations:
                    - x: 0.42
                      'y': 0.61
                      width: 0.12
                      height: 0.08
                      label: Rayure
                      comment: Jante avant gauche
            schema:
              type: object
              properties:
                items:
                  description: >-
                    Fichiers à enregistrer, 50 au plus, chacun une fois ; tout
                    ou rien.
                  minItems: 1
                  maxItems: 50
                  type: array
                  items:
                    type: object
                    properties:
                      uploadId:
                        examples:
                          - 7c9e6679-7425-40de-944b-e07fc1f90ae7
                        description: Identifiant renvoyé par photo-uploads.
                        type: string
                        format: uuid
                      takenAt:
                        description: >-
                          Instant de prise de vue, RFC 3339 avec décalage (sans
                          → 400 offset_required). Défaut : instant de
                          l’enregistrement. Borné à [création de la location ;
                          maintenant + 5 min].
                        examples:
                          - '2026-11-10T10:00:00+01:00'
                        type: string
                      annotations:
                        description: >-
                          Zones signalées sur la photo ; rien n’est borné ni
                          tronqué en silence.
                        maxItems: 50
                        type: array
                        items:
                          type: object
                          properties:
                            x:
                              description: Bord gauche, fraction de la largeur.
                              type: number
                              minimum: 0
                              maximum: 1
                            'y':
                              description: Bord haut, fraction de la hauteur.
                              type: number
                              minimum: 0
                              maximum: 1
                            width:
                              description: Largeur, fraction de la largeur.
                              type: number
                              exclusiveMinimum: 0
                              maximum: 1
                            height:
                              description: Hauteur, fraction de la hauteur.
                              type: number
                              exclusiveMinimum: 0
                              maximum: 1
                            label:
                              description: >-
                                Classification saisie (ex. « Rayure »), non
                                contractuelle.
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 50
                                - type: 'null'
                            comment:
                              description: Commentaire libre ; null si absent.
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 200
                                - type: 'null'
                          required:
                            - x
                            - 'y'
                            - width
                            - height
                          additionalProperties: false
                    required:
                      - uploadId
                    additionalProperties: false
              required:
                - items
              additionalProperties: false
      responses:
        '200':
          description: Enregistrer des photos d’état des lieux téléversées
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    maxItems: 50
                    type: array
                    items:
                      $ref: '#/components/schemas/Photo'
                  effects:
                    type: object
                    properties:
                      replacedPhotoIds:
                        description: >-
                          Photos du compteur remplacées, supprimées avec leurs
                          fichiers : au plus une par phase, davantage si
                          l’agence en avait déposé plusieurs pour une même phase
                          depuis Lexio.
                        maxItems: 50
                        type: array
                        items:
                          examples:
                            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
                          type: string
                          format: uuid
                    required:
                      - replacedPhotoIds
                required:
                  - data
                  - effects
        '400':
          description: '`MALFORMED_REQUEST`, `VALIDATION_FAILED`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/MalformedRequestProblem'
                  - $ref: '#/components/schemas/ValidationFailedProblem'
        '401':
          description: >-
            `API_KEY_DISABLED`, `API_KEY_EXPIRED`, `API_KEY_INVALID`,
            `API_KEY_MISSING`, `API_KEY_REVOKED`
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            WWW-Authenticate:
              $ref: '#/components/headers/WwwAuthenticate'
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ApiKeyDisabledProblem'
                  - $ref: '#/components/schemas/ApiKeyExpiredProblem'
                  - $ref: '#/components/schemas/ApiKeyInvalidProblem'
                  - $ref: '#/components/schemas/ApiKeyMissingProblem'
                  - $ref: '#/components/schemas/ApiKeyRevokedProblem'
        '403':
          description: >-
            `FEATURE_NOT_AVAILABLE`, `INSUFFICIENT_SCOPE`,
            `ORGANIZATION_SUSPENDED`
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FeatureNotAvailableProblem'
                  - $ref: '#/components/schemas/InsufficientScopeProblem'
                  - $ref: '#/components/schemas/OrganizationSuspendedProblem'
        '404':
          description: '`NOT_FOUND`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/NotFoundProblem'
        '409':
          description: >-
            `IDEMPOTENCY_IN_FLIGHT`, `RENTAL_BUSY`, `RENTAL_CHANGED`,
            `RENTAL_STATUS_NOT_ALLOWED`
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/IdempotencyInFlightProblem'
                  - $ref: '#/components/schemas/RentalBusyProblem'
                  - $ref: '#/components/schemas/RentalChangedProblem'
                  - $ref: '#/components/schemas/RentalStatusNotAllowedProblem'
        '413':
          description: '`PAYLOAD_TOO_LARGE`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PayloadTooLargeProblem'
        '415':
          description: '`UNSUPPORTED_MEDIA_TYPE`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/UnsupportedMediaTypeProblem'
        '422':
          description: '`IDEMPOTENCY_KEY_REUSED`, `REFERENCE_NOT_FOUND`, `UPLOAD_INVALID`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/IdempotencyKeyReusedProblem'
                  - $ref: '#/components/schemas/ReferenceNotFoundProblem'
                  - $ref: '#/components/schemas/UploadInvalidProblem'
        '429':
          description: '`RATE_LIMITED`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/RateLimitedProblem'
        '500':
          description: '`INTERNAL_ERROR`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/InternalErrorProblem'
        '503':
          description: '`SERVICE_UNAVAILABLE`'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableProblem'
      security:
        - ApiKey: []
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      example: 8b3e1d2c-4a5f-4c6b-9e7d-1f2a3b4c5d6e
      description: >-
        Clé unique de l’opération, réutilisée à chaque nouvel essai : un rejeu
        avec la même clé et le même corps renvoie la réponse initiale sans rien
        réécrire. Voir [Idempotence](https://docs.lexio.rent/idempotence).
      schema:
        type: string
        minLength: 1
        maxLength: 255
        pattern: ^[\x20-\x7E]+$
        examples:
          - 8b3e1d2c-4a5f-4c6b-9e7d-1f2a3b4c5d6e
  headers:
    XRequestId:
      description: Identifiant de la requête, à communiquer au support.
      schema:
        type: string
    RateLimitLimit:
      description: Plafond du seau de débit qui s’applique à la requête.
      schema:
        type: integer
        minimum: 0
    RateLimitRemaining:
      description: Requêtes encore permises dans la fenêtre en cours.
      schema:
        type: integer
        minimum: 0
    RateLimitReset:
      description: Secondes avant la remise à zéro de la fenêtre.
      schema:
        type: integer
        minimum: 0
    IdempotentReplayed:
      description: >-
        `true` quand la réponse est le rejeu d’une requête déjà traitée avec la
        même `Idempotency-Key`.
      schema:
        type: string
        enum:
          - 'true'
    WwwAuthenticate:
      description: >-
        Schéma d’authentification attendu (`Bearer`), avec
        `error="invalid_token"` pour une clé refusée.
      schema:
        type: string
    RetryAfter:
      description: Secondes à attendre avant de rejouer la requête.
      schema:
        type: integer
        minimum: 0
  schemas:
    Photo:
      examples:
        - id: b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e
          phase: DEPARTURE
          view: FRONT_LEFT
          takenAt: '2026-11-07T09:58:12+01:00'
          uploadId: 3f6b1c2a-7d8e-4f90-a1b2-c3d4e5f60718
          annotations:
            - x: 0.42
              'y': 0.61
              width: 0.12
              height: 0.08
              label: Rayure
              comment: Jante avant gauche
          processingStatus: READY
          original:
            url: https://storage.lexio.rent/p/b1c2d3e4?sig=1a7f
            expiresAt: '2026-11-07T11:00:05+01:00'
          annotated:
            url: https://storage.lexio.rent/p/b1c2d3e4-a?sig=5c2e
            expiresAt: '2026-11-07T11:00:05+01:00'
      type: object
      properties:
        id:
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          description: Identifiant de la photo.
          type: string
          format: uuid
        phase:
          description: 'Moment de la prise : départ, retour, ou sinistre (`INCIDENT`).'
          type: string
          enum:
            - DEPARTURE
            - RETURN
            - INCIDENT
        view:
          description: null = photo libre, hors vue du tour.
          anyOf:
            - type: string
              enum:
                - FRONT
                - FRONT_LEFT
                - REAR_LEFT
                - REAR
                - REAR_RIGHT
                - FRONT_RIGHT
                - WINDSHIELD
                - INTERIOR
                - TRUNK
                - DASHBOARD
                - TW_FRONT
                - TW_COCKPIT
                - TW_LEFT
                - TW_RIGHT
                - TW_REAR
                - TW_SADDLE
                - WHEEL_FRONT_LEFT
                - DOOR_FRONT_LEFT
                - DOOR_REAR_LEFT
                - WHEEL_REAR_LEFT
                - WHEEL_REAR_RIGHT
                - DOOR_REAR_RIGHT
                - DOOR_FRONT_RIGHT
                - WHEEL_FRONT_RIGHT
                - REAR_SEATS
            - type: 'null'
        takenAt:
          examples:
            - '2026-11-10T10:00:00+01:00'
          description: >-
            Instant de prise de vue (`takenAt` envoyé à l’enregistrement, sinon
            instant de l’enregistrement), décalage de l’agence ; sert à
            l’horodatage incrusté.
          type: string
          format: date-time
        uploadId:
          description: Téléversement d’origine ; null pour une photo déposée depuis Lexio.
          anyOf:
            - examples:
                - 7c9e6679-7425-40de-944b-e07fc1f90ae7
              type: string
              format: uuid
            - type: 'null'
        annotations:
          description: >-
            Zones signalées sur la photo, telles qu’enregistrées après bornage à
            l’image.
          maxItems: 50
          type: array
          items:
            type: object
            properties:
              x:
                description: Bord gauche, fraction de la largeur.
                type: number
                minimum: 0
                maximum: 1
              'y':
                description: Bord haut, fraction de la hauteur.
                type: number
                minimum: 0
                maximum: 1
              width:
                description: Largeur, fraction de la largeur.
                type: number
                exclusiveMinimum: 0
                maximum: 1
              height:
                description: Hauteur, fraction de la hauteur.
                type: number
                exclusiveMinimum: 0
                maximum: 1
              label:
                description: Classification saisie (ex. « Rayure »), non contractuelle.
                anyOf:
                  - type: string
                    minLength: 1
                    maxLength: 50
                  - type: 'null'
              comment:
                description: Commentaire libre ; null si absent.
                anyOf:
                  - type: string
                    minLength: 1
                    maxLength: 200
                  - type: 'null'
            required:
              - x
              - 'y'
              - width
              - height
              - label
              - comment
        processingStatus:
          description: >-
            PENDING : horodatage, conversion HEIC ou image annotée en cours ;
            READY : terminé. Interroger avec un délai croissant et un plafond de
            quelques minutes : une photo dont l’image annotée n’a pas pu être
            produite peut rester PENDING.
          type: string
          enum:
            - PENDING
            - READY
        original:
          $ref: '#/components/schemas/SignedDocument'
          description: >-
            Original (preuve), URL signée valable une heure. Son contenu peut
            encore changer tant que processingStatus vaut PENDING.
          examples:
            - url: >-
                https://storage.example.com/contrats/LOC-2026.11-0042.pdf?signature=9b2e41c7
              expiresAt: '2026-11-10T11:12:00+01:00'
        annotated:
          description: >-
            Image aux annotations incrustées, URL signée valable une heure ;
            null si `annotations` est vide ou tant que `processingStatus` vaut
            `PENDING`.
          anyOf:
            - $ref: '#/components/schemas/SignedDocument'
            - type: 'null'
      required:
        - id
        - phase
        - view
        - takenAt
        - uploadId
        - annotations
        - processingStatus
        - original
        - annotated
    MalformedRequestProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/malformed-request
        title:
          type: string
          const: Corps de requête illisible
        status:
          type: number
          const: 400
        code:
          type: string
          const: MALFORMED_REQUEST
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ValidationFailedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/validation-failed
        title:
          type: string
          const: Requête invalide
        status:
          type: number
          const: 400
        code:
          type: string
          const: VALIDATION_FAILED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        errors:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
              code:
                type: string
                enum:
                  - required
                  - invalid_type
                  - invalid_format
                  - invalid_value
                  - too_small
                  - too_big
                  - too_many_decimals
                  - out_of_range
                  - unknown_field
                  - null_not_allowed
                  - empty_string
                  - empty_patch
                  - mutually_exclusive
                  - not_applicable
                  - duplicate
                  - end_before_start
                  - date_in_past
                  - nonexistent_local_time
                  - offset_not_allowed
                  - offset_required
                  - upload_expired
                  - upload_incomplete
                  - upload_conflict
              detail:
                type: string
            required:
              - pointer
              - code
              - detail
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - errors
    ApiKeyDisabledProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/api-key-disabled
        title:
          type: string
          const: Clé API désactivée
        status:
          type: number
          const: 401
        code:
          type: string
          const: API_KEY_DISABLED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ApiKeyExpiredProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/api-key-expired
        title:
          type: string
          const: Clé API expirée
        status:
          type: number
          const: 401
        code:
          type: string
          const: API_KEY_EXPIRED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ApiKeyInvalidProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/api-key-invalid
        title:
          type: string
          const: Clé API invalide
        status:
          type: number
          const: 401
        code:
          type: string
          const: API_KEY_INVALID
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ApiKeyMissingProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/api-key-missing
        title:
          type: string
          const: Clé API absente
        status:
          type: number
          const: 401
        code:
          type: string
          const: API_KEY_MISSING
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ApiKeyRevokedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/api-key-revoked
        title:
          type: string
          const: Clé API révoquée
        status:
          type: number
          const: 401
        code:
          type: string
          const: API_KEY_REVOKED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    FeatureNotAvailableProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/feature-not-available
        title:
          type: string
          const: Fonctionnalité non incluse
        status:
          type: number
          const: 403
        code:
          type: string
          const: FEATURE_NOT_AVAILABLE
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        feature:
          type: string
          minLength: 1
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - feature
    InsufficientScopeProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/insufficient-scope
        title:
          type: string
          const: Scope insuffisant
        status:
          type: number
          const: 403
        code:
          type: string
          const: INSUFFICIENT_SCOPE
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        requiredScopes:
          minItems: 1
          maxItems: 20
          type: array
          items:
            type: string
            enum:
              - offers.read
              - quotes.write
              - rentals.read
              - rentals.write
              - rentals.operate
              - rentals.delete
              - payments.write
              - payments.refund
              - customers.read
              - customers.write
              - customers.delete
              - vehicles.read
              - vehicles.write
              - vehicles.delete
              - catalog.read
              - catalog.write
              - pricing.read
              - pricing.write
              - maintenance.read
              - maintenance.write
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - requiredScopes
    OrganizationSuspendedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/organization-suspended
        title:
          type: string
          const: Organisation suspendue
        status:
          type: number
          const: 403
        code:
          type: string
          const: ORGANIZATION_SUSPENDED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    NotFoundProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/not-found
        title:
          type: string
          const: Ressource introuvable
        status:
          type: number
          const: 404
        code:
          type: string
          const: NOT_FOUND
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        resource:
          type: string
          enum:
            - RENTAL
            - RENTAL_OPTION
            - QUOTE
            - PAYMENT
            - INVOICE
            - PHOTO
            - AMENDMENT
            - INSPECTION
            - CUSTOMER
            - VEHICLE
            - VEHICLE_BLOCK
            - CATEGORY
            - OPTION
            - DEDUCTIBLE
            - DEPOSIT
            - MILEAGE_PACKAGE
            - LOCATION
            - SEASON
            - SEASON_CALENDAR_MONTH
            - DURATION_DISCOUNT
            - LEAD_TIME_TIER
            - MAINTENANCE_RECORD
            - MAINTENANCE_OPERATION
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - resource
    IdempotencyInFlightProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/idempotency-in-flight
        title:
          type: string
          const: Requête identique en cours
        status:
          type: number
          const: 409
        code:
          type: string
          const: IDEMPOTENCY_IN_FLIGHT
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    RentalBusyProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/rental-busy
        title:
          type: string
          const: Location occupée
        status:
          type: number
          const: 409
        code:
          type: string
          const: RENTAL_BUSY
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    RentalChangedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/rental-changed
        title:
          type: string
          const: Location modifiée entre-temps
        status:
          type: number
          const: 409
        code:
          type: string
          const: RENTAL_CHANGED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    RentalStatusNotAllowedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/rental-status-not-allowed
        title:
          type: string
          const: Statut de la location incompatible
        status:
          type: number
          const: 409
        code:
          type: string
          const: RENTAL_STATUS_NOT_ALLOWED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        errors:
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
              code:
                type: string
                enum:
                  - required
                  - invalid_type
                  - invalid_format
                  - invalid_value
                  - too_small
                  - too_big
                  - too_many_decimals
                  - out_of_range
                  - unknown_field
                  - null_not_allowed
                  - empty_string
                  - empty_patch
                  - mutually_exclusive
                  - not_applicable
                  - duplicate
                  - end_before_start
                  - date_in_past
                  - nonexistent_local_time
                  - offset_not_allowed
                  - offset_required
                  - upload_expired
                  - upload_incomplete
                  - upload_conflict
              detail:
                type: string
            required:
              - pointer
              - code
              - detail
        rentalStatus:
          type: string
          enum:
            - RESERVED
            - PENDING_APPROVAL
            - IN_PROGRESS
            - COMPLETED
            - CANCELLED
        allowedStatuses:
          maxItems: 10
          type: array
          items:
            type: string
            enum:
              - RESERVED
              - PENDING_APPROVAL
              - IN_PROGRESS
              - COMPLETED
              - CANCELLED
        action:
          type: string
          enum:
            - CANCEL
            - PICKUP
            - RETURN
            - RESCHEDULE
            - CHANGE_VEHICLE
            - CHANGE_COVERAGE
            - CHANGE_CUSTOMER
            - SET_OPTION_QUANTITY
            - REMOVE_OPTION
            - EDIT_NOTES
            - EDIT_LOCATIONS
            - DELETE
            - ADD_PAYMENT
            - REFUND
            - DELETE_PAYMENT
            - UPLOAD_PHOTO
            - DELETE_PHOTO
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - rentalStatus
        - allowedStatuses
        - action
    PayloadTooLargeProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/payload-too-large
        title:
          type: string
          const: Corps trop volumineux
        status:
          type: number
          const: 413
        code:
          type: string
          const: PAYLOAD_TOO_LARGE
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        maxBytes:
          type: integer
          minimum: 1
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - maxBytes
    UnsupportedMediaTypeProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/unsupported-media-type
        title:
          type: string
          const: Type de contenu non pris en charge
        status:
          type: number
          const: 415
        code:
          type: string
          const: UNSUPPORTED_MEDIA_TYPE
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        accepted:
          minItems: 1
          maxItems: 10
          type: array
          items:
            type: string
            minLength: 1
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - accepted
    IdempotencyKeyReusedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/idempotency-key-reused
        title:
          type: string
          const: Clé d’idempotence réutilisée
        status:
          type: number
          const: 422
        code:
          type: string
          const: IDEMPOTENCY_KEY_REUSED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ReferenceNotFoundProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/reference-not-found
        title:
          type: string
          const: Référence introuvable
        status:
          type: number
          const: 422
        code:
          type: string
          const: REFERENCE_NOT_FOUND
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        errors:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
              code:
                type: string
                enum:
                  - required
                  - invalid_type
                  - invalid_format
                  - invalid_value
                  - too_small
                  - too_big
                  - too_many_decimals
                  - out_of_range
                  - unknown_field
                  - null_not_allowed
                  - empty_string
                  - empty_patch
                  - mutually_exclusive
                  - not_applicable
                  - duplicate
                  - end_before_start
                  - date_in_past
                  - nonexistent_local_time
                  - offset_not_allowed
                  - offset_required
                  - upload_expired
                  - upload_incomplete
                  - upload_conflict
              detail:
                type: string
            required:
              - pointer
              - code
              - detail
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - errors
    UploadInvalidProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/upload-invalid
        title:
          type: string
          const: Téléversement invalide
        status:
          type: number
          const: 422
        code:
          type: string
          const: UPLOAD_INVALID
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        errors:
          minItems: 1
          maxItems: 100
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
              code:
                type: string
                enum:
                  - required
                  - invalid_type
                  - invalid_format
                  - invalid_value
                  - too_small
                  - too_big
                  - too_many_decimals
                  - out_of_range
                  - unknown_field
                  - null_not_allowed
                  - empty_string
                  - empty_patch
                  - mutually_exclusive
                  - not_applicable
                  - duplicate
                  - end_before_start
                  - date_in_past
                  - nonexistent_local_time
                  - offset_not_allowed
                  - offset_required
                  - upload_expired
                  - upload_incomplete
                  - upload_conflict
              detail:
                type: string
            required:
              - pointer
              - code
              - detail
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - errors
    RateLimitedProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/rate-limited
        title:
          type: string
          const: Trop de requêtes
        status:
          type: number
          const: 429
        code:
          type: string
          const: RATE_LIMITED
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        limit:
          type: string
          enum:
            - PRE_AUTH
            - PER_KEY
            - WRITE
            - QUOTE
        windowSeconds:
          type: integer
          minimum: 1
        retryAfter:
          type: integer
          minimum: 0
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - limit
        - windowSeconds
        - retryAfter
    InternalErrorProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/internal-error
        title:
          type: string
          const: Erreur interne
        status:
          type: number
          const: 500
        code:
          type: string
          const: INTERNAL_ERROR
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
    ServiceUnavailableProblem:
      type: object
      properties:
        type:
          type: string
          const: https://api.lexio.rent/errors/service-unavailable
        title:
          type: string
          const: Service momentanément indisponible
        status:
          type: number
          const: 503
        code:
          type: string
          const: SERVICE_UNAVAILABLE
        detail:
          type: string
        instance:
          type: string
        requestId:
          type: string
        dependency:
          type: string
          enum:
            - PAYMENT_PROVIDER
            - FILE_STORAGE
            - ACCOUNTING
            - EMAIL
      required:
        - type
        - title
        - status
        - code
        - detail
        - instance
        - requestId
        - dependency
    SignedDocument:
      description: Fichier téléchargeable par une adresse signée et temporaire.
      examples:
        - url: >-
            https://storage.example.com/contrats/LOC-2026.11-0042.pdf?signature=9b2e41c7
          expiresAt: '2026-11-10T11:12:00+01:00'
      type: object
      properties:
        url:
          description: >-
            Adresse signée et temporaire du fichier : ne la conservez pas,
            relisez la ressource pour en obtenir une nouvelle.
          type: string
          format: uri
        expiresAt:
          examples:
            - '2026-11-10T10:00:00+01:00'
          description: Instant où l’adresse cesse d’être valable.
          type: string
          format: date-time
      required:
        - url
        - expiresAt
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: lck_…
      description: >-
        Clé API `lck_…` créée dans Lexio (Paramètres → Développeur), envoyée en
        `Authorization: Bearer`. Voir
        [Authentification](https://docs.lexio.rent/authentification).

````

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