Developers
Deliver legal content where it's needed.
Published content is available via the Public Delivery API in three artifact forms: HTML fragments for direct embedding, JSON for your own rendering logic and PDF artifacts for attachments. Signed, replayable webhooks for publication events are available from the Business plan onward.
What is the Public Delivery API for legal texts?
- Public Delivery API for legal texts
- The Public Delivery API is TermShelf's read-only interface through which already-published legal texts are retrieved as an HTML fragment, JSON or PDF artifact — with version pinning, effective_at and ETag caching. Write operations and unpublished drafts are not reachable through it.
Public Delivery API
Read-only. Fast. Cache-friendly.
The Public Delivery API serves only already-published content. Write operations and unpublished drafts are not reachable through this interface. Beyond the currently live version, plan-aware consumers can also retrieve the version that was live at a specific point in time via effective_at.
Embed HTML fragment
Sanitized HTML fragments for direct embedding in pages, apps, footers or transactional emails.
Fetch JSON
Structured format with sections, typed blocks and metadata for your own templates.
Fetch PDF artifact
Approved versions as PDF artifacts — e.g. to attach to order or contract emails.
Pin a version
Request and stably reference a specific approved version.
ETags & caching
Cache-friendly responses with ETag and matching headers.
Read-only
No write operations, no unpublished drafts.
OpenAPI 3.1
Full API reference
Every endpoint, query parameter, response header (ETag, Cache-Control, Last-Modified, X-Termshelf-Document-Version, X-Termshelf-Published-At, Content-Disposition) and stable error code — browse it inline in your browser.
Example
JSON, HTML and PDF from the same tuple.
Path shape, headers and response envelope match the Public Delivery API. Three artifacts derived from the exact same published version — either live or pinned to a point in time via effective_at.
GET /v1/delivery/sites/42/documents/privacy
?locale=de-DE
&market=DE
&profile=B2C
200 OK
Content-Type: application/json
ETag: "v3-a1f2c"
Cache-Control: public, max-age=60, stale-while-revalidate=30
Last-Modified: Tue, 21 Apr 2026 09:30:10 GMT
X-Termshelf-Document-Version: 3
X-Termshelf-Published-At: 2026-04-10T08:00:00Z
{
"schema_version": 1,
"api_version": "v1",
"document": {
"type_code": "privacy",
"slug": "privacy-policy",
"title": "Datenschutzerklärung"
},
"target": {
"site_id": 42,
"locale_code": "de-DE",
"market_code": "DE",
"site_profile_code": "B2C"
},
"version": { "number": 3, "published_at": "2026-04-21T09:30:00Z" },
"sections": [ /* … */ ],
"meta": {
"etag": "\"v3-a1f2c\"",
"built_at": "2026-04-21T09:30:10Z",
"first_published_at": "2026-04-10T08:00:00Z"
}
}GET /v1/delivery/sites/42/documents/privacy/html
?locale=de-DE&market=DE&profile=B2C
200 OK
Content-Type: text/html; charset=utf-8
ETag: "v3-a1f2c"
Cache-Control: public, max-age=60, stale-while-revalidate=30
X-Termshelf-Document-Version: 3
<article class="ts-document"
data-document-type-code="privacy"
data-document-version="3"
data-locale="de-DE"
lang="de-DE">
<section class="ts-section" data-section-key="main">
…
</section>
</article>GET /v1/delivery/sites/42/documents/privacy/pdf
?locale=de-DE&market=DE&profile=B2C
200 OK
Content-Type: application/pdf
Content-Disposition: attachment;
filename="termshelf-acme-privacy-de-DE-v3.pdf"
ETag: "v3-a1f2c"
Cache-Control: public, max-age=300, stale-while-revalidate=60
X-Termshelf-Document-Version: 3
<binary PDF content>
# Mit ?version=N kann eine konkrete freigegebene
# Version gepinnt werden. Bei Abweichung antwortet
# die API mit 409 und nennt die aktuell live Version.Transactional Legal Text Delivery
Three paths into transactional systems.
Deliver legal texts where contracts are created — in order confirmations, contract emails, sign-up flows and checkout steps.
HTML in mails / footers
Embed legal-text sections directly into transactional emails, footers or checkout flows.
JSON for own templates
Fetch structured content for your own mail or app templates.
PDF as attachment
Fetch approved PDF artifacts and attach them to order, contract or sign-up emails.
TermShelf helps systems include or attach approved legal texts in transactional communication. Whether a specific use case is legally sufficient remains a decision for the user in coordination with qualified counsel.
Webhooks
Notify systems about new publications.
Signed, replayable webhooks notify external systems about new publications. Available from the Business plan; configured directly inside the customer app.
- HMAC-signed delivery with a rotatable secret
- Replays via the operations console
- Delivery log and retry status
- Per-workspace disable switch
Signatures
HMAC signature with a per-endpoint secret scoped to the workspace.
Replay
Failed deliveries can be inspected and retried on demand.
Integrate and onboard brands — straight from Claude Code.
A free Claude Code plugin ships two skills: an integration skill that generates code for the Public Delivery API (Next.js, Astro, Express, Laravel, plain HTML) — and an authoring skill that creates brands, sites, domains and per-locale variable & snippet overrides through the Management API. Both run inside your editor.
- Integration skill: free, no account, no API key — code for Next.js, Astro, SvelteKit, Express, Laravel or plain HTML
- Authoring skill: end-to-end brand onboarding against the Management API — brand, site, domain, variable and snippet overrides
- One plugin, both skills installed at once; Claude picks the right one for the task
- Authoring deliberately stops before publish — approval stays in the customer-app
/plugin marketplace add termshelf/claude-plugin /plugin install termshelf@termshelf
One plugin, one command — both skills become active in Claude Code.
“Add my TermShelf privacy policy to this Next.js app.”
“Onboard “Acme Legal GmbH” (https://acme.de) as a new brand: site, domain and all overrides — stop before publishing.”
Related feature pages
- Public Delivery API — HTML, JSON and PDF in detail
- Transactional delivery — legal texts in order confirmations
Related guides
Operational background on delivering and versioning legal texts.
Publish, deliver, integrate.
TermShelf brings the Public Delivery API, transactional delivery and signed webhooks into a clear framework.