{"openapi":"3.1.0","info":{"title":"BEVERITRAX API","version":"1.7.0","summary":"Registre de preuve des engagements entre entreprises.","description":"Authentification : `Authorization: Bearer <clé d’API>` (clé `bvx_live_…` ou `bvx_test_…` créée dans Développeurs). La clé fixe l’espace ; l’en-tête `X-Tenant-Id` est facultatif.\n\nUn compte de service ne prend jamais de décision sous second facteur (approbation, levée d’engagement, revue de pièce, export d’archive).\n\nÉcritures : envoyez `Idempotency-Key` pour rejouer sans risque une création de dossier.\n\nErreurs : `{ code, message, details?, requestId }`. Les montants restent dans leur devise ; `amount_minor` est en unités mineures ISO 4217.\n\nWebhooks : voir `x-webhooks` et la signature `BVX-Signature: t=<unix>,v1=<HMAC-SHA256(secret, t + \".\" + corps)>`."},"servers":[{"url":"https://beveritrax.com"}],"security":[{"apiKey":[]}],"tags":[{"name":"Modèles"},{"name":"Dossiers"},{"name":"Pièces"},{"name":"Engagements et événements"},{"name":"Audit et preuve"},{"name":"Contreparties"},{"name":"Collaboration"},{"name":"Statut"}],"paths":{"/v1/templates":{"get":{"tags":["Modèles"],"summary":"Lister les modèles de dossier publiés","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/templates/{id}":{"get":{"tags":["Modèles"],"summary":"Lire un modèle (définition complète)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/cases":{"get":{"tags":["Dossiers"],"summary":"Lister les dossiers","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}]},"post":{"tags":["Dossiers"],"summary":"Créer un dossier à partir d’un modèle","responses":{"201":{"description":"Créé","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Case"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","minLength":8}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCase"}}}}}},"/v1/cases/{id}":{"get":{"tags":["Dossiers"],"summary":"Lire un dossier (champs, parties, pièces, engagements, événements, actions possibles)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Case"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"patch":{"tags":["Dossiers"],"summary":"Modifier un dossier encore modifiable","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/v1/cases/{id}/actions":{"post":{"tags":["Dossiers"],"summary":"Déclencher une action du modèle (refus nommé si une condition manque)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseAction"}}}}}},"/v1/cases/{id}/events":{"post":{"tags":["Engagements et événements"],"summary":"Enregistrer un événement métier (lot, inspection, transfert de garde…)","responses":{"201":{"description":"Enregistré","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"},"fulfilled":{"type":"array","items":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseEvent"}}}}}},"/v1/cases/{id}/obligations/{code}/fulfill":{"post":{"tags":["Engagements et événements"],"summary":"Rattacher une preuve existante à un engagement","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"}}}}}}}},"/v1/documents/uploads":{"post":{"tags":["Pièces"],"summary":"Préparer un dépôt (URL de téléversement signée)","responses":{"201":{"description":"Prêt","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"versionId":{"type":"string","format":"uuid"},"upload":{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object"}}}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}}}}},"/v1/documents/versions/{id}/complete":{"post":{"tags":["Pièces"],"summary":"Confirmer le téléversement (contrôle, horodatage, scellement en arrière-plan)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/documents/{id}":{"get":{"tags":["Pièces"],"summary":"Lire une pièce et ses versions","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/documents/versions/{id}/verify":{"get":{"tags":["Pièces"],"summary":"Vérifier l’intégrité et l’horodatage d’une version","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/cases/{id}/audit":{"get":{"tags":["Audit et preuve"],"summary":"Piste d’audit du dossier","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/cases/{id}/audit/export.json":{"get":{"tags":["Audit et preuve"],"summary":"Export d’audit signé (Ed25519)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/cases/{id}/anchoring":{"get":{"tags":["Audit et preuve"],"summary":"État de l’ancrage Bitcoin des pièces du dossier","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/counterparties":{"get":{"tags":["Contreparties"],"summary":"Lister les contreparties","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Contreparties"],"summary":"Créer une contrepartie","responses":{"201":{"description":"Créée","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["legalName","country","type"],"properties":{"legalName":{"type":"string"},"legalIdentifier":{"type":"string"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"type":{"type":"string"}}}}}}}},"/v1/cases/{id}/collaboration":{"get":{"tags":["Collaboration"],"summary":"Commentaires, tâches et liens du dossier","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/v1/cases/{id}/comments":{"post":{"tags":["Collaboration"],"summary":"Commenter (mentions = notifications)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":5000},"mentions":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}}},"/v1/cases/{id}/tasks":{"post":{"tags":["Collaboration"],"summary":"Créer une tâche assignée","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"assigneeId":{"type":"string","format":"uuid"},"dueDate":{"type":"string","format":"date"}}}}}}}},"/v1/cases/{id}/links":{"post":{"tags":["Collaboration"],"summary":"Lier deux dossiers","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["toCaseId","kind"],"properties":{"toCaseId":{"type":"string","format":"uuid"},"kind":{"enum":["RELATED","PARENT_OF","REPLACES","DEPENDS_ON"]}}}}}}}},"/v1/search":{"get":{"tags":["Dossiers"],"summary":"Recherche transverse (dossiers, pièces, contreparties)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2}}]}},"/v1/cases-export":{"get":{"tags":["Dossiers"],"summary":"Export de tous les dossiers (CSV ou JSON)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"parameters":[{"name":"format","in":"query","schema":{"enum":["csv","json"]}}]}},"/v1/cases-import":{"post":{"tags":["Dossiers"],"summary":"Import en lot pour un modèle (validation à blanc par défaut)","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateId","rows"],"properties":{"templateId":{"type":"string","format":"uuid"},"dryRun":{"type":"boolean","default":true},"rows":{"type":"array","maxItems":500,"items":{"type":"object","additionalProperties":{"type":"string"}}}}}}}}}},"/v1/usage":{"get":{"tags":["Statut"],"summary":"Consommation et limites de l’offre","responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/status":{"get":{"tags":["Statut"],"summary":"État public du service","security":[],"responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object"}}}}}}}}},"/v1/openapi.json":{"get":{"tags":["Statut"],"summary":"Ce document","security":[],"responses":{"200":{"description":"Succès","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"x-webhooks":{"case.created":{"post":{"summary":"Événement case.created","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"case.updated":{"post":{"summary":"Événement case.updated","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"case.state_changed":{"post":{"summary":"Événement case.state_changed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"case.approval":{"post":{"summary":"Événement case.approval","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"document.sealed":{"post":{"summary":"Événement document.sealed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"document.reviewed":{"post":{"summary":"Événement document.reviewed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"obligation.updated":{"post":{"summary":"Événement obligation.updated","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"case_event.recorded":{"post":{"summary":"Événement case_event.recorded","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"portal.document_deposited":{"post":{"summary":"Événement portal.document_deposited","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}},"anchor.confirmed":{"post":{"summary":"Événement anchor.confirmed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Accusé de réception (toute réponse 2xx)"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"bvx_live_… | bvx_test_…"}},"responses":{"Error":{"description":"Erreur","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"},"requestId":{"type":"string"}}},"CreateCase":{"type":"object","required":["title"],"properties":{"title":{"type":"string","maxLength":200},"reference":{"type":"string"},"templateId":{"type":"string","format":"uuid"},"attributes":{"type":"object","description":"Champs déclarés par le modèle"},"parties":{"type":"array","items":{"type":"object","required":["counterpartyId","role"],"properties":{"counterpartyId":{"type":"string","format":"uuid"},"role":{"type":"string"}}}},"assetLines":{"type":"array","items":{"type":"object","required":["description","category","quantity","unit","unitPrice","currency"],"properties":{"description":{"type":"string"},"category":{"type":"string"},"quantity":{"type":"string"},"unit":{"type":"string"},"unitPrice":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}}}}},"Case":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"title":{"type":"string"},"state":{"type":"string"},"status":{"type":"string"},"attributes":{"type":"object"},"template":{"type":"object"},"obligations":{"type":"array","items":{"type":"object"}},"events":{"type":"array","items":{"type":"object"}},"actions":{"type":"array","items":{"type":"object"}},"totalsMinor":{"type":"object","additionalProperties":{"type":"string"}}}},"CaseAction":{"type":"object","required":["action"],"properties":{"action":{"type":"string"},"reason":{"type":"string"},"decision":{"enum":["APPROVE","REJECT"]}}},"CaseEvent":{"type":"object","required":["type","payload"],"properties":{"type":{"type":"string"},"payload":{"type":"object"},"refs":{"type":"array","items":{"type":"string","format":"uuid"}},"documentIds":{"type":"array","items":{"type":"string","format":"uuid"}},"occurredAt":{"type":"string","format":"date-time"},"idempotencyKey":{"type":"string"}}},"UploadRequest":{"type":"object","required":["caseId","fileName","mimeType","sizeBytes","documentType"],"properties":{"caseId":{"type":"string","format":"uuid"},"fileName":{"type":"string"},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer"},"documentType":{"type":"string"},"replacesDocumentId":{"type":"string","format":"uuid"},"validUntil":{"type":"string","format":"date"}}},"WebhookPayload":{"type":"object","required":["id","type","occurredAt","tenantId"],"properties":{"id":{"type":"string"},"type":{"enum":["case.created","case.updated","case.state_changed","case.approval","document.sealed","document.reviewed","obligation.updated","case_event.recorded","portal.document_deposited","anchor.confirmed"]},"occurredAt":{"type":"string","format":"date-time"},"tenantId":{"type":"string","format":"uuid"},"caseId":{"type":"string","format":"uuid","nullable":true},"entity":{"type":"object"},"auditSeq":{"type":"integer"},"data":{"type":"object"}}}}}}