Docs

API versions

Keep app builds you have already shipped working while you change your functions: a version pins every function's code, apps ask for it with one header, and you phase old versions out with deprecation and sunset dates.

Updated Oct 29, 2026

A mobile app or desktop build can stay in people's hands for months. If you change a function's input or output, those old builds break. An API version fixes that: it pins the code every function has at that moment. Builds that ask for the version keep running that code, and new builds use the next version or the live code.

Calls withRun
No header (or live, latest)The live code: each function's active version, as before.
X-Sovaria-Api-Version: v1The code v1 pinned for that function.

#Create a version

Create one just before you release an app build. It pins every function that has a ready deploy (or only the ones you choose). The name is what apps send: v1, v2, or a date such as 2026-11.

sov fn api-versions create v1 --note "iOS and Android 1.0"
sov fn api-versions list

#Call a version from your app

Set the version once on the client. Every function call then sends X-Sovaria-Api-Version.

const sovaria = new SovariaSDK({ baseUrl: 'https://<ref>.sovarias.in', accessToken: '<anon key>', apiVersion: 'v1' })
await sovaria.functions.call('checkout', { cart })          // runs v1's checkout
await sovaria.functions.call('checkout', { cart }, { apiVersion: 'v2' })  // or per call

Answers to a versioned call carry X-Sovaria-Api-Version. Browsers may send and read it (CORS allows it).

#Put a fix into an old version

A security or bug fix can go to apps on v1 without moving them to new behaviour: deploy the fix as a new function version, then pin it. In the console, the version's panel shows Use live next to every function whose live code is newer.

sov fn versions checkout            # find the fixed version number
sov fn api-versions pin v1 checkout=14
sov fn api-versions unpin v1 legacy-report   # remove a function from v1

#Phase a version out

  1. Deprecate it with a date

    Calls still work. Every answer carries Deprecation (RFC 9745) and Sunset (RFC 8594) headers, so the app can ask users to update.

    sov fn api-versions deprecate v1 --sunset 2027-01-01
  2. Watch the calls

    Each version counts its calls and the time of the last one (console › Functions › API versions, or sov fn api-versions list).

  3. Retire it

    After the sunset date, or when you retire it, calls asking for it get 410 API_VERSION_RETIRED. A retired version can't come back; create a new one instead. Delete it once retired to tidy up.

    sov fn api-versions retire v1
    sov fn api-versions delete v1

#Errors

You getCodeBecause
404API_VERSION_NOT_FOUNDNo version with that name in this environment.
404FUNCTION_NOT_IN_API_VERSIONThe function was added after the version was made, or removed from it. Pin it, or call without a version.
410API_VERSION_RETIREDThe version was retired or its sunset date passed.
400API_VERSION_NAME_INVALIDThe header isn't a version name.
409Deleting a function that a live version still runs, or deleting a version that isn't retired.

#Environments and limits

Versions belong to an environment, like functions: staging has its own versions and pins its own code. Changes reach every server within a few seconds.

FreeProUltraTeamEnterprise
API versions per project environment (pinned function releases for apps already shipped)2102550200

#Coming from Firebase or Supabase?

PlatformWhat this is called there
Firebaseno equivalent (separate Firebase projects or versioned function names)
Supabaseno equivalent (versioned function names)
SovariaAPI versions

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.