{"openapi":"3.1.0","info":{"title":"DUOLEXX Public API","version":"1.1.0","description":"Public REST API for bilingual legal documents: list document types, create a document, update its answers, render the bilingual PDF and request the counterparty's signature."},"servers":[{"url":"https://duolexx.com/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/facts":{"get":{"summary":"Search verified legal facts","operationId":"searchLegalFacts","description":"Verified legal facts (notice periods, deposit caps, form requirements, …) with statute citation, official source and a citable DUOLEXX URL. No API key. License CC BY 4.0.","security":[],"parameters":[{"name":"q","in":"query","required":false,"description":"English keywords, e.g. 'deposit cap'","schema":{"type":"string"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"type":"string","enum":["DE","AT","ES","FR","PT","CY","TH","EU","INTL"]}},{"name":"domain","in":"query","required":false,"schema":{"type":"string","enum":["rental","employment","authorities","purchase","commercial","consumer"]}},{"name":"topic","in":"query","required":false,"schema":{"type":"string"}},{"name":"key","in":"query","required":false,"description":"Return exactly one fact by key","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Matching facts with attribution.","content":{"application/json":{"schema":{"type":"object","properties":{"facts":{"type":"array","items":{"$ref":"#/components/schemas/LegalFact"}},"count":{"type":"integer"},"license":{"type":"string"},"attribution":{"type":"string"}}}}}}}}},"/facts/dataset":{"get":{"summary":"Download the full verified-facts dataset","operationId":"getLegalFactsDataset","security":[],"responses":{"200":{"description":"All verified facts in one JSON document (CC BY 4.0)."}}}},"/rules/form-check":{"get":{"summary":"Check the form requirement for a document (signed evidence package)","operationId":"checkFormRequirement","description":"Deterministic form check from human-verified rules: can this document type be validly signed with the given signature type in the given country? Returns the required form, the consequence of ignoring it, the statute citation and a signed evidence package (verify via POST /api/verify). status 'unknown' means no verified rule exists. General legal information, not individual legal advice. No API key.","security":[],"parameters":[{"name":"type","in":"query","required":true,"description":"Document type key (see GET /document-types)","schema":{"type":"string"}},{"name":"country","in":"query","required":true,"description":"Jurisdiction code, e.g. DE, AT, ES","schema":{"type":"string"}},{"name":"signature","in":"query","required":false,"description":"Intended way of signing. Default ses.","schema":{"type":"string","enum":["ses","aes","qes","wet","notary"],"default":"ses"}},{"name":"asOf","in":"query","required":false,"description":"Law as of this day (YYYY-MM-DD). Default today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Evidence package: query, result (status, allowed, requires, satisfied_by, consequence, facts[]), dataset version and signature.","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["form_check"]},"query":{"type":"object"},"result":{"type":"object","properties":{"status":{"type":"string","enum":["verified","unverified","unknown"]},"allowed":{"type":"boolean","nullable":true},"requires":{"type":"string","nullable":true},"satisfied_by":{"type":"array","items":{"type":"string"}},"consequence":{"type":"string","nullable":true},"facts":{"type":"array","items":{"type":"object"}}}},"datasetVersion":{"type":"string"},"issuedAt":{"type":"string","format":"date-time"},"disclaimer":{"type":"string"},"signature":{"type":"object","properties":{"alg":{"type":"string"},"keyId":{"type":"string","nullable":true},"hash":{"type":"string"},"sig":{"type":"string","nullable":true}}}}}}}},"400":{"description":"type and country are required, or signature/asOf is invalid."},"429":{"description":"Rate limit exceeded."}}}},"/document-types":{"get":{"summary":"List available document types","operationId":"listDocumentTypes","description":"Open catalog for self-discovery — no API key required.","security":[],"responses":{"200":{"description":"The catalog of available document types.","content":{"application/json":{"schema":{"type":"object","properties":{"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/DocumentType"}}},"required":["documentTypes"]}}}}}}},"/documents":{"post":{"summary":"Create a bilingual document","operationId":"createDocument","description":"Assembles a bilingual document (including the governing-language clause) and stores it. The returned id addresses the /documents/{id} endpoints.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional key to safely retry the request; a replayed response carries Idempotency-Replayed: true.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRequest"}}}},"responses":{"200":{"description":"The created document.","headers":{"Location":{"description":"Path of the created document.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/documents/{id}":{"get":{"summary":"Read a document","operationId":"getDocument","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Document id returned by POST /documents.","schema":{"type":"string"}}],"responses":{"200":{"description":"The document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredDocument"}}}},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}},"patch":{"summary":"Update answers and recompute the document","operationId":"updateDocument","description":"Merges the given answers into the document and recomputes the clauses. A null value clears a field. Fails with 409 once the document is frozen for signing.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Document id returned by POST /documents.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPatch"}}}},"responses":{"200":{"description":"The updated document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredDocument"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"422":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/documents/{id}/pdf":{"post":{"summary":"Render the bilingual PDF","operationId":"renderDocumentPdf","description":"Renders the bilingual PDF. Signed documents are rendered authoritatively from the frozen snapshot and include the audit certificate with the Ed25519 seal. Requires DUOLEXX Pro or a one-off purchase of this document.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Document id returned by POST /documents.","schema":{"type":"string"}}],"responses":{"200":{"description":"The rendered PDF.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/documents/{id}/signature-request":{"post":{"summary":"Request the counterparty's signature","operationId":"requestSignature","description":"Freezes the document content and returns a deep link the counterparty can use to sign without an account. Pass signerName to also sign as party A (the creator) in the same call — recorded in the evidence trail as authMethod 'api-key'. Requires DUOLEXX Pro or a one-off purchase of this document.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Document id returned by POST /documents.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequest"}}}},"responses":{"200":{"description":"The share link plus the resulting signature state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureRequestResult"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"402":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key in the form duolexx_sk_… passed as a Bearer token."}},"responses":{"Problem":{"description":"An RFC 9457 problem+json error response.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"schemas":{"LegalFact":{"type":"object","properties":{"key":{"type":"string"},"jurisdiction":{"type":"string"},"jurisdictionName":{"type":"string"},"domain":{"type":"string"},"topic":{"type":"string"},"statement":{"type":"string"},"value":{},"valueText":{"type":"string"},"validFrom":{"type":["string","null"]},"citation":{"type":"string","description":"Statute + article, e.g. 'BGB § 551 Abs. 1'"},"officialSource":{"type":"string","format":"uri"},"verifiedAt":{"type":"string","format":"date"},"url":{"type":"string","format":"uri","description":"Citable DUOLEXX page with this fact"},"relatedDocuments":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"deepLink":{"type":"string","format":"uri"}}}}}},"DocumentRequest":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The document type key.","enum":["de-temporary-rental","de-termination-tenant","es-termination-tenant","es-seasonal-rental","pt-non-permanent-rental","fr-bail-mobilite","cy-contractual-tenancy","th-residential-lease","de-landlord-confirmation","de-power-of-attorney","de-sublease","de-private-purchase","de-freelance","es-freelance","cy-freelance","es-power-of-attorney","fr-power-of-attorney","de-handover-protocol","eu-power-of-attorney","eu-freelance","eu-private-purchase","intl-nda","de-employment","intl-mou","eu-loan","eu-vehicle-purchase","intl-service","eu-employment","th-employment","th-power-of-attorney","intl-travel-consent","intl-remote-work-letter","eu-debt-acknowledgment","eu-dpa","de-deposit-settlement","de-rent-guarantee","es-sublease","es-handover-protocol","es-deposit-settlement","es-rent-guarantee","cy-deposit-settlement","cy-employment","cy-handover-protocol","cy-power-of-attorney","cy-private-purchase","cy-rent-guarantee","cy-sublease","cy-termination-tenant","es-employment","es-private-purchase","fr-deposit-settlement","fr-employment","fr-freelance","fr-handover-protocol","fr-private-purchase","fr-rent-guarantee","fr-sublease","fr-termination-tenant","pt-deposit-settlement","pt-employment","pt-freelance","pt-handover-protocol","pt-power-of-attorney","pt-private-purchase","pt-rent-guarantee","pt-sublease","pt-termination-tenant","th-deposit-settlement","th-freelance","th-handover-protocol","th-private-purchase","th-rent-guarantee","th-sublease","th-termination-tenant","at-deposit-settlement","at-employment","at-freelance","at-handover-protocol","at-landlord-confirmation","at-power-of-attorney","at-private-purchase","at-rent-guarantee","at-sublease","at-temporary-rental","at-termination-tenant"]},"translationLanguage":{"type":"string","description":"Preferred translation language (ISO code)."},"legalLanguage":{"type":"string","description":"Legal (governing) language, where a free language pair is allowed."},"answers":{"type":"object","description":"Field values to fill into the document placeholders.","additionalProperties":true}}},"DocumentPatch":{"type":"object","description":"At least one of the properties is required.","properties":{"answers":{"type":"object","description":"Answers to merge into the document. A null value clears that field; omitted fields stay unchanged.","additionalProperties":true},"translationLanguage":{"type":"string","description":"New translation language — must be offered by the type and differ from the legal language."}}},"SignatureRequest":{"type":"object","properties":{"signerName":{"type":"string","minLength":2,"description":"If given, the key owner also signs as party A (the creator) in this call."},"locale":{"type":"string","description":"UI language of the returned deep link (de/en/es/fr, …). Default en."}}},"SignatureRequestResult":{"type":"object","properties":{"id":{"type":"string"},"deepLink":{"type":"string","format":"uri","description":"Share this with the counterparty — no account required to sign."},"documentHash":{"type":"string","description":"SHA-256 of the frozen snapshot; every signature binds to it."},"signStatus":{"type":"string","enum":["none","partial","signed"]},"signedByCreator":{"type":"boolean","description":"True if this call created party A's signature."},"note":{"type":"string"}}},"DocumentType":{"type":"object","properties":{"type":{"type":"string"},"category":{"type":"string"},"jurisdictionMode":{"type":"string","enum":["bound","choice","neutral"]},"country":{"type":"string"},"legalLanguage":{"type":"string"},"freeLanguagePair":{"type":"boolean"},"translationLanguages":{"type":"array","items":{"type":"string"}},"requiredFields":{"type":"array","items":{"type":"string"}}}},"AssembledClause":{"type":"object","properties":{"key":{"type":"string"},"legalTitle":{"type":"string"},"legalText":{"type":"string"},"translationTitle":{"type":"string"},"translationText":{"type":"string"}}},"AssembledDocument":{"type":"object","properties":{"documentType":{"type":"string"},"jurisdictionMode":{"type":"string","enum":["bound","choice","neutral"]},"country":{"type":"string"},"legalLanguage":{"type":"string"},"translationLanguage":{"type":"string"},"deepLink":{"type":"string","format":"uri"},"requiredFields":{"type":"array","items":{"type":"string"}},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/AssembledClause"}}}},"Document":{"type":"object","properties":{"id":{"type":"string","description":"Document id — addresses the /documents/{id} endpoints."},"documentType":{"type":"string"},"jurisdictionMode":{"type":"string","enum":["bound","choice","neutral"]},"country":{"type":"string"},"legalLanguage":{"type":"string"},"translationLanguage":{"type":"string"},"deepLink":{"type":"string","format":"uri"},"requiredFields":{"type":"array","items":{"type":"string"}},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/AssembledClause"}}},"required":["id"]},"StoredDocument":{"type":"object","properties":{"id":{"type":"string","description":"Document id — addresses the /documents/{id} endpoints."},"documentType":{"type":"string"},"jurisdictionMode":{"type":"string","enum":["bound","choice","neutral"]},"country":{"type":"string"},"legalLanguage":{"type":"string"},"translationLanguage":{"type":"string"},"deepLink":{"type":"string","format":"uri"},"requiredFields":{"type":"array","items":{"type":"string"}},"clauses":{"type":"array","items":{"$ref":"#/components/schemas/AssembledClause"}},"signStatus":{"type":"string","enum":["none","partial","signed"],"description":"Signature state: none, partial (one party), signed (both)."},"frozen":{"type":"boolean","description":"True once the content is locked for signing. A frozen document can no longer be changed via PATCH."}},"required":["id"]},"Problem":{"type":"object","description":"RFC 9457 problem detail.","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"}}}}}}