For developers
Consent API for developers
Show your Savira consent banner on any site or app, record each visitor's choice as a timestamped consent record, and serve your published privacy and cookie policies. Start with one script tag, or build your own banner on the same API.

Consent API v1
What the Consent API does
Four jobs, one API. Everything a visitor's browser calls uses your public script token. Only your server holds the API key.
Show your banner
The hosted script reads your published banner and shows it. Or fetch its settings and categories and draw your own.
GET /banner/{scriptToken}Record each choice
Each choice becomes a new consent record with the time and the banner version. Earlier records are never changed.
POST /consent/{scriptToken}Serve your policies
Place your latest published privacy policy, cookie policy or custom policy in your own page, as HTML.
GET /policy/{scriptToken}/{type}Connect a platform
Four read-only server endpoints let an integration check a key and pull banner settings, policies and Savira's tracker list.
GET /plugin/*
Credentials
Two credentials, two jobs
A script token identifies one website and is safe to publish. An API key identifies your whole Savira account and stays on your server.
Your server
For example WordPress with the Savira plugin. Keeps the API key secret.
Sends Authorization: Bearer sv_...API key, servers only
consent.savira.com
/plugin/validate/plugin/config/plugin/documents/plugin/patterns
Visitor's browser
Runs the hosted banner script and keeps the choice in localStorage.
Sends script token, in the pathScript token, safe to publish
consent.savira.com
/{scriptToken}.js/banner/consent/policy
Savira dashboard
manage.savira.com
Create and rotate API keys, view consent records
Script token
- Identifies one website
- Safe to publish: it is part of the banner script's address on every page
- Goes in the URL path
- Reaches the banner script, banner settings, consent recording and published policies
API key
- Identifies your whole Savira account and starts with sv_
- Goes only in the Authorization header, sent from your server
- Never in pages, URLs, logs or client-side code
- Created in the Savira dashboard under Settings, API keys. Creating a new key revokes the old one
Neither credential reads consent records or contacts. Those stay in your Savira dashboard. Savira is not responsible for the compromise of any API key, or for incorrect data or extra costs caused by a publicly exposed key.
Quick start
Add your banner in three steps
Add the script tag
Put it once on every page, before the closing body tag. Your script token comes with your website in Savira.
<script src="https://consent.savira.com/3f9a...0c1d.js" async></script>Listen for the choice
The banner calls your function after each Accept all, Reject non-essential or Save preferences.
window.__savira = window.__savira || {}; window.__savira.onConsent = function (choice) { // choice.accepted: accepted category IDs, required ones included };Load trackers only after a yes
Match the accepted IDs to your categories by slug, then load only the tags that were allowed. On a later visit, read
__savira_cfrom localStorage to apply the stored choice before the banner loads.

Reference
Endpoints at a glance
Endpoints are served from https://consent.savira.com/api/v1 over HTTPS (TLS 1.2 or higher). The banner script and the health check are served from https://consent.savira.com. Requests and responses are JSON.
| Method | Path | Credential | Returns | Caching |
|---|---|---|---|---|
| GET | https://consent.savira.com/{scriptToken}.js | Script token | The hosted banner script | 5 min, then up to 10 min stale |
| GET | /banner/{scriptToken} | Script token | Published banner settings and cookie categories | 60 s, then up to 5 min stale |
| POST | /consent/{scriptToken} | Script token | The consentToken you sent | Not cached |
| GET | /policy/{scriptToken}/{type} | Script token | A published policy's HTML, date and version | 5 min, then up to 10 min stale |
| GET | /plugin/validate | API key | Whether the key works, and how far the account is set up | Not cached |
| GET | /plugin/config | API key | Banner settings, categories and the website's script token | Not cached |
| GET | /plugin/documents | API key | The account's published policies | Not cached |
| GET | /plugin/patterns | API key | Savira's list of known tracking scripts and embeds | 1 day, then up to 7 days stale |
| GET | https://consent.savira.com/health | None | Status while the service is up | Not cached |
Rate limits
60 requests a minute from one IP address, counted per endpoint. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset.
Errors
JSON with the status in the body. 400 fix the request. 401 check the key. 404 nothing published yet. 429 wait for Retry-After. 5xx retry later.
Cross-origin
Every endpoint answers any origin. Send no credentials from a browser, and call API key endpoints from your server only.
Visitor data
What the API stores about visitors
Each choice is stored with a random browser token, a truncated IP address and the browser's user agent. The API never receives a visitor's name or email address, and sets no cookies.
- A consent record for each choice: categories, banner version, time, source, user agent and truncated IP address. Never changed.
- A visitor entry for each browser token: the token and its latest truncated IP address.
- In the browser:
__savira_tand__savira_cin localStorage, never in cookies. - Requests for access or erasure are handled in your Savira dashboard. Erasing a visitor removes their personal details and keeps their consent records as proof of what was agreed.

- No name or email
- No cookies
- Last part of IP removed
How do I record consent with an API?
Send POST /consent/{scriptToken} with a random consentToken kept in the visitor’s browser and the acceptedCategoryIds from GET /banner. Savira adds a timestamped record with the banner version. Never send anything that identifies the person, such as an email address or customer ID.
Is there a consent API for custom websites?
Yes. Any site that can load a script tag or make an HTTPS request can use it: the hosted banner script, or your own banner built on the same endpoints.
Can one account cover several websites?
No. One Savira account is linked to one domain, and most API key endpoints answer 404 until that website is registered.
Does the Consent API block tracking scripts?
No. It records choices. Your site holds tracking scripts back until onConsent says they are allowed. The Savira WordPress plugin does this for WordPress sites, and passes the choice to Google Consent Mode.
Can I read or export consent records through the API?
Not through the Consent API. View and export records in your Savira dashboard.
Which plans include API access?
Every plan, including the free Starter plan. API keys are created in the Savira dashboard under Settings, API keys.
What are the rate limits?
60 requests a minute from one IP address, counted separately for each endpoint. Visitors on a shared network share that limit, so cache what the response headers allow.
Where is API data stored?
On AWS in Sydney, with identifiable end-user data encrypted at rest.
Other tools
Connect your other tools
The Consent API covers your website. For the rest of your stack, Savira builds the connection for you as a scoped custom integration project on Pro.
CRM
Connect your CRM with a custom integration on Pro.
Email
Connect your email platform with a custom integration on Pro.
Ad platforms
Connect your ad platforms with a custom integration on Pro.
API status
Live system status
We check the Savira website, Consent API and dashboard every 5 minutes. Incidents and maintenance are posted on the status page.
CheckingChecking live status
Website
Checkingsavira.com and its pages.
- Uptime, past 30 days
- Checking
- Average response
- Checking
Consent API
CheckingThe banner script, consent records and published policies.
- Uptime, past 30 days
- Checking
- Average response
- Checking
Dashboard
CheckingSign-in and the Savira dashboard.
- Uptime, past 30 days
- Checking
- Average response
- Checking
Status comes from automated checks. To report a problem, contact us.
Build it into your stack
API access is included on every plan. Register your website in Savira, then create your API key in the dashboard.