Legal API
Versioned legal documents per provider, company details, the public pages and footer, and accepting the Terms.
A document belongs to a provider (a platform tenant) and is one of privacy,
terms, refunds or cookies. The text is the editor's JSON, keyed by language.
Every publication is a new, unchanging version.
Public
No session. Pass tenant_id, or the provider is read from the request's Origin.
| Method | Path | Returns |
|---|---|---|
| GET | /legal/public/footer | The company line and which pages exist, or null. |
| GET | /legal/public/signup | The Terms and Privacy versions a sign-up accepts, or null when no Terms are published. |
| GET | /legal/public/pages/:kind | One page in locale, or imprint. 404 when unpublished. |
The signed-in person
| Method | Path | Tool | Notes |
|---|---|---|---|
| GET | /legal/me/pending | none | Whether I must accept, and which versions. Passes the gate. |
| POST | /legal/me/accept | none, on purpose | Body platform_tenant_id, terms_version, optional privacy_version. 204. Passes the gate. |
| GET | /legal/me/purchase-footer | none | seller=provider (default) or platform. |
| GET | /legal/me/acceptances | list_my_legal_acceptances | Paged with limit and offset. |
POST /legal/me/accept answers:
- 403 for a provider other than the caller's. The provider is read from the session; the body only has to agree with it.
- 409
LEGAL_TERMS_VERSION_OUTDATEDwhen a newer version needs accepting. - 422
LEGAL_TERMS_VERSION_UNKNOWNfor a version that does not exist.
The Terms gate
Once a provider has published Terms, any other request by someone who has not
accepted answers 403 with code TERMS_ACCEPTANCE_REQUIRED. An API client
should send the person to the accept page. Acceptance cannot be done by a tool.
Administration
The tenant's own administrator, or the platform owner. Anyone else gets 403.
| Method | Path | Tool |
|---|---|---|
| GET | /platform-tenants/:id/legal/documents | list_legal_documents |
| GET | /platform-tenants/:id/legal/documents/:kind | get_legal_document |
| POST | /platform-tenants/:id/legal/documents | publish_legal_document (high stakes) |
| GET | /platform-tenants/:id/legal/company-details | get_legal_company_details |
| PUT | /platform-tenants/:id/legal/company-details | set_legal_company_details (high stakes) |
Publishing takes kind, bodies, requires_acceptance (turn on to ask everyone
again) and external_key: a retry with the same key returns the first version
instead of publishing twice. Saving company details replaces the whole value, so a
retry writes the same thing; its external_key is optional and is not stored.