Skip to content

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.

    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.

    Script 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

Your server sends Authorization: Bearer sv_... to /plugin/validate /plugin/config /plugin/documents /plugin/patterns. Visitor's browser sends script token, in the path to /{scriptToken}.js /banner /consent /policy. Both are served from consent.savira.com. Savira dashboard at manage.savira.com belongs to the same account: 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

  1. 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>
  2. 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
    };
  3. 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_c from 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.

Consent API v1 endpoints, credentials and caching
MethodPathCredentialReturnsCaching
GEThttps://consent.savira.com/{scriptToken}.jsScript tokenThe hosted banner script5 min, then up to 10 min stale
GET/banner/{scriptToken}Script tokenPublished banner settings and cookie categories60 s, then up to 5 min stale
POST/consent/{scriptToken}Script tokenThe consentToken you sentNot cached
GET/policy/{scriptToken}/{type}Script tokenA published policy's HTML, date and version5 min, then up to 10 min stale
GET/plugin/validateAPI keyWhether the key works, and how far the account is set upNot cached
GET/plugin/configAPI keyBanner settings, categories and the website's script tokenNot cached
GET/plugin/documentsAPI keyThe account's published policiesNot cached
GET/plugin/patternsAPI keySavira's list of known tracking scripts and embeds1 day, then up to 7 days stale
GEThttps://consent.savira.com/healthNoneStatus while the service is upNot 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_t and __savira_c in 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.
A sample consent record showing a random browser token, the categories chosen, banner version 3, the time and source, a truncated IP address and the browser's user agent.
  • No name or email
  • No cookies
  • Last part of IP removed

FAQ

Consent API questions

Can't find your answer? Get in touch

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

    Checking

    savira.com and its pages.

    Uptime, past 30 days
    Checking
    Average response
    Checking
  • Consent API

    Checking

    The banner script, consent records and published policies.

    Uptime, past 30 days
    Checking
    Average response
    Checking
  • Dashboard

    Checking

    Sign-in and the Savira dashboard.

    Uptime, past 30 days
    Checking
    Average response
    Checking
View the full status page (opens in a new tab)

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.

© Savira 2026. All rights reserved.Savira is operated under the registered business name savira.com, ABN 53 273 071 022.PO Box 2045, Hornsby Westfield NSW 1635

Savira provides consent management tools, templates and general information to help you manage privacy compliance. It is not legal advice and does not guarantee compliance. You remain responsible for your own compliance.