Space Backup Manual

API reference: the account service

Chapter 9 of 14 · Contents

The account service at https://spacebackup.net/account signs people in by email, keeps companies, members, devices, albums, shares and notifications, and passes the company key between devices without ever seeing it. This chapter lists every route it serves: method, path, who may call it, the request body, the answer with a real example, and the errors.

Each route ends with a box generated from the code: its auth scheme, headers, every field with its type, every status code with the exact error messages, and the same call in curl, Python (standard library), Swift (URLSession) and C# (HttpClient). The whole API as one OpenAPI 3 file, for code generators and tools: openapi.yaml (generated from the service's code with every release of this manual).

Overview#

The account service is the one central server of Space Backup. Backups themselves never go through it: they travel between your devices directly or through Space Relay. The service only knows who is who and what each device may do. The apps (Windows, macOS, Linux, iPhone and iPad) use the JSON API described here; the web pages at /account/ (the sign-in page, the admin page and the member's page) are served by the same service.

Base URLhttps://spacebackup.net/account
JSON APIeverything under https://spacebackup.net/account/api/…
Web pages and formseverything else under https://spacebackup.net/account/…
TransportHTTPS only (HTTP/1.1 or HTTP/2)
Request bodiesContent-Type: application/json, UTF-8 (the web forms: application/x-www-form-urlencoded)
AnswersJSON with camelCase field names; 204 No Content has no body
TimesISO 8601 in UTC with offset, for example "2026-10-18T09:12:00.123+00:00"
Body sizeat most 1 MB per request (PUT /api/devices/state: 12 MB)

In this chapter every path is written from /account: POST /api/signin/start means POST https://spacebackup.net/account/api/signin/start, and GET /admin means https://spacebackup.net/account/admin.

Note: The apps let you point them at another account service for testing: the setting account-url, or the environment variable SPACEBACKUP_ACCOUNT_URL. The paths stay the same.

Versioning and the X-SpaceBackup-Version header#

There is no version number in the paths. The API grows only by adding routes and fields: a client must ignore fields it does not know, and a field that is absent or null means "not set". Fields marked optional below are left out of the answer entirely when they have no value (they are not sent as null).

Every app sends its own version with each call:

X-SpaceBackup-Version: 1.8.2

The service does not refuse any version. It records the value (up to 40 characters) as the calling device's app version, which owners and admins see in the device lists (Devices). Send it on every call made with a device token; it is ignored on web-session calls.

A phone also sends its time zone, so the morning push comes at 08:00 its time:

X-SpaceBackup-TimeZone: America/Chicago

An IANA name, or a UTC offset (-05:00, +0530, or minutes, -300). The service keeps the latest one per device; a value it cannot read is ignored. PUT devices/push takes the same as tz.

GET /api/health#

Whether the service is up: the apps' probe. It reads no database and calls nothing else, so it is cheap to call often.

GET /api/health · from openapi.yaml (getHealth)

Authnone
204No body
curl
# answers 204
curl -sS -X GET 'https://spacebackup.net/account/api/health'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/health",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/health")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/health");
using var res = await http.SendAsync(req);  // answers 204
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Ids#

Ids are a prefix plus 16 random lower-case base-32 characters (a–z, 2–7). Treat them as opaque strings.

PrefixWhatExample
c_companyc_k3xq7m2pa9fz4w8r
m_member (one email's membership of one company)m_7hd2kq9wz3xa5npe
d_device registered in a companyd_4f2a7cqm3xk9wz2b
gd_guest device (someone in no company)gd_n5c7xq2m4ka9pz3w
r_sign-in requestr_2mxq7k4a9fz3wn5c
gr_group of people (plus the fixed id coworkers)gr_q8w3zx5m2ka7np4c
al_albumal_x7k2mq9pa4zw3n5c
sh_share of a device's backupssh_m3k9xq2a7pz4wn5c
inv_album invitationinv_c4n7zq2m9xa3kw5p
k_company-key delivery (a sealed box in a device's mailbox)k_a9zq3m7xk2pw4n5c
kq_device waiting for the company keykq_w2m7zx4qa9k3pn5c
kr_company-key recovery requestkr_p4xq9m2ka7zw3n5c
dr_data-key (restore) requestdr_z3k7xq2ma9pw4n5c
p_relay credit purchasep_q7m2xk9a4zw3pn5c
pt_ + tokenpeer ticketpt_Yk3…
at_ + tokenalbum ticketat_Q9x…
ar_ + tokenalbum relay ticketar_M2c…

Notification ids are plain increasing integers.

How each route is described#

Each route below has:

Authentication#

The service has no passwords. A person proves they own an email address by a link or a 6-digit code mailed to it, and the device that asked gets a token. There are two kinds of session:

Device tokenWeb session
Whoan app on a computer, phone or tableta browser on the account pages
How it is sentAuthorization: Bearer <token>the cookie sa_session
Lifetimeno expiry; revoked when the device or its member is removed12 hours since the last use
Used forevery /api/… routethe pages and their forms; five /api/… routes (with CSRF)

Device tokens#

A device token is 32 random bytes, base64url (43 characters). The service keeps only its SHA-256 hash, so a copy of the service's database signs nobody in. Send it on every API call:

GET /account/api/me HTTP/1.1
Host: spacebackup.net
Authorization: Bearer Yk3Qm9xP2aZ7wC4nV8bT1rL6sD0fH5jK9eG3uI7oA2c
X-SpaceBackup-Version: 1.8.2

Web sessions and CSRF#

The web pages sign in with the same email flow; the browser then holds these cookies (all HttpOnly, Secure, SameSite=Lax, Path=/account):

CookieWhatLifetime
sa_sessionthe web session token12 hours idle
sa_signina sign-in in progress: its request id and the browser's secret15 minutes
sa_csrfthe CSRF token of this browsersession

Every form on the pages carries a hidden field csrf with the value of sa_csrf (a "double submit": a foreign site can neither read the cookie nor post with it). A missing or wrong csrf answers 403 ("This form has expired. Go back, reload the page and try again.").

Five JSON routes accept the web session instead of a bearer token, so the admin page can call them from script. They need the header X-CSRF-Token with the sa_csrf value; without it they answer 403 {"error": "missing CSRF token"}:

The waiting page's POST /signin/poll uses the same header.

The passwordless sign-in flow#

  1. The app makes a random secret (for example 32 random bytes, base64) and keeps it in memory. It computes secretHash = base64 of the SHA-256 of the UTF-8 bytes of the secret string exactly as it will send it later.
  2. POST /api/signin/start with the email, a device name and secretHash. The answer is a requestId, valid 15 minutes.
  3. The service mails the person a link (…/account/signin/confirm?r=<requestId>&t=<link token>) and a **6-digit code** (subject "Space Backup sign-in code: 123456"). The mail says which device asked and when.
  4. Either:
    • the person types the code into the app, which sends it with POST /api/signin/code; or
    • the person clicks the link. The page asks "Sign in <device name>?" and has a button (a POST, so mail scanners that open links do not use it up). Meanwhile the app calls POST /api/signin/poll every 2 seconds.
  5. Once the request is approved and the secret matches, the answer carries the token and the session. It is handed out once.

Only the holder of the secret gets the token, wherever the link was clicked: someone who forwards or intercepts the mail cannot sign in with it on another device. A right code also works after the link was confirmed.

# 1-2: start (bash, curl and openssl)
SECRET=$(openssl rand -base64 32)
HASH=$(printf %s "$SECRET" | openssl dgst -sha256 -binary | base64)
curl -s https://spacebackup.net/account/api/signin/start \
  -H 'Content-Type: application/json' \
  -d "{\"email\":\"anna@acme.com\",\"deviceName\":\"ANNA-PC\",\"secretHash\":\"$HASH\"}"
# {"requestId":"r_2mxq7k4a9fz3wn5c","expiresAt":"2026-10-18T09:27:00.481+00:00"}

# 4: the code from the mail
curl -s https://spacebackup.net/account/api/signin/code \
  -H 'Content-Type: application/json' \
  -d "{\"requestId\":\"r_2mxq7k4a9fz3wn5c\",\"secret\":\"$SECRET\",\"code\":\"481920\"}"
# {"status":"approved","token":"Yk3Qm9…","email":"anna@acme.com","memberId":null,"deviceId":null,"company":null}

After signing in, an app usually calls, in order: GET /api/me, POST /api/company/join (to land in a company), POST /api/devices/register (to tie the token to this device), then GET /api/sync every 60 seconds. See Sign in by email link and Join a company for what the person sees.

Common objects#

These shapes come back from many routes. The route sections refer to them by name.

Session#

Who the caller is, and their company.

{
  "email": "anna@acme.com",
  "memberId": "m_7hd2kq9wz3xa5npe",
  "deviceId": "d_4f2a7cqm3xk9wz2b",
  "company": {
    "id": "c_k3xq7m2pa9fz4w8r",
    "name": "Acme",
    "role": "owner",
    "status": "active",
    "keyVersion": 3,
    "rotationNeeded": false,
    "autoJoin": false,
    "domain": "acme.com",
    "faces": true
  },
  "name": "Anna Smith",
  "firstName": "Anna",
  "lastName": "Smith",
  "languages": ["ru", "en"],
  "born": {"born": "1996-05"},
  "picture": "960d1ddd3dc6d59f"
}
FieldMeaning
emailthe signed-in email, lower-case
memberIdthe membership id; null while the email belongs to no company
deviceIdthe device this token is tied to; null until POST /api/devices/register
companythe Company below; null while the email belongs to no company
name, firstName, lastNamethe caller's display name in the company and its parts; "" when none (or in no company)
languages (2026-11-05)the caller's own languages, in their order, the first the apps' interface language (the apps use the first one they have words for, else the device's language); [] when none picked, or not an active member. Set with PUT /api/me/settings; the same list as GET /api/me/settings. Absent from an older service: []
bornoptional, the caller's own birth as they gave it (PUT /api/me): {"born": "1996-05-14"} (or "1996-05", "1996"), or {"age": 30, "on": "2026-11-04"} (an age on the day it was given). Absent when not given. Kept with the account (in a company or not) and private to the caller: no other session, member list or company view carries it
pictureoptional, the version of the caller's own picture (PUT /api/me/picture), also its ETag; absent when there is none. A new value: read GET /api/me/picture again
createdoptional, only in the answer of company/join when it made a new company: true
keyMatchedoptional, only from company/join: true when the sent keyProof is the company's current key proof
movedoptional, only from company/join: {"from": "c_…"} when an invitation moved the caller out of a company of their own (that company was deleted)

Company (inside a Session and in sync):

FieldMeaning
id, namethe company
rolethe caller's role: owner, admin or member
statusthe caller's status: active, or pending (waiting for an owner's or admin's approval)
keyVersionthe company key's current version; 0 = no company key yet
rotationNeededa device or member was removed: the next PC online that holds the key must make a new one
autoJoinanyone with an address at domain may join without an invitation
domainthe company's mail domain (acme.com), or null (companies made from a personal address have none)
facesthe company's PCs recognise faces in its photos (on its own computers, encrypted, never sent outside; docs/faces.md); true by default. New albums take it. Absent from an older service: true
languages (2026-11-05)the languages the company's PCs write keywords, descriptions and video moments in: the union of its active members' languages, English first, at most 5 (first picks before other picks, then by how many members read each, then in the codes' order); ["en","ru"] when no member picked any. Absent from an older service: ["en","ru"]

An email belongs to at most one company at a time.

Member#

A row of the company's member list (owner/admin only).

{
  "id": "m_9xk2qa7mz3wp4n5c",
  "email": "bob@acme.com",
  "name": "Bob Jones",
  "firstName": "Bob",
  "lastName": "Jones",
  "role": "member",
  "status": "active",
  "invitedBy": "anna@acme.com",
  "created": "2026-10-12T14:03:51.220+00:00",
  "languages": ["de"]
}

status is active, invited (invited, not signed in yet) or pending (asked to join, waiting for approval); a member answered by remove or deny shows removed. name, firstName, lastName are "" when not set. invitedBy is null for someone who joined by themselves. languages (2026-11-05): the member's own languages (me/settings), [] when none picked; the member sets them, an admin only reads them.

Person#

A colleague found by GET /api/people: `{"email": "bob@acme.com", "firstName": "Bob", "lastName": "Jones", "picture": "960d1ddd3dc6d59f"}(names""when not set).picture`, optional: the version (ETag) of their own picture, read with GET /api/people/picture; absent when they have none.

Group#

A private group of people to share with.

{"id": "gr_q8w3zx5m2ka7np4c", "name": "Design team", "members": ["bob@acme.com", "zoe@acme.com"], "hidden": false}

The automatic Coworkers group (only while the company has auto-join on) looks like this, with automatic:

{"id": "coworkers", "name": "Coworkers", "members": ["bob@acme.com", "zoe@acme.com"], "hidden": false, "automatic": "domain"}

Device#

A row of GET /api/devices.

{
  "id": "d_4f2a7cqm3xk9wz2b",
  "name": "ANNA-PC",
  "email": "anna@acme.com",
  "os": "Windows 11 Pro 23H2",
  "version": "1.8.2",
  "created": "2026-10-12T13:55:10.004+00:00",
  "lastSeen": "2026-10-18T09:11:42.871+00:00",
  "removed": false,
  "keyVersion": 3,
  "isMe": true,
  "fingerprint": "3F2A-91C0",
  "ownerName": "Anna Smith",
  "label": "Anna's desk PC"
}
FieldMeaning
namethe machine name: also the device's top folder on the PCs that store its backups
emailthe device's member
os, versionas the device registered them; version follows X-SpaceBackup-Version
removedtrue for a removed device (removed devices are listed last)
keyVersionthe company-key version this device has acknowledged (0: none yet)
isMethis is the calling device
fingerprintthe first 8 hex digits of the SHA-256 of the device's public key, as XXXX-XXXX
ownerNameoptional: the member's display name
labeloptional: the name its member gave it on their account page; only for showing, name does not change

Album#

{
  "id": "al_x7k2mq9pa4zw3n5c",
  "name": "Las Vegas",
  "ownerEmail": "anna@acme.com",
  "mine": true,
  "created": "2026-10-15T18:20:04.112+00:00",
  "updated": "2026-10-17T21:02:45.930+00:00",
  "itemCount": 42,
  "destinations": [
    {"device": "d_4f2a7cqm3xk9wz2b", "deviceName": "ANNA-PC", "dest": "e3b0c442", "label": "Backup disk"}
  ],
  "members": [
    {"email": "bob@acme.com", "since": "2026-10-15T18:25:00.000+00:00", "name": "Bob Jones", "canAdd": true, "shown": true},
    {"email": "carol@example.org", "since": "2026-10-16T08:00:12.000+00:00", "name": "Carol White", "guest": true, "canAdd": false, "shown": false}
  ],
  "ownerName": "Anna Smith",
  "membersCanAdd": false,
  "cover": null,
  "faces": true,
  "invited": [
    {"email": "dave@example.net", "since": "2026-10-17T10:00:00.000+00:00", "state": "pending"},
    {"email": "zoe@acme.com", "since": "2026-10-31T09:00:00.000+00:00", "state": "declined", "name": "Zoe Park",
     "decided": "2026-10-31T09:30:00.000+00:00"}
  ],
  "shown": true
}
FieldMeaning
minethe caller owns it
itemCountthe number of photos and videos, as last reported
destinationswhere the album's copies live: a destination (dest, its id on that PC) of a device of the company; label may be null
membersthe people it is shared with, by email. Listed to the owner and admins only; anyone else gets []. name is optional (their display name). guest: true (optional) marks someone outside the company who accepted an invitation; a guest's name is shown to the owner only. canAdd: this person may add their own photos and remove what they added: their own setting (shares/can-add), else the album's membersCanAdd; always false for a guest. shown: false when this person turned the album off (POST /api/albums/{id}/show); they are still a member
ownerNameoptional: the owner's display name
membersCanAddthe members may add their own photos and remove what they added. To a member of the album it is their own canAdd (so a phone or PC that knows nothing of per-person settings still does the right thing); to the owner and admins, the album-wide switch
coverthe item id the owner chose as cover, or null (the newest item)
facesfaces are recognised in the album's photos; set when the album is made from the company's faces, then the owner's switch (POST /api/albums/{id}). Absent from an older service: true
invitedpeople invited who have not accepted (owner and admins only): someone outside the company, or a member of it who turned off autoAcceptCompany. state: pending (not answered; it does not expire) or declined (they may still accept it; decided when). name optional, for a member of the company only (an outsider's name shows once they accept)
showntrue, unless the caller is a member or guest of the album who turned it off (show): then keep it out of Photos, Recent and Albums, don't push its adds and don't download or cache anything of it; offer Turn on where the app lists the albums shared with you. For the owner: false when they hid their own album (same call), for them alone
archivedthe owner's Archived albums (Albums › Archived; archive, or a merge): when it was archived. To the owner alone; absent otherwise. An archived album stays in every list and keeps working; apps list it under Archived instead of with the albums, and the TV hides it
mergedFroma merged album (merge): the ids of the two albums it was made of (Undo unarchives them and deletes this one). To the owner alone; absent otherwise
publicoptional: true for a device's Shared publicly album (made with {"public": true}), absent otherwise
publicDeviceoptional, with public: the name of the device that owns it, the only one that may album.put into it itself (10-api-peer.md)
filterthe album's standing filter: new photos that match go into it by themselves; null when it has none

Album brief (in sync): id, name, ownerEmail, ownerName?, mine, itemCount, created, updated, destinations, membersCanAdd (to a member, their own canAdd), cover, public?, publicDevice?, filter, shown, faces (a PC neither shows nor caches an album turned off for that member); no members.

Album filter#

An album's standing filter (iOS request #57; Albums that fill themselves): after each vision pass over a device's new items, the PCs holding that device's backups add the items that pass it.

{"words": "Create an album about night Chicago views",
 "content": "view",
 "night": true,
 "place": {"name": "Chicago", "lat": 41.88, "lon": -87.63, "radiusKm": 18.5},
 "kind": "all",
 "timeFrom": 1140, "timeTo": 1440,
 "machines": ["Vlads-iPhone"],
 "since": "2026-10-22T15:05:00Z",
 "active": true}
FieldMeaning
wordsthe user's own words (for showing; up to 500 characters)
contentwhat the pictures must show, as read from the words (up to 200); null: no judgement of what they show
nighttrue: taken at night (the analysis says night, or the sun was more than 4° below the horizon there and then and the picture is dark); null: any time
daytrue: taken in daytime (iOS request #62): the analysis says day, else the sun was above the horizon there and then and the picture is bright; one the analysis calls night is never day. Not together with night (400 filter.night and filter.day exclude each other); null: any time
placea circle: lat, lon, radiusKm (above 0, at most 20000), name for showing; null: anywhere
kindall, photos or videos
timeFrom, timeToa time of day in minutes after the photo's own local midnight (0-1440), from up to to, wrapping past midnight when from > to; both null: any time
machinesthe devices whose new items are judged (default: the calling device). Only the album owner's own devices add anything
sinceitems first backed up from then on (default: now)
activefalse: paused (kept, nothing added)

Share#

A device's backups shared with one person.

{
  "id": "sh_m3k9xq2a7pz4wn5c",
  "sourceDevice": "d_4f2a7cqm3xk9wz2b",
  "sourceName": "ANNA-PC",
  "ownerEmail": "anna@acme.com",
  "recipientEmail": "bob@acme.com",
  "sharedBy": "anna@acme.com",
  "since": "2026-10-13T09:12:00.000+00:00",
  "scope": "device"
}

scope is always device today (the whole device's backups).

Notification#

{
  "id": 1842,
  "time": "2026-10-18T08:40:11.500+00:00",
  "kind": "album-added",
  "title": "Las Vegas",
  "body": "Bob Jones added 12 photos and videos",
  "target": {"type": "album", "id": "al_x7k2mq9pa4zw3n5c"},
  "read": false,
  "quiet": false
}

kind is one of album-added, shared, key-waiting, device-joined, restore-approval, relay-credit, invitation-accepted, remove-request (see Notifications & push). target (what a click opens) is null or {type, id} with type one of album, device, share, invitation, key-release, datakey-request (a restore request, for admins: the admin page), approval (a restore request for a device of yours: Approvals, GET /api/me/approvals), relay (id: the company id), member, album-item (id: <album id>|<item id>). quiet: the person had this kind turned off when it came, so it was kept but not pushed or popped up. title and body are plain words, ready to show.

Notification list: {"notifications": [Notification, …], "unread": 3, "latest": 1842}; latest is the newest id in the inbox (0 when empty).

Error#

{"error": "only the company's owner or an admin may do this"}

Some errors add fields: attemptsLeft (a wrong sign-in code), keyVersion (the company's current key version, on key conflicts), code (a machine-readable reason: invite_needed, name_invalid, name_taken, name_clash).

Sign-in#

The three calls of the sign-in flow. They need no token.

POST /api/signin/start#

Starts a sign-in and mails the link and the code.

POST /api/signin/start · from openapi.yaml (postSigninStart)

Authnone
Bodyapplication/json SignInStartRequest
email string|null · a valid address (trimmed, lower-cased; at most 254 characters)
deviceName string|null · shown in the mail and on the confirm page ("Sign in ANNA-PC?"); at most 100 characters; default "a device"
secretHash string|null · base64 of a 32-byte SHA-256 of the secret
200OK → SignInStarted {requestId: string, expiresAt: string(date-time)}
400not a valid email address, secretHash must be base64 of a SHA-256, deviceName is too long. -
secretHash must be base64 of a SHA-256
not a valid email address
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
429too many sign-in requests; try again later (per email: 5 per 15 minutes and 20 per day; per client IP: 30 per hour). -
too many sign-in requests; try again later
503could not send the sign-in mail; try again later (the request is dropped; start again)
could not send the sign-in mail; try again later
curl
# answers 200; errors 400, 429, 503
curl -sS -X POST 'https://spacebackup.net/account/api/signin/start' \
  -H "Content-Type: application/json" \
  --data '{"email":"anna@acme.com","deviceName":"ANNA-PC","secretHash":"q1nN0w0yQm1pCk7n6Wl1fW6m4dH0Yk3x8bT1rL6sD0E="}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/signin/start",
    method="POST",
    data=json.dumps({"email": "anna@acme.com", "deviceName": "ANNA-PC", "secretHash": "q1nN0w0yQm1pCk7n6Wl1fW6m4dH0Yk3x8bT1rL6sD0E="}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 429, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/signin/start")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"anna@acme.com","deviceName":"ANNA-PC","secretHash":"q1nN0w0yQm1pCk7n6Wl1fW6m4dH0Yk3x8bT1rL6sD0E="}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 429, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/signin/start");
req.Content = new StringContent("""{"email":"anna@acme.com","deviceName":"ANNA-PC","secretHash":"q1nN0w0yQm1pCk7n6Wl1fW6m4dH0Yk3x8bT1rL6sD0E="}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 429, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/signin/code#

Redeems the 6-digit code from the mail.

POST /api/signin/code · from openapi.yaml (postSigninCode)

Authnone
Bodyapplication/json SignInCodeRequest
requestId string|null
secret string|null
code string|null
200Approved: `token` is the new device token. `memberId` and `company` are `null` while the email belongs to no company
400wrong code, with "attemptsLeft": 3. The 5th wrong code kills the request. -
wrong code
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
404no such sign-in request: an unknown requestId **or a wrong secret** (the two cannot be told apart). -
no such sign-in request
410this sign-in was already used, this sign-in has expired; start again (after 15 minutes), too many wrong codes; start again
this sign-in was already used
this sign-in has expired; start again
too many wrong codes; start again
curl
# answers 200; errors 400, 404, 410
curl -sS -X POST 'https://spacebackup.net/account/api/signin/code' \
  -H "Content-Type: application/json" \
  --data '{"requestId":"r_…","secret":"<the secret>","code":"481920"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/signin/code",
    method="POST",
    data=json.dumps({"requestId": "r_…", "secret": "<the secret>", "code": "481920"}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 404, 410
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/signin/code")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"requestId":"r_…","secret":"<the secret>","code":"481920"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 404, 410
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/signin/code");
req.Content = new StringContent("""{"requestId":"r_…","secret":"<the secret>","code":"481920"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 404, 410
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/signin/poll#

Asks whether the mailed link was confirmed. Call it every 2 seconds while the person may click the link.

POST /api/signin/poll · from openapi.yaml (postSigninPoll)

Authnone
Bodyapplication/json SignInPollRequest
requestId string|null
secret string|null
200Either {...} or the same approved answer as `POST /api/signin/code`
400Bad Request
wrong code
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
404no such sign-in request (an unknown requestId or a wrong secret)
no such sign-in request
410this sign-in was already used, this sign-in has expired; start again, too many wrong codes; start again. Stop polling on either and start again
this sign-in was already used
this sign-in has expired; start again
too many wrong codes; start again
curl
# answers 200; errors 400, 404, 410
curl -sS -X POST 'https://spacebackup.net/account/api/signin/poll' \
  -H "Content-Type: application/json" \
  --data '{"requestId":"r_…","secret":"<the secret>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/signin/poll",
    method="POST",
    data=json.dumps({"requestId": "r_…", "secret": "<the secret>"}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 404, 410
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/signin/poll")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"requestId":"r_…","secret":"<the secret>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 404, 410
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/signin/poll");
req.Content = new StringContent("""{"requestId":"r_…","secret":"<the secret>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 404, 410
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Session & company#

GET /api/me#

The caller's Session.

GET /api/me · from openapi.yaml (getMe)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Session → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/me' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/me#

Sets or clears the caller's own first and last name in their company, and/or their own birth (requests #121). The name is shown only inside the company (and to the owners of albums the caller accepted as a guest). The birth is the caller's alone: only their own Session reads it back (the apps' assistant uses it for "my photos when I was 30"); nobody in the company sees it.

PUT /api/me · from openapi.yaml (putMe)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MeRequest
name string|null
firstName string|null
lastName string|null
born any
age any
on string|null
200Session (with the new `name`, `firstName`, `lastName`, `born`) → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
400first name is too long (at most 40 characters), last name must not contain control characters, first name is required with a last name, born must be "YYYY", "YYYY-MM" or "YYYY-MM-DD", born is not a real date, born is before 1900, born is in the future, age must be a whole number from 0 to 130, on must be a date, "YYYY-MM-DD", on is in the future, age and on put the birth before 1900, give born or age, not both, on goes with age
on goes with age
first name is required with a last name
give born or age, not both
born must be "YYYY", "YYYY-MM" or "YYYY-MM-DD"
born is not a real date
born is before 1900
born is in the future
age must be a whole number from 0 to 130
on must be a date, "YYYY-MM-DD"
on is in the future
age and on put the birth before 1900
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member of a company (a name)
not an active member of a company
curl
# answers 200; errors 400, 401, 403
curl -sS -X PUT 'https://spacebackup.net/account/api/me' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"firstName":"Anna","lastName":"Smith"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me",
    method="PUT",
    data=json.dumps({"firstName": "Anna", "lastName": "Smith"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"firstName":"Anna","lastName":"Smith"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/me");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"firstName":"Anna","lastName":"Smith"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/me/picture#

Sets the caller's own picture (requests #125), shown to them and to their colleagues (the active members of their company) next to their name. Kept with the account by email, like the birth, so it stays through a company change; only the current company's active members read it.

PUT /api/me/picture · from openapi.yaml (putMePicture)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Session (with the new `picture` version) → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
400the picture is empty, the body is not a JPEG image, the body is not a PNG image
the picture is empty
401Unauthorized
not signed in
not signed in (token unknown or revoked)
413the picture is larger than 512 KB
the picture is larger than <maxPicture> KB
415the picture must be image/jpeg or image/png
the picture must be image/jpeg or image/png
curl
# answers 200; errors 400, 401, 413, 415
curl -sS -X PUT 'https://spacebackup.net/account/api/me/picture' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/picture",
    method="PUT",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 413, 415
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/picture")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 413, 415
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/me/picture");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 413, 415
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

DELETE /api/me/picture#

Removes the caller's own picture (none already: the same answer).

DELETE /api/me/picture · from openapi.yaml (deleteMePicture)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Session (no `picture`) → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X DELETE 'https://spacebackup.net/account/api/me/picture' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/picture",
    method="DELETE",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/picture")!)
req.httpMethod = "DELETE"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Delete, "https://spacebackup.net/account/api/me/picture");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/me/picture#

The caller's own picture: the image bytes with their Content-Type (image/jpeg or image/png).

GET /api/me/picture · from openapi.yaml (getMePicture)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
400Bad Request
not a valid email address
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no picture
no picture
curl
# answers ; errors 400, 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/me/picture' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/picture",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/picture")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me/picture");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers ; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/company/join#

Puts the signed-in email into a company: finds the right one, or makes a new one. Call it after every sign-in.

POST /api/company/join · from openapi.yaml (postCompanyJoin)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json JoinRequest
keyProof string|null · the proof of a company key this device already holds (a PC upgrading from before accounts)
create boolean|null · `true`: "Create my own company" when no company matches
name string|null · the new company's name (1–100 characters); default: the email's domain, or "<email>'s company" for a personal address
200Session, plus `"created": true` for a new company, and `"keyMatched": true` when `keyProof` is the current key proof of the caller's company after the join (the registered device is then recorded as holding the current key version) → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
400name is too long, name must not contain control characters. -
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
409{"error": "Ask your company's admin to invite anna@gmail.com, or create your own company.", "code": "invite_needed"}: show **Check again** and **Create my own company** (which sends create: true). -
Ask your company's admin to invite <email>, or create your own company.
device name <name> is already used in <name>: rename this device, then join again
curl
# answers 200; errors 400, 401, 409
curl -sS -X POST 'https://spacebackup.net/account/api/company/join' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"keyProof":"MCowBQYDK2VwAyEA8Jx…","create":true,"name":"Anna Smith"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/company/join",
    method="POST",
    data=json.dumps({"keyProof": "MCowBQYDK2VwAyEA8Jx…", "create": True, "name": "Anna Smith"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/company/join")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"keyProof":"MCowBQYDK2VwAyEA8Jx…","create":true,"name":"Anna Smith"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/company/join");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"keyProof":"MCowBQYDK2VwAyEA8Jx…","create":true,"name":"Anna Smith"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/company/settings#

Changes the company's name, auto-join and recognising faces, as the admin page's settings form does (Renaming the company).

POST /api/company/settings · from openapi.yaml (postCompanySettings)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json CompanySettingsRequest
name string|null
autoJoin boolean|null
faces boolean|null
200Session with the updated company → SessionView {email: string, memberId: string|null, deviceId: string|null, company: CompanyView|null, name: string, firstName: string, lastName: string, languages: string[], born?: BirthView|null, picture?: string|null, created?: boolean|null, keyMatched?: boolean|null, moved?: MovedFrom|null}
400name is required, name is too long, name must not contain control characters, auto-join needs a company domain; this company has none
auto-join needs a company domain; this company has none
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the company's owner or an admin may do this
only the company's owner or an admin may do this
curl
# answers 200; errors 400, 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/company/settings' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Acme Inc.","autoJoin":true,"faces":false}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/company/settings",
    method="POST",
    data=json.dumps({"name": "Acme Inc.", "autoJoin": True, "faces": False}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/company/settings")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Acme Inc.","autoJoin":true,"faces":false}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/company/settings");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Acme Inc.","autoJoin":true,"faces":false}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Members & people#

The admin page's member list, for the apps (account members, account invite in the CLI). See Members and Roles for what each action means.

GET /api/members#

GET /api/members · from openapi.yaml (getMembers)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Member]` (Member): active, invited and pending members → array of MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the company's owner or an admin may do this
only the company's owner or an admin may do this
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/members' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/members");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/invite#

Invites an address (a personal one too) and mails the invitation. The person joins when they sign in with exactly that address and the app calls company/join.

POST /api/members/invite · from openapi.yaml (postMembersInvite)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MemberInviteRequest
email string|null
role string|null
200The new Member row (`status: "invited"` → MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
400not a valid email address, role must be admin or member
role must be admin or member
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's owner or an admin may do this
404no such member (only when the new row was removed again before the answer was read back)
no such member
409bob@acme.com is already a member, bob@acme.com belongs to another company (a company of their own that nothing depends on does not count)
<e> is already a member
<e> belongs to another company
curl
# answers 200; errors 400, 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/members/invite' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"email":"bob@acme.com","role":"member"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/invite",
    method="POST",
    data=json.dumps({"email": "bob@acme.com", "role": "member"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/invite")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"bob@acme.com","role":"member"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/invite");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"email":"bob@acme.com","role":"member"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/{id}/role#

POST /api/members/{id}/role · from openapi.yaml (postMembersIdRole)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MemberRoleRequest
role string|null
200The member's row after the change → MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
400role must be admin or member
role must be admin or member
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's owner or an admin may do this
404no such member
no such member
409the owner's role cannot be changed
the owner's role cannot be changed
curl
# answers 200; errors 400, 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/role' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"role":"admin"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/role",
    method="POST",
    data=json.dumps({"role": "admin"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/role")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"role":"admin"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/role");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"role":"admin"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/{id}/approve#

Lets a pending person in. They get a "You joined Acme" mail.

POST /api/members/{id}/approve · from openapi.yaml (postMembersIdApprove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The member's row (`status: "active"`) → MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's owner or an admin may do this
404no such member
no such member
409bob@acme.com is active, not waiting for approval, bob@acme.com belongs to another company now
<email> is <status>, not waiting for approval
<email> belongs to another company now
curl
# answers 200; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/approve' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/approve",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/approve")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/approve");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/{id}/deny#

POST /api/members/{id}/deny · from openapi.yaml (postMembersIdDeny)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The member's row (`status: "removed"`) → MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's owner or an admin may do this
404no such member
no such member
409bob@acme.com is active, not waiting for approval (any status but pending), bob@acme.com belongs to another company now
<email> is <status>, not waiting for approval
<email> belongs to another company now
curl
# answers 200; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/deny' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/deny",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/deny")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/deny");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/{id}/remove#

Removes a member: their sessions are revoked, their devices removed, their shares ended, their phones' saved state deleted, and the company key must be replaced (rotationNeeded). The owner and admins get a mail.

POST /api/members/{id}/remove · from openapi.yaml (postMembersIdRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The member's row (`status: "removed"`) → MemberView {id: string, email: string, name: string, firstName: string, lastName: string, role: string, status: string, invitedBy: string|null, created: string(date-time), languages: string[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's owner or an admin may do this
404no such member
no such member
409the owner cannot be removed
the owner cannot be removed
curl
# answers 200; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/remove",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/members/{id}/name#

Sets or clears any member's first and last name (the owner's too). Whoever wrote last wins.

POST /api/members/{id}/name · from openapi.yaml (postMembersIdName)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MemberNameRequest
name string|null
firstName string|null
lastName string|null
200(all `""` after clearing)
400Bad Request
first name is required with a last name
<what> is too long (at most 40 characters)
<what> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a plain member (they use PUT /api/me)
only the company's owner or an admin may do this
missing CSRF token
404no such member (also a removed one)
no such member
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/name' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Anna Smith","firstName":"ANNA-PC","lastName":"ANNA-PC"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/name",
    method="POST",
    data=json.dumps({"name": "Anna Smith", "firstName": "ANNA-PC", "lastName": "ANNA-PC"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/name")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Anna Smith","firstName":"ANNA-PC","lastName":"ANNA-PC"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/members/m_7hd2kq9wz3xa5npe/name");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Anna Smith","firstName":"ANNA-PC","lastName":"ANNA-PC"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/people#

Finds colleagues to share with, by name or email.

GET /api/people · from openapi.yaml (getPeople)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryq string|null (optional)
queryall string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Person]` (Person), by first name, last name, email (people without a name last) → array of PersonView {email: string, firstName: string, lastName: string, picture?: string|null}
400q is too long (at most 200 characters)
q is too long (at most 200 characters)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member
not an active member of a company
429too many searches; try again in a minute (60 a minute per member, both forms together)
too many searches; try again in a minute
curl
# answers 200; errors 400, 401, 403, 429
curl -sS -X GET 'https://spacebackup.net/account/api/people?q=anna&all=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/people?q=anna&all=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/people?q=anna&all=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/people?q=anna&all=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/people/picture#

A colleague's own picture (requests #125), as they set it with PUT /api/me/picture.

GET /api/people/picture · from openapi.yaml (getPeoplePicture)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryemail string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
400email is required, not a valid email address
email is required
not a valid email address
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member
not an active member of a company
404no picture: they have none, or are not an active member of the caller's company (the same answer, so it tells nothing about other companies)
no picture
curl
# answers ; errors 400, 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/people/picture?email=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/people/picture?email=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/people/picture?email=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/people/picture?email=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers ; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Groups#

A person's own groups of people to share with (the phone's Groups tab). Groups are private: nobody else, admins included, sees or changes them. Members of a group may be any email addresses, not only colleagues.

While the company has auto-join on, everyone in it also has the automatic Coworkers group (id coworkers): all active members at the company's domain, the caller left out, computed at every read. It can be hidden, nothing else.

GET /api/groups#

GET /api/groups · from openapi.yaml (getGroups)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Group]` (Group): Coworkers first (when there is one), then the caller's groups by name → array of GroupView {id: string, name: string, members: string[], hidden: boolean, automatic?: string|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/groups' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/groups",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/groups")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/groups");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/groups#

POST /api/groups · from openapi.yaml (postGroups)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json GroupRequest
name string|null
members string[]
hidden boolean|null
201Group → GroupView {id: string, name: string, members: string[], hidden: boolean, automatic?: string|null}
400name is required, name is too long (at most 40 characters), name must not contain control characters, not a valid email address, too many members (at most 500)
name is required
name is too long (at most 40 characters)
name must not contain control characters
too many members (at most 500)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
409too many groups (at most 200)
too many groups (at most 200)
curl
# answers 201; errors 400, 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/groups' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Design team","members":["bob@acme.com","zoe@acme.com"],"hidden":false}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/groups",
    method="POST",
    data=json.dumps({"name": "Design team", "members": ["bob@acme.com", "zoe@acme.com"], "hidden": False}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 201; errors 400, 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/groups")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Design team","members":["bob@acme.com","zoe@acme.com"],"hidden":false}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 201; errors 400, 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/groups");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Design team","members":["bob@acme.com","zoe@acme.com"],"hidden":false}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 201; errors 400, 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/groups/{id}#

PUT /api/groups/{id} · from openapi.yaml (putGroupsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json GroupRequest
name string|null
members string[]
hidden boolean|null
200Group → GroupView {id: string, name: string, members: string[], hidden: boolean, automatic?: string|null}
400Bad Request
name is required
name is too long (at most 40 characters)
name must not contain control characters
too many members (at most 500)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403the service keeps Coworkers; you can only hide it
the service keeps Coworkers; you can only hide it
not an active member of a company
404no such group (not the caller's, or coworkers while auto-join is off)
no such group
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X PUT 'https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Family","members":["anna@acme.com"],"hidden":true}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c",
    method="PUT",
    data=json.dumps({"name": "Family", "members": ["anna@acme.com"], "hidden": True}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Family","members":["anna@acme.com"],"hidden":true}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Family","members":["anna@acme.com"],"hidden":true}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

DELETE /api/groups/{id}#

DELETE /api/groups/{id} · from openapi.yaml (deleteGroupsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403the service keeps Coworkers; you can hide it instead
the service keeps Coworkers; you can hide it instead
not an active member of a company
404no such group
no such group
curl
# answers 204; errors 401, 403, 404
curl -sS -X DELETE 'https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c",
    method="DELETE",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c")!)
req.httpMethod = "DELETE"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Delete, "https://spacebackup.net/account/api/groups/gr_q8w3zx5m2ka7np4c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Face names#

The name picker of face recognition (docs/faces.md#names): when someone names a person in the People view, "Who is this?" or Rename, the apps suggest the company's members, the people in the caller's groups and every name given before in the company. The names given are kept here for the company, under the face data's rules: the company's active members only (their devices and the web, never a TV, a guest or an app's token), nothing while the company's Recognize faces is off (kept, shown again when it is on), erased by faces delete-all. The PC that writes a name into a member's book records it (POST); a phone asks a PC (faces.name) and never records it itself.

GET /api/faces/names#

GET /api/faces/names · from openapi.yaml (getFacesNames)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryq string|null (optional)
querylimit integer|null (optional)
querygroups string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → FaceNamesView {on: boolean, names: FaceNameView[]}
400q is too long (at most 200 characters)
q is too long (at most 200 characters)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member, or only the company's members' devices see the faces' names
only the company's members' devices see the faces' names
not an active member of a company
429too many requests; try again in a minute (120 a minute per member, reads and records together)
too many requests; try again in a minute
curl
# answers 200; errors 400, 401, 403, 429
curl -sS -X GET 'https://spacebackup.net/account/api/faces/names?q=anna&limit=50&groups=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/faces/names?q=anna&limit=50&groups=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/faces/names?q=anna&limit=50&groups=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/faces/names?q=anna&limit=50&groups=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/faces/names#

A name was given (a group named, a person renamed or split off, a face named): added to the company's names, or used once more (uses + 1, last now, the newest spelling kept; the same name ignoring case and accents is one row).

POST /api/faces/names · from openapi.yaml (postFacesNames)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json FaceNameRequest
name string|null
email string|null
aka string[]
200FaceName (`source: "name"`, `also` its `aka`) → FaceNameView {name: string, source: string, email?: string|null, member?: boolean, group?: string|null, uses: integer(int64), last?: integer(int64)|null, also?: string[]}
400name is required, name is too long (at most 60 characters, or an email), name must not contain control characters, aka: at most 10 other names, aka: Mo is already one of this person's names, the same aka: … as name's, not a valid email address, email: not a member of this company
email: not a member of this company
<field> is required
<field> is too long (at most 60 characters, or an email)
<field> must not contain control characters
not a valid email address
aka: at most 10 other names
aka: <v> is already one of this person's names
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member
only the company's members' devices see the faces' names
not an active member of a company
409Recognize faces is off for this company
Recognize faces is off for this company
429too many requests; try again in a minute
too many requests; try again in a minute
curl
# answers 200; errors 400, 401, 403, 409, 429
curl -sS -X POST 'https://spacebackup.net/account/api/faces/names' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Marina","email":"marina@acme.com","aka":["Mo","marina@example.com"]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/faces/names",
    method="POST",
    data=json.dumps({"name": "Marina", "email": "marina@acme.com", "aka": ["Mo", "marina@example.com"]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 409, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/faces/names")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Marina","email":"marina@acme.com","aka":["Mo","marina@example.com"]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 409, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/faces/names");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Marina","email":"marina@acme.com","aka":["Mo","marina@example.com"]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 409, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

DELETE /api/faces/names#

DELETE /api/faces/names · from openapi.yaml (deleteFacesNames)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryname string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
400name is too long (at most 60 characters, or an email)
<field> is required
<field> is too long (at most 60 characters, or an email)
<field> must not contain control characters
not a valid email address
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member; only the company's owner or an admin may do this (every name)
only the company's members' devices see the faces' names
not an active member of a company
only the company's owner or an admin may do this
curl
# answers 204; errors 400, 401, 403
curl -sS -X DELETE 'https://spacebackup.net/account/api/faces/names' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/faces/names",
    method="DELETE",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/faces/names")!)
req.httpMethod = "DELETE"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Delete, "https://spacebackup.net/account/api/faces/names");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Work marks#

The user's work mark (Vladimir, 2026-11-08; docs/albums.md, "The user's work mark"): any photo or video can be marked work or not work by a member; the mark replaces Space Vision's work label for that item for good (a later analysis never changes it), on every device of every member. One mark per item of the company: source is the backups' device name the item comes from (the month index's machine, an album item's source), id its id there; the same photo in an album and in its device's backups is one item. Every changed mark takes the company's next version v (one counter per company), so a device asks only for what is new. The company's PCs fold the marks into their month index and albums; a TV marks through its PC. Erased with the company.

POST /api/work/marks#

POST /api/work/marks · from openapi.yaml (postWorkMarks)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json WorkMarksRequest
marks WorkMarkIn|null[]
200`v` the company's version after the request, `changed` the marks that changed (a mark equal to the stored one changes nothing and is not counted) → WorkMarksPosted {ok: boolean, v: integer(int64), changed: integer}
400marks is required, marks is empty (1 to 500 marks), too many marks (at most 500 a request), marks[0].source is required, marks[0].id is too long (at most 200 characters), marks[0].source must not contain control characters, marks[0].work must be true or false
marks is required
marks is empty (1 to 500 marks)
too many marks (at most 500 a request)
marks[<i>] is not a mark
marks[<i>].work must be true or false
marks[<i>].<name> is required
marks[<i>].<name> is too long (at most 200 characters)
marks[<i>].<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member, or only the company's members' devices and the web mark work (a TV's token: a TV's token is for the TV routes only)
only the owner of a photo or video changes its work label: <source>'s items are not yours
only the company's members' devices and the web mark work
not an active member of a company
missing CSRF token
429too many marks (at most 2000 a minute); try again in a minute (2,000 marks a minute per member, counted as sent; a refused request keeps nothing)
too many marks (at most 2000 a minute); try again in a minute
curl
# answers 200; errors 400, 401, 403, 429
curl -sS -X POST 'https://spacebackup.net/account/api/work/marks' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"marks":[{"source":null,"id":null,"work":"…"}]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/work/marks",
    method="POST",
    data=json.dumps({"marks": [{"source": None, "id": None, "work": "…"}]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/work/marks")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"marks":[{"source":null,"id":null,"work":"…"}]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/work/marks");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"marks":[{"source":null,"id":null,"work":"…"}]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/work/marks#

GET /api/work/marks · from openapi.yaml (getWorkMarks)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
querysince integer(int64)|null (optional)
querylimit integer|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The company's marks, oldest first: `v`: the company's version now → WorkMarksView {v: integer(int64), marks: WorkMarkView[], more: boolean}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only the company's members' devices and the web mark work
not an active member of a company
missing CSRF token
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/work/marks?since=1&limit=50' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/work/marks?since=1&limit=50",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/work/marks?since=1&limit=50")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/work/marks?since=1&limit=50");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Devices#

POST /api/devices/register#

Ties the calling token to a device and records its public key. Call it after company/join, and again whenever the device's name, OS, app version or key changes.

POST /api/devices/register · from openapi.yaml (postDevicesRegister)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json RegisterRequest
name string|null · the machine name (below)
os string|null · free text, at most 100 characters ("Windows 11 Pro 23H2", "iOS 26.0")
version string|null · the app version, at most 40 characters
publicKey string|null · the device's P-256 public key, base64 SubjectPublicKeyInfo
200OK → DeviceRegistered {deviceId: string}
400{"error": "name must be a machine name: …", "code": "name_invalid"}, {"error": "Albums is a reserved name (the albums' folder on the hosts); choose another name", "code": "name_invalid"}, publicKey must be a base64 P-256 SubjectPublicKeyInfo. -
name must be a machine name: 1-64 ASCII letters, digits, '-', '_' or '.', starting with a letter or digit, not ending in '.', no '..', not a Windows reserved name (CON, NUL, COM1...)
Albums is a reserved name (the albums' folder on the hosts); choose another name
publicKey must be a base64 P-256 SubjectPublicKeyInfo
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
409join a company first (company/join); {"error": "device name ANNA-PC is already used in this company", "code": "name_taken"}
join a company first (company/join)
device name <name> is already used in this company
device name <name> is an iCloud Photos library's in this company
curl
# answers 200; errors 400, 401, 409
curl -sS -X POST 'https://spacebackup.net/account/api/devices/register' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"ANNA-PC","os":"Windows 11 Pro 23H2","version":"1.8.2","publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/register",
    method="POST",
    data=json.dumps({"name": "ANNA-PC", "os": "Windows 11 Pro 23H2", "version": "1.8.2", "publicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/register")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"ANNA-PC","os":"Windows 11 Pro 23H2","version":"1.8.2","publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/register");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"ANNA-PC","os":"Windows 11 Pro 23H2","version":"1.8.2","publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/devices#

All devices of the caller's company, removed ones too.

GET /api/devices · from openapi.yaml (getDevices)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Device]` (Device), active ones first, by email and name → array of DeviceView {id: string, name: string, email: string, os: string, version: string, created: string(date-time), lastSeen: string(date-time), removed: boolean, keyVersion: integer, isMe: boolean, fingerprint: string, ownerName?: string|null, label?: string|null, kind?: string|null, host?: string|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/devices' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/devices");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/devices/key#

The public key of a device of the company, by its name. PCs use it to check another PC's signed replication grants (Replication).

GET /api/devices/key · from openapi.yaml (getDevicesKey)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryname string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`signingKey` is *optional*: present when the device registered a separate signing key (below) → DeviceKeyView {deviceId: string, name: string, publicKey: string, signingKey?: string|null}
400name is required
<name> is required
<name> is too long
<name> must not contain control characters
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no active device of that name in this company, code no_device
no active device of that name in this company
410device <n> was removed from this company, code removed (only removed devices have that name; a removed member's devices are removed too), or device <n>'s member is not an active member of this company: its key is revoked, code revoked. 404 and 410 with a code are the definite "no": a PC that kept the device's key (a Space Vision worker's, a day) drops it and refuses; a 401/403 or a 404 without a code is not that answer (try again)
device <n> was removed from this company
device <name>'s member is not an active member of this company: its key is revoked
curl
# answers 200; errors 400, 401, 403, 404, 410
curl -sS -X GET 'https://spacebackup.net/account/api/devices/key?name=ANNA-PC' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/key?name=ANNA-PC",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 410
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/key?name=ANNA-PC")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 410
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/devices/key?name=ANNA-PC");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 410
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/icloud#

The calling PC backs up its member's iCloud Photos library (the folder iCloud for Windows keeps). The library is then listed by GET /api/devices as a device of the member with "kind": "icloud", "host": this PC's device id, "os": "icloud". Its name is a machine name, its folder on the drives (laid out like a phone's), in the peer protocol, the Photos tab and Space Vision: <First>-iCloud-Photos, from the first word of the member's display name (else the part of their email before the @) without what a machine name refuses (iCloud-Photos when nothing is left), with -2, -3... when a device or another iCloud source of the company (removed ones too) has it; given once and kept. Its label is what the apps show: <member>'s iCloud Photos. A device cannot register under a live source's name (409).

POST /api/devices/icloud · from openapi.yaml (postDevicesIcloud)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → ICloudSourceView {id: string, name: string, email: string, host: string, label?: string|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
curl
# answers 200; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/devices/icloud' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/icloud",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/icloud")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/icloud");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/icloud/{id}/remove#

Stops an iCloud Photos source; it stays listed with "removed": true, and its backups stay on the drives. Its key leaves the member's sync.shared (see PUT /api/datakey).

POST /api/devices/icloud/{id}/remove · from openapi.yaml (postDevicesIcloudIdRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only its member, its PC or an admin can remove an iCloud source
only its member, its PC or an admin can remove an iCloud source
not an active member of a company
404no such iCloud source
no such iCloud source
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/devices/icloud/x_k3xq7m2pa9fz4w8r/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/icloud/x_k3xq7m2pa9fz4w8r/remove",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/icloud/x_k3xq7m2pa9fz4w8r/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/icloud/x_k3xq7m2pa9fz4w8r/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/{id}/label#

Gives a device a friendly name for showing ("Bob's laptop"). The machine name does not change.

POST /api/devices/{id}/label · from openapi.yaml (postDevicesIdLabel)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeviceLabelRequest
label string|null
200OK
400the name is too long (at most 64 characters), the name must not contain control characters
the name is too long (at most 64 characters)
the name must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such device (removed, another company's, or another member's for a plain member)
no such device
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/label' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"label":"Anna'\''s desk PC"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/label",
    method="POST",
    data=json.dumps({"label": "Anna's desk PC"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/label")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"label":"Anna's desk PC"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/label");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"label":"Anna's desk PC"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/{id}/signing-key#

Registers the key a device signs its replication grants with, for a device whose registered key cannot sign (an iPhone's Secure Enclave key-agreement key). Calling it again replaces the key; removing the device clears it.

POST /api/devices/{id}/signing-key · from openapi.yaml (postDevicesIdSigningKey)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json SigningKeyRequest
publicKey string|null
signingKey string|null
204No Content
400publicKey must be a base64 P-256 SubjectPublicKeyInfo
publicKey must be a base64 P-256 SubjectPublicKeyInfo
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the device itself sets its signing key, this device is not registered (devices/register)
only the device itself sets its signing key
not an active member of a company
this device is not registered (devices/register)
curl
# answers 204; errors 400, 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/signing-key' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/signing-key",
    method="POST",
    data=json.dumps({"publicKey": "<base64 P-256 SubjectPublicKeyInfo>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/signing-key")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/signing-key");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/{id}/remove#

Removes a device: it is signed out, its waiting key deliveries are dropped, its shares end, and the company key is replaced by the next PC online (rotationNeeded, once the company has a key). The owner and admins get a mail.

POST /api/devices/{id}/remove · from openapi.yaml (postDevicesIdRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when it was removed already)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the company's owner or an admin (or the device's member) may remove a device
only the company's owner or an admin (or the device's member) may remove a device
not an active member of a company
404no such device
no such device
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/remove",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Company key & handover#

Each company has one company key: it encrypts the channel between the company's PCs and protects the recovery of data keys (The company key). The service never holds it in clear. It moves between devices only sealed to the receiving device's public key, as a keyring: JSON {"current": 3, "keys": {"1": "K7MXP-…", "2": "…", "3": "…"}} with every version, so older recovery copies stay usable. A device that has the current version hands it to devices that lack it; the service only carries the sealed boxes.

GET /api/sync#

The app's heartbeat: call it right after sign-in and then every 60 seconds. It records the device's last-seen time and app version, and returns everything the device must act on.

What a device does with it:

  1. deliveries not empty → open the newest box with the device's private key, keep the keyring, then POST /api/key/ack with its version.
  2. handovers not empty (and this device has the current key) → seal the keyring to each listed publicKey and POST /api/key/deliver.
  3. company.rotationNeeded and this device has the current key → make a new key, POST /api/company/key with version + 1; the others get it as handovers.
  4. dataKeyRotation → make a new data key and PUT /api/datakey.
  5. matchKeyNeeded and no matching key kept → POST /api/matchkey/claim; on 204 make 32 random bytes and keep them. Holding the matching key and matchKeyHandovers not empty → seal it to each and POST /api/matchkey/deliver.

GET /api/sync · from openapi.yaml (getSync)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200| Field | Meaning | |---|---| | `company` | as in the Session → SyncView {company: CompanyView|null, device: SyncDevice|null, deliveries: DeliveryView[], handovers: HandoverView[], keyRecovery: KeyRecoveryBrief|null, datakeyRequests: DataKeyRequestBrief[], dataKeyRotation: boolean, keyRelease: KeyReleaseView|null, keyReleaseRequests: KeyReleaseRequestView[], shared: SharedKeysView[], notifications: SyncNotifications|null, update?: UpdateNews|null, albums: AlbumBriefView[], deletedAlbums: AlbumBriefView[], matchKey?: string|null, matchKeyNeeded: boolean, matchKeyHandovers: HandoverView[], memberMatchKeys: MemberMatchKeyView[], commands: RemoteCommandBrief[]}
400Bad Request
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 400, 401
curl -sS -X GET 'https://spacebackup.net/account/api/sync' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/sync",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/sync")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/sync");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/key/deliver#

Leaves a sealed keyring in another device's mailbox.

POST /api/key/deliver · from openapi.yaml (postKeyDeliver)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeliverRequest
toDevice string|null
version integer
sealed string|null
204No Content
400sealed must be base64, sealed is too long
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be base64
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such device (not an active device of the company)
no such device
409{"error": "only the company's current key version can be delivered", "keyVersion": 3}, {"error": "this device does not have the current key", "keyVersion": 3}
only the company's current key version can be delivered
this device does not have the current key
curl
# answers 204; errors 400, 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/key/deliver' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"toDevice":"d_9pz4wn5cm3k9xq2a","version":3,"sealed":"<base64 sealed box>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key/deliver",
    method="POST",
    data=json.dumps({"toDevice": "d_9pz4wn5cm3k9xq2a", "version": 3, "sealed": "<base64 sealed box>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key/deliver")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"toDevice":"d_9pz4wn5cm3k9xq2a","version":3,"sealed":"<base64 sealed box>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/key/deliver");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"toDevice":"d_9pz4wn5cm3k9xq2a","version":3,"sealed":"<base64 sealed box>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/matchkey/claim#

The right to make the member's matching key (iOS request #68), for one device only: the service never makes, holds or sees the key. The winner makes 32 random bytes, keeps them and hands them over sealed (POST /api/matchkey/deliver).

POST /api/matchkey/claim · from openapi.yaml (postMatchkeyClaim)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204To the first device that asks while no device of the member holds a key, and again to that same device while its claim is live (it lost the key before keeping it)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
409a device of this member already holds the matching key; it is handed to this device, another device of this member makes the matching key
a device of this member already holds the matching key; it is handed to this device
another device of this member makes the matching key
curl
# answers 204; errors 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/matchkey/claim' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/matchkey/claim",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/matchkey/claim")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/matchkey/claim");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/matchkey/deliver#

A device holding the member's matching key (it won the claim, or one was handed to it) leaves it sealed for one of the devices in matchKeyHandovers (DeviceKey.Seal, purpose member-match-key); that device drops out of the list and gets the box as sync.matchKey (a PC hosting another member's iCloud Photos: in memberMatchKeys). The box is opaque; the service stores only sealed boxes.

POST /api/matchkey/deliver · from openapi.yaml (postMatchkeyDeliver)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MatchKeyDeliverRequest
toDevice string|null
sealed string|null
204No Content
400the matching key is handed to another device (toDevice is the caller), sealed must be base64
the matching key is handed to another device
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be base64
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a target that is neither the member's own device nor a PC hosting their iCloud Photos
a matching key goes only to the member's own devices and the PCs hosting their iCloud Photos
not an active member of a company
this device is not registered (devices/register)
404no such device
no such device
409this device does not hold the member's matching key
this device does not hold the member's matching key
curl
# answers 204; errors 400, 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/matchkey/deliver' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"toDevice":"d_9pz4wn5cm3k9xq2a","sealed":"<base64 sealed box>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/matchkey/deliver",
    method="POST",
    data=json.dumps({"toDevice": "d_9pz4wn5cm3k9xq2a", "sealed": "<base64 sealed box>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/matchkey/deliver")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"toDevice":"d_9pz4wn5cm3k9xq2a","sealed":"<base64 sealed box>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/matchkey/deliver");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"toDevice":"d_9pz4wn5cm3k9xq2a","sealed":"<base64 sealed box>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/key/ack#

Says this device now has a key version. Its deliveries up to that version are dropped; the acknowledged version never goes down. It also ends a wait for the company key.

POST /api/key/ack · from openapi.yaml (postKeyAck)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AckRequest
version integer
keyProof string|null
204No Content
400no such key version, keyProof is not the proof of the company's current key version
no such key version
keyProof is not the proof of the company's current key version
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
curl
# answers 204; errors 400, 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/key/ack' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"version":3,"keyProof":"<proof>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key/ack",
    method="POST",
    data=json.dumps({"version": 3, "keyProof": "<proof>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key/ack")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"version":3,"keyProof":"<proof>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/key/ack");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"version":3,"keyProof":"<proof>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/company/key#

Sets the company's first key (version 1) or rotates it (version = current + 1). Compare-and-set: of two PCs rotating at once one wins and the other gets 409 and takes the winner's keyring from its deliveries.

POST /api/company/key · from openapi.yaml (postCompanyKey)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json CompanyKeyRequest
version integer · current + 1
keyProof string|null · a proof derived from the new key (the service stores its hash; it lets other PCs that hold the key join by `keyProof`)
recovery string|null · the whole new keyring sealed to the service's recovery public key (`GET /api/recovery-key`); a sealed box starting with `SBK1`, base64, at most 64 KB
204No Content
400recovery must be a sealed box (DeviceKey.Seal to the recovery key), keyProof is required
recovery must be a sealed box (DeviceKey.Seal to the recovery key)
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be base64
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
409{"error": "the first key must be version 1", "keyVersion": 0}, {"error": "the company key changed; take the current one from your deliveries", "keyVersion": 4}
the first key must be version 1
the company key changed; take the current one from your deliveries
the company key changed
curl
# answers 204; errors 400, 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/company/key' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"version":3,"keyProof":"MCowBQYDK2VwAyEA8Jx…","recovery":"…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/company/key",
    method="POST",
    data=json.dumps({"version": 3, "keyProof": "MCowBQYDK2VwAyEA8Jx…", "recovery": "…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/company/key")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"version":3,"keyProof":"MCowBQYDK2VwAyEA8Jx…","recovery":"…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/company/key");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"version":3,"keyProof":"MCowBQYDK2VwAyEA8Jx…","recovery":"…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/recovery-key#

The service's recovery public key, to seal the recovery copy to.

GET /api/recovery-key · from openapi.yaml (getRecoveryKey)

Authnone
200(P-256, base64 SubjectPublicKeyInfo) → RecoveryKeyView {publicKey: string}
curl
# answers 200
curl -sS -X GET 'https://spacebackup.net/account/api/recovery-key'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/recovery-key",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/recovery-key")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/recovery-key");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Waiting for the company key#

A new device must never be stuck because the only device that holds the key is off or asleep. So when no device hands the key over within 2 minutes, the owner and admins can approve the new device, and the service gives it the key from its recovery copy at once. See Devices waiting for the company key.

GET /api/key-release#

The devices waiting for an approval: mailed, not removed, still without a key; not the caller's own device.

GET /api/key-release · from openapi.yaml (getKeyRelease)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The same list is `keyReleaseRequests` in an owner's or admin's `sync` → array of KeyReleaseRequestView {id: string, deviceId: string, name: string, email: string, os: string, since: string(date-time), mailedAt: string(date-time)}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the company's owner or an admin may do this
only the company's owner or an admin may do this
missing CSRF token
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/key-release' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key-release",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key-release")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/key-release");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/key-release/{id}/approve#

Approves a waiting device: the newest recovery copy of the keyring is opened with the service's recovery key and sealed to the waiting device's public key, as a delivery with fromDevice: "service". The device takes it with its next sync and acknowledges it.

POST /api/key-release/{id}/approve · from openapi.yaml (postKeyReleaseIdApprove)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when it was approved already)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a device cannot approve itself: approve it from the email we sent, or from another signed-in device or the admin page; only the company's owner or an admin may approve this
a device cannot approve itself: approve it from the email we sent, or from another signed-in device or the admin page
only the company's owner or an admin may do this
only the company's owner or an admin may approve this
missing CSRF token
404no such key request
no such key request
409ANNA-LAPTOP already has the company key, that device was removed, the company has no recovery copy of its key
that device was removed
<name> already has the company key
the company has no recovery copy of its key
503the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it (the service runs with another recovery key than the copy was sealed to; nothing changed, try again later)
the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it
curl
# answers 204; errors 401, 403, 404, 409, 503
curl -sS -X POST 'https://spacebackup.net/account/api/key-release/kq_w2m7zx4qa9k3pn5c/approve' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key-release/kq_w2m7zx4qa9k3pn5c/approve",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404, 409, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key-release/kq_w2m7zx4qa9k3pn5c/approve")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404, 409, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/key-release/kq_w2m7zx4qa9k3pn5c/approve");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404, 409, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Company-key recovery#

For the case where every device that held the company key is lost. An admin's new device asks for the recovery copy; after 24 hours (server setting recoveryDelayHours), unless an admin cancels, the service releases it to that device. Every admin is mailed a Cancel link. See Company-key recovery.

POST /api/key-recovery/request#

POST /api/key-recovery/request · from openapi.yaml (postKeyRecoveryRequest)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → KeyRecoveryStarted {id: string, releaseAt: string(date-time)}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a plain member, or this device is not registered (devices/register)
only the company's owner or an admin may do this
this device is not registered (devices/register)
409the company has no key to recover yet, this device already has the company key
the company has no key to recover yet
this device already has the company key
curl
# answers 200; errors 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/key-recovery/request' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key-recovery/request",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key-recovery/request")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/key-recovery/request");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/key-recovery/{id}#

GET /api/key-recovery/{id} · from openapi.yaml (getKeyRecoveryId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → KeyRecoveryView {id: string, state: string, releaseAt: string(date-time), sealed?: string|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only an admin's device gets the recovery copy (the requester is no longer an admin)
only an admin's device gets the recovery copy
not an active member of a company
this device is not registered (devices/register)
404no such key recovery request
no such key recovery request
503the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it (the request is released but the service runs with another recovery key than the copy was sealed to; ask again later)
the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it
curl
# answers 200; errors 401, 403, 404, 503
curl -sS -X GET 'https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/key-recovery/{id}/cancel#

POST /api/key-recovery/{id}/cancel · from openapi.yaml (postKeyRecoveryIdCancel)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when cancelled already)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not owner/admin
only the company's owner or an admin may do this
missing CSRF token
404no such key recovery request
no such key recovery request
409the recovery copy was already released
the recovery copy was already released
curl
# answers 204; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Data-key recovery & restore requests#

Each device (PC or phone) encrypts its backups with its own data key. It stores a copy on the service, wrapped with a key derived from the company key, which the service cannot open. When a device is lost, another device (a PC or a new phone) asks to restore its backups; it is approved; the requesting device then gets the wrapped copy and unwraps it with the company key (the copy is not sealed to the requesting device; the format is in docs/account-service.md, "Data-key recovery"). See Approving restores.

PUT /api/datakey#

Stores (or replaces) the calling device's wrapped data key, or the data key of an iCloud Photos source it hosts.

PUT /api/datakey · from openapi.yaml (putDatakey)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DataKeyPut
keyId string|null
keyVersion integer
wrapped string|null
device string|null
204No Content
400no such key version, wrapped must be base64, keyId is required
no such key version
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be base64
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the PC hosting an iCloud source puts its data key
not an active member of a company
this device is not registered (devices/register)
only the PC hosting an iCloud source puts its data key
404no such iCloud source (also once it is removed)
no such iCloud source
curl
# answers 204; errors 400, 401, 403, 404
curl -sS -X PUT 'https://spacebackup.net/account/api/datakey' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"keyId":"dk-5c2e…","keyVersion":3,"wrapped":"<base64>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/datakey",
    method="PUT",
    data=json.dumps({"keyId": "dk-5c2e…", "keyVersion": 3, "wrapped": "<base64>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/datakey")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"keyId":"dk-5c2e…","keyVersion":3,"wrapped":"<base64>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/datakey");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"keyId":"dk-5c2e…","keyVersion":3,"wrapped":"<base64>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/datakeys#

The source devices whose keys the caller may ask for: devices of the caller's email (all of the company for owners and admins), not the caller itself, that have a stored copy.

GET /api/datakeys · from openapi.yaml (getDatakeys)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`removed` is `true` for a removed device (a lost one usually is) → array of DataKeySource {deviceId: string, name: string, email: string, keyId: string, removed: boolean}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/datakeys' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/datakeys",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/datakeys")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/datakeys");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/datakey-requests#

Asks to restore another device's backups. The device's own member and the owner and admins get a mail with Approve and Deny links and a restore-approval notification (target approval for the device's member, datakey-request for the admins).

A device of the caller's own email (since 2026-10-29): when the calling device holds the company key, the request is approved at once (decidedBy "auto: same member"), nothing is mailed or notified, and a row goes to the company's audit log; the answer's state is approved and GET /api/datakey-requests/{id} gives wrapped right away. Asking again for that source returns the same approved request.

POST /api/datakey-requests · from openapi.yaml (postDatakeyRequests)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DataKeyRequestCreate
sourceDevice string|null
200(`"approved"` for the caller's own device, above) → DataKeyRequestStarted {id: string, state: string}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no data key of that device to ask for (not one the caller may ask for, or no copy stored)
no data key of that device to ask for
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/datakey-requests' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"sourceDevice":"d_7pz4wn5cq2am3k9x"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/datakey-requests",
    method="POST",
    data=json.dumps({"sourceDevice": "d_7pz4wn5cq2am3k9x"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/datakey-requests")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"sourceDevice":"d_7pz4wn5cq2am3k9x"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/datakey-requests");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"sourceDevice":"d_7pz4wn5cq2am3k9x"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/datakey-requests/{id}#

GET /api/datakey-requests/{id} · from openapi.yaml (getDatakeyRequestsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`state` is `waiting`, `approved` or `denied`. `wrapped` and `former` (the source's older data keys) are *optional*: only when `approved`, and only to the requesting device. `keyId`/`keyVersion` are those of the source's current copy → DataKeyRequestView {id: string, state: string, sourceDevice: string, keyId: string, keyVersion: integer, wrapped?: string|null, former?: WrappedKeyView[]}
400Bad Request
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such data-key request (also when the caller may not see it)
no such data-key request
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/datakey-requests/dr_z3k7xq2ma9pw4n5c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/datakey-requests/dr_z3k7xq2ma9pw4n5c",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/datakey-requests/dr_z3k7xq2ma9pw4n5c")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/datakey-requests/dr_z3k7xq2ma9pw4n5c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/me/approvals#

Every request to restore a device of the caller's email, any state, newest first: what the iPhone app's Approvals screen and Restore requests on /account/me show. For an owner or admin it also holds the company's other members' requests (those they get a datakey-request notification for): every one that waits, and those decided in the last 30 days.

GET /api/me/approvals · from openapi.yaml (getMeApprovals)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`state` is `waiting`, `approved` or `denied` → array of ApprovalView {id: string, state: string, sourceDevice: string, sourceName: string, requester: string, requesterName: string|null, requestingDevice: string, created: string(date-time), canDecide: boolean, decidedBy: string|null, decided: string(date-time)|null, sourceEmail: string}
400Bad Request
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 400, 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/me/approvals' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/approvals",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/approvals")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me/approvals");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/me/approvals/{id}/approve, POST /api/me/approvals/{id}/deny#

The same decision as the mailed link, from any of the caller's signed-in devices, whatever their role: the device's member decides requests for their devices; an owner or admin also decides other members' requests (the same decision as on the admin page).

POST /api/me/approvals/{id}/approve · from openapi.yaml (postMeApprovalsIdApprove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not for them to decide (their own request from another device, not being an owner or admin; an owner's or admin's own request for another member's device);
not an active member of a company
404no such request to restore a device of yours (unknown, or another member's device and the caller is not an owner or admin);
no such request to restore a device of yours
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers 204; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/approve' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/approve",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/approve")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/approve");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/me/approvals/{id}/deny · from openapi.yaml (postMeApprovalsIdDeny)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not for them to decide (their own request from another device, not being an owner or admin; an owner's or admin's own request for another member's device);
not an active member of a company
404no such request to restore a device of yours (unknown, or another member's device and the caller is not an owner or admin);
no such request to restore a device of yours
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers 204; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/deny' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/deny",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/deny")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/me/approvals/dr_z3k7xq2ma9pw4n5c/deny");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Device state#

A phone keeps its backup catalog and choices with the account, so deleting the app, or a new phone given the same name, does not start over. The state is sealed on the phone with its own data key; the service never opens it. It is kept per company, member and device name (ignoring case), not per device id.

PUT /api/devices/state#

Note: When the device is renamed (devices/register with another name), its state moves to the new name. The state is deleted when the member is removed from the company; a removed device's state stays under its name.

PUT /api/devices/state · from openapi.yaml (putDevicesState)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeviceStatePut
sealed string|null
updated string|null
204No Content
400sealed is required, sealed must be base64, updated must be an ISO-8601 time. -
bad request: <message>
a JSON body is required
sealed is required
sealed must be base64
updated must be an ISO-8601 time
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
409{"error": "Another device with this name keeps its state here. Rename this device.", "code": "name_clash"}: another, still registered device of the same member wrote the state under this name. A removed device's state is taken over by the next PUT. -
413sealed is larger than 8 MB, request larger than 12 MB (sealed up to 8 MB). -
request larger than 12 MB (sealed up to 8 MB)
sealed is larger than 8 MB
415the body must be JSON (Content-Type: application/json)
the body must be JSON (Content-Type: application/json)
curl
# answers 204; errors 400, 401, 403, 409, 413, 415
curl -sS -X PUT 'https://spacebackup.net/account/api/devices/state' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"sealed":"<base64>","updated":"2026-10-18T09:12:00+02:00"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/state",
    method="PUT",
    data=json.dumps({"sealed": "<base64>", "updated": "2026-10-18T09:12:00+02:00"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 409, 413, 415
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/state")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"sealed":"<base64>","updated":"2026-10-18T09:12:00+02:00"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 409, 413, 415
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/devices/state");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"sealed":"<base64>","updated":"2026-10-18T09:12:00+02:00"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 409, 413, 415
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/devices/state#

GET /api/devices/state · from openapi.yaml (getDevicesState)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
querydevice string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200For the caller's company, member and device name → DeviceStateView {sealed: string, updated: string}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no state kept for this device; with device: no state kept for that device (also when the caller may not read it)
no state kept for this device
no state kept for that device
curl
# answers 200; errors 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/devices/state?device=d_4f2a7cqm3xk9wz2b' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/state?device=d_4f2a7cqm3xk9wz2b",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/state?device=d_4f2a7cqm3xk9wz2b")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/devices/state?device=d_4f2a7cqm3xk9wz2b");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Remote commands & PC status#

What the remote MCP server (AI agents, docs/mcp.md "Remote") needs from the PCs: an agent's backup_now waits as a command until the PC's next GET /api/sync lists it in commands (about a minute), the PC runs it through its own "Back up now" and answers; a PC reports a small plain status (times, counts, a result), never a file name, a path or a key.

POST /api/devices/commands/{id}#

The PC's answer to a command from sync.commands: started when its backup began, then done or failed when that run ended (or failed at once, with the reason). A late started after an end changes nothing.

POST /api/devices/commands/{id} · from openapi.yaml (postDevicesCommandsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json CommandAnswer
state string|null
message string|null
204No Content
400state must be started, done or failed
state must be started, done or failed
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the device answers its commands, this device is not registered (devices/register)
only the device answers its commands
not an active member of a company
this device is not registered (devices/register)
404no such command (another device's, or unknown)
no such command
curl
# answers 204; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/devices/commands/x_k3xq7m2pa9fz4w8r' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"state":"started","message":"backup started"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/commands/x_k3xq7m2pa9fz4w8r",
    method="POST",
    data=json.dumps({"state": "started", "message": "backup started"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/commands/x_k3xq7m2pa9fz4w8r")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"state":"started","message":"backup started"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/commands/x_k3xq7m2pa9fz4w8r");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"state":"started","message":"backup started"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/devices/status#

The calling PC's own status, replacing the last one. Sent when it changes, at least every 15 minutes and just after a run.

PUT /api/devices/status · from openapi.yaml (putDevicesStatus)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeviceStatusReport
running boolean|null
lastRunStarted string|null
lastRunEnded string|null
lastResult string|null
lastError string|null
lastFiles integer(int64)|null
lastBytes integer(int64)|null
nextRun string|null
folders integer|null
destinations integer|null
paused boolean|null
204No Content
400lastResult must be one of ok, errors, failed, cancelled, lastRunStarted must be an ISO-8601 time (and the other times), counts out of range
lastResult must be one of <runResults>
counts out of range
<name> must be an ISO-8601 time
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only a device reports its status, this device is not registered (devices/register)
only a device reports its status
not an active member of a company
this device is not registered (devices/register)
curl
# answers 204; errors 400, 401, 403
curl -sS -X PUT 'https://spacebackup.net/account/api/devices/status' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"running":false,"lastRunStarted":"2026-10-30T11:00:00Z","lastRunEnded":"2026-10-30T11:05:00Z","lastResult":"ok","lastError":null,"lastFiles":12,"lastBytes":3456,"nextRun":"2026-10-30T13:00:00Z","folders":2,"destinations":1,"paused":null}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/status",
    method="PUT",
    data=json.dumps({"running": False, "lastRunStarted": "2026-10-30T11:00:00Z", "lastRunEnded": "2026-10-30T11:05:00Z", "lastResult": "ok", "lastError": None, "lastFiles": 12, "lastBytes": 3456, "nextRun": "2026-10-30T13:00:00Z", "folders": 2, "destinations": 1, "paused": None}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/status")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"running":false,"lastRunStarted":"2026-10-30T11:00:00Z","lastRunEnded":"2026-10-30T11:05:00Z","lastResult":"ok","lastError":null,"lastFiles":12,"lastBytes":3456,"nextRun":"2026-10-30T13:00:00Z","folders":2,"destinations":1,"paused":null}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/devices/status");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"running":false,"lastRunStarted":"2026-10-30T11:00:00Z","lastRunEnded":"2026-10-30T11:05:00Z","lastResult":"ok","lastError":null,"lastFiles":12,"lastBytes":3456,"nextRun":"2026-10-30T13:00:00Z","folders":2,"destinations":1,"paused":null}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/devices/{id}/status#

One device as the agent's device_status shows it: the Device row, the PC's last status (null until it sent one), when a phone last saved its state (never the state), and its newest five requests.

GET /api/devices/{id}/status · from openapi.yaml (getDevicesIdStatus)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → DeviceStatusView {device: DeviceView, status: PcStatusView|null, phoneStateSaved?: string|null, requests: DeviceCommandView[]}
400Bad Request
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such device
no such device
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/status' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/status",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/status")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/status");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/{id}/backup-now#

Asks a PC to back up now (what the agent's backup_now does). One open request per PC: asked again while one waits (or the PC started it within the last minute), that one is answered. Not picked up within an hour, it reads expired.

POST /api/devices/{id}/backup-now · from openapi.yaml (postDevicesIdBackupNow)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200The request: {...} → DeviceCommandView {id: string, device: string, kind: string, requestedBy: string, requested: string(date-time), state: string, stateAt: string(date-time), message: string|null}
400Anna-iPhone is not a computer (iOS 26.5): a phone backs up from its own app
<name> is not a computer (<os>): a phone backs up from its own app
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the device's member or the company's owner or an admin may start its backup
only the device's member or the company's owner or an admin may start its backup
not an active member of a company
missing CSRF token
404no such device
no such device
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/backup-now' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/backup-now",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/backup-now")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/d_4f2a7cqm3xk9wz2b/backup-now");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Shares of a device's backups#

A share lets one colleague view and restore a copy of everything one device backed up, read-only. It is a standing approval: the recipient's devices get the source's wrapped data keys in sync (shared), and the PCs that store the backups serve them once the service confirms a peer ticket. See Sharing a device's backups.

POST /api/shares#

POST /api/shares · from openapi.yaml (postShares)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json ShareCreate
sourceDevice string|null
email string|null
200201 Share, or 200 with the existing share when it was shared already → ShareView {id: string, sourceDevice: string, sourceName: string, ownerEmail: string, recipientEmail: string, sharedBy: string, since: string(date-time), scope: string}
201Share, or 200 with the existing share when it was shared already → ShareView {id: string, sourceDevice: string, sourceName: string, ownerEmail: string, recipientEmail: string, sharedBy: string, since: string(date-time), scope: string}
400these backups are already bob@acme.com's (the recipient is the device's owner)
these backups are already <email>'s
<name> is required
<name> is too long
<name> must not contain control characters
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the device's owner or an admin can share its backups
only the device's owner or an admin can share its backups
you cannot share <name>'s backups with yourself: ask to restore them instead, which <email> or another owner or admin approves
not an active member of a company
404no such device, bob@acme.com is not a member of your company
no such device
<email> is not a member of your company
curl
# answers 200, 201; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/shares' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"sourceDevice":"d_4f2a7cqm3xk9wz2b","email":"bob@acme.com"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/shares",
    method="POST",
    data=json.dumps({"sourceDevice": "d_4f2a7cqm3xk9wz2b", "email": "bob@acme.com"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 201; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/shares")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"sourceDevice":"d_4f2a7cqm3xk9wz2b","email":"bob@acme.com"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 201; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/shares");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"sourceDevice":"d_4f2a7cqm3xk9wz2b","email":"bob@acme.com"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200, 201; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/shares#

Active shares the caller may see: of the devices with the caller's email; owners and admins: all of the company.

GET /api/shares · from openapi.yaml (getShares)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
querydevice string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Share]`, by device name and recipient → array of ShareView {id: string, sourceDevice: string, sourceName: string, ownerEmail: string, recipientEmail: string, sharedBy: string, since: string(date-time), scope: string}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/shares?device=d_4f2a7cqm3xk9wz2b' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/shares?device=d_4f2a7cqm3xk9wz2b",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/shares?device=d_4f2a7cqm3xk9wz2b")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/shares?device=d_4f2a7cqm3xk9wz2b");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/shares/with-me#

Active shares whose recipient is the caller.

GET /api/shares/with-me · from openapi.yaml (getSharesWithMe)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Share]` → array of ShareView {id: string, sourceDevice: string, sourceName: string, ownerEmail: string, recipientEmail: string, sharedBy: string, since: string(date-time), scope: string}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/shares/with-me' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/shares/with-me",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/shares/with-me")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/shares/with-me");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/shares/{id}/remove#

Stops a share. Backups that the recipient's devices could already read stay readable to them; new backups are not shared (the source makes a new data key at its next sync when the keys had been handed out).

POST /api/shares/{id}/remove · from openapi.yaml (postSharesIdRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when already removed)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such share (also for anyone not allowed)
no such share
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/shares/sh_m3k9xq2a7pz4wn5c/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/shares/sh_m3k9xq2a7pz4wn5c/remove",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/shares/sh_m3k9xq2a7pz4wn5c/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/shares/sh_m3k9xq2a7pz4wn5c/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Peer tickets#

A PC that stores other devices' backups (a host) serves another machine's folder to a device only after the service confirms a live share or an approved restore. The reader proves who it is with a ticket from the service, which it hands to the host over the encrypted peer channel; the host checks it here. The peer side is in API reference: the peer protocol.

POST /api/peer-tickets#

POST /api/peer-tickets · from openapi.yaml (postPeerTickets)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json PeerTicketCreate
sourceDevice string|null
200`reason`: `share` (an active share of that source to the caller's email) or `restore` (an approved restore request of the calling device for that source → PeerTicketView {ticket: string, sourceDevice: string, sourceName: string, reason: string, expires: string(date-time)}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member, or the device is not registered
not an active member of a company
this device is not registered (devices/register)
404no share or approved restore of that device for you
no share or approved restore of that device for you
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/peer-tickets' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"sourceDevice":"d_4f2a7cqm3xk9wz2b"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/peer-tickets",
    method="POST",
    data=json.dumps({"sourceDevice": "d_4f2a7cqm3xk9wz2b"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/peer-tickets")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"sourceDevice":"d_4f2a7cqm3xk9wz2b"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/peer-tickets");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"sourceDevice":"d_4f2a7cqm3xk9wz2b"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/peer-tickets/check#

A host asks whether a reader's ticket is good now (the share or approval is checked at every call, not only when the ticket was made).

POST /api/peer-tickets/check · from openapi.yaml (postPeerTicketsCheck)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json PeerTicketCheck
ticket string|null
200A host serves only when `requesterName` is the connection's peer name and `sourceName` the asked machine → PeerTicketCheckView {requesterDevice: string, requesterName: string, requesterEmail: string, sourceDevice: string, sourceName: string, reason: string, expires: string(date-time)}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no live share or approved restore for that ticket (unknown or expired ticket, the share ended, the restore no longer approved, the reader device or its member removed)
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/peer-tickets/check' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ticket":"pt_…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/peer-tickets/check",
    method="POST",
    data=json.dumps({"ticket": "pt_…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/peer-tickets/check")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ticket":"pt_…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/peer-tickets/check");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ticket":"pt_…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

TV app#

The TV app (Fire TV, Android TV; docs/tv.md) is a viewer that never types a password. It shows a pairing code (8 letters and digits without 0, O, 1, I, L; shown as ABCD-EFGH, typed in any case, with or without the dash) and a QR code for 10 minutes; the iPhone app (scanning the QR), a signed-in desktop app or the web page /tv approves it; the TV polls and gets its own token (tvt_…), listed with its member's TVs and removable. A TV is not a device of the company: no company key, no data key, nothing to back up. It views the photos through one of its member's own PCs: tv/pass gives each of them with a ticket, the key of the TLS certificate the PC serves it with, and a relay guest pass. Albums of another company the member is a guest of come from that company's PCs keeping them (guests in tv/pass): a guest ticket per PC and a relay guest pass for that company's group; such a PC shows the TV those albums only, read-only.

A TV's token opens only tv/me, tv/pass, tv/languages, tv/voice/wait, tv/changed/wait and tv/signout; any other route answers 403 a TV's token is for the TV routes only.

POST /api/tv/pair/start#

The TV asks for a pairing. No sign-in.

POST /api/tv/pair/start · from openapi.yaml (postTvPairStart)

Authnone
Bodyapplication/json TvPairStart
name string|null
model string|null
os string|null
version string|null
200The TV shows `code` and `url` in words and `link` as a QR code (the iPhone's Camera opens it in the Space Backup app → TvPairStarted {pairId: string, secret: string, code: string, url: string, qrUrl: string, expires: string(date-time), interval: integer, link: string}
400name is required;
name is required
bad request: <the JSON parser's message>
429too many pairings from this network; try again later (10 per IP address and 10 minutes, 30 per day)
too many pairings from this network; try again later
curl
# answers 200; errors 400, 429
curl -sS -X POST 'https://spacebackup.net/account/api/tv/pair/start' \
  -H "Content-Type: application/json" \
  --data '{"name":"Fire TV Stick","model":"AFTSSS","os":"Fire OS 8 (Android 11)","version":"tv-1.0.0"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pair/start",
    method="POST",
    data=json.dumps({"name": "Fire TV Stick", "model": "AFTSSS", "os": "Fire OS 8 (Android 11)", "version": "tv-1.0.0"}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pair/start")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Fire TV Stick","model":"AFTSSS","os":"Fire OS 8 (Android 11)","version":"tv-1.0.0"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/pair/start");
req.Content = new StringContent("""{"name":"Fire TV Stick","model":"AFTSSS","os":"Fire OS 8 (Android 11)","version":"tv-1.0.0"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/pair/poll#

The TV asks whether it was approved. No sign-in.

POST /api/tv/pair/poll · from openapi.yaml (postTvPairPoll)

Authnone
Bodyapplication/json TvPairPoll
pairId string|null
secret string|null
200Waiting: {...} → TvPairPolled {state: string, expires: string(date-time), token?: string|null, deviceId?: string|null, name?: string|null, email?: string|null, memberName?: string|null, company?: TvCompany|null}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be a string
bad request: <the JSON parser's message>
404no such pairing (unknown, or the wrong secret); 410 (with state) → the code expired; show a new one (expired);
no such pairing
410the pairing was declined (denied);
the pairing was declined
this pairing was already used
the code expired; show a new one
this TV was removed
curl
# answers 200; errors 400, 404, 410
curl -sS -X POST 'https://spacebackup.net/account/api/tv/pair/poll' \
  -H "Content-Type: application/json" \
  --data '{"pairId":"tvp_8w2kq4zx7m3c5n9a","secret":"q0Vh3c2v6b1Kx9yQ0d3t8w5r2z7n4m1p6s9u2f5h8j1"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pair/poll",
    method="POST",
    data=json.dumps({"pairId": "tvp_8w2kq4zx7m3c5n9a", "secret": "q0Vh3c2v6b1Kx9yQ0d3t8w5r2z7n4m1p6s9u2f5h8j1"}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 404, 410
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pair/poll")!)
req.httpMethod = "POST"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"pairId":"tvp_8w2kq4zx7m3c5n9a","secret":"q0Vh3c2v6b1Kx9yQ0d3t8w5r2z7n4m1p6s9u2f5h8j1"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 404, 410
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/pair/poll");
req.Content = new StringContent("""{"pairId":"tvp_8w2kq4zx7m3c5n9a","secret":"q0Vh3c2v6b1Kx9yQ0d3t8w5r2z7n4m1p6s9u2f5h8j1"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 404, 410
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/tv/pair/{code}#

What the approving screen shows before Approve: the TV's name and model, when it asked.

GET /api/tv/pair/{code} · from openapi.yaml (getTvPairCode)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathcode string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → TvPairInfo {code: string, name: string, model: string, os: string, version: string, created: string(date-time), expires: string(date-time)}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a TV cannot do this, not an active member of a company
not an active member of a company
a TV cannot do this
missing CSRF token
404no TV is showing that code; check it, or show a new one on the TV (unknown, expired, already approved or declined);
no TV is showing that code; check it, or show a new one on the TV
429too many wrong codes; wait a few minutes (10 wrong codes per member and 10 minutes, counting this route, approve and deny);
too many wrong codes; wait a few minutes
curl
# answers 200; errors 401, 403, 404, 429
curl -sS -X GET 'https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/pair/{code}/approve#

The TV becomes the caller's (their member, their company); its next poll gets its token.

POST /api/tv/pair/{code}/approve · from openapi.yaml (postTvPairCodeApprove)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathcode string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json TvPairApprove
name string|null
200The TV: `approvedVia`: `device` (an app's token) or `web` → TvView {id: string, name: string, model: string, os: string, version: string, email: string, created: string(date-time), lastSeen: string(date-time), approvedBy: string, approvedVia: string, removed: boolean}
400Bad Request
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a TV cannot do this, not an active member of a company
not an active member of a company
a TV cannot do this
missing CSRF token
404no TV is showing that code; check it, or show a new one on the TV;
no TV is showing that code; check it, or show a new one on the TV
429too many wrong codes; wait a few minutes;
too many wrong codes; wait a few minutes
curl
# answers 200; errors 400, 401, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/approve' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Living room TV"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/approve",
    method="POST",
    data=json.dumps({"name": "Living room TV"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/approve")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Living room TV"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/approve");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Living room TV"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/pair/{code}/deny#

The TV's next poll says declined.

POST /api/tv/pair/{code}/deny · from openapi.yaml (postTvPairCodeDeny)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathcode string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403a TV cannot do this, not an active member of a company
not an active member of a company
a TV cannot do this
missing CSRF token
404no TV is showing that code; check it, or show a new one on the TV;
no TV is showing that code; check it, or show a new one on the TV
429too many wrong codes; wait a few minutes;
too many wrong codes; wait a few minutes
curl
# answers 204; errors 401, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/deny' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/deny",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/deny")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/pair/x_k3xq7m2pa9fz4w8r/deny");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/tvs#

The caller's TVs; the owner and admins get the company's.

GET /api/tvs · from openapi.yaml (getTvs)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200A list of TVs as `POST tv/pair/{code}/approve` answers them (not removed ones) → array of TvView {id: string, name: string, model: string, os: string, version: string, email: string, created: string(date-time), lastSeen: string(date-time), approvedBy: string, approvedVia: string, removed: boolean}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
a TV cannot do this
missing CSRF token
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/tvs' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tvs",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tvs")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/tvs");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tvs/{id}/remove#

Disconnects a TV: its token stops at once, its tickets with it. Its member, the owner or an admin. No key is replaced (a TV never had one).

POST /api/tvs/{id}/remove · from openapi.yaml (postTvsIdRemove)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
a TV cannot do this
missing CSRF token
404no such TV
no such TV
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/tvs/x_k3xq7m2pa9fz4w8r/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tvs/x_k3xq7m2pa9fz4w8r/remove",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tvs/x_k3xq7m2pa9fz4w8r/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tvs/x_k3xq7m2pa9fz4w8r/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/tv/me#

The TV's own view of itself.

GET /api/tv/me · from openapi.yaml (getTvMe)

Authnone
200OK → TvMe {deviceId: string, name: string, email: string, active: boolean, company: TvCompany|null, memberName: string}
401this TV was removed; pair it again;
this TV was removed; pair it again
403only a TV's own token
only a TV's own token
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/tv/me'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/me",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/me")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/tv/me");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/pass#

The PCs the TV can view through, now: its member's own PCs (not phones) that registered a viewer key, most recently seen first, each with a ticket for 12 hours (the PC asks the service again every 5 minutes, so a removed TV stops at once); and a relay guest pass naming them (relay is null while the company's relay group is not known yet: then the LAN only). Asked again before expires.

POST /api/tv/pass · from openapi.yaml (postTvPass)

Authnone
200`email`, `memberName`: who the TV is signed in as now (the TV refreshes its Menu's "Signed in as" from them). `languages`: the member's languages (me/settings, up to 3) → TvPassView {expires: string(date-time), pcs: TvPcView[], relay: TvRelayView|null, email: string, memberName: string, languages: string[], guests: TvGuestCompanyView[]}
401this TV was removed; pair it again;
this TV was removed; pair it again
403not an active member of a company any more
not an active member of a company any more
this TV belongs to another company
only a TV's own token
curl
# answers 200; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/tv/pass'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/pass",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/pass")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/pass");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/tv/languages#

The TV's Menu → Language picker writes its member's languages (2026-11-05: the account's language wins, never the device's). The same as PUT /api/me/settings languages for the TV's member, and only that.

PUT /api/tv/languages · from openapi.yaml (putTvLanguages)

Authnone
Bodyapplication/json TvLanguagesRequest
languages string[]
200The member's languages as stored → TvLanguagesView {languages: string[]}
400languages is required, unknown language "ko" (one of en, fr, …), "ru" is given twice, at most 3 languages a member
languages is required
bad request: <the JSON parser's message>
401this TV was removed; pair it again
this TV was removed; pair it again
403only a TV's own token (a guest's, a phone's or a PC's token), not an active member of a company any more, this TV belongs to another company
not an active member of a company any more
this TV belongs to another company
only a TV's own token
curl
# answers 200; errors 400, 401, 403
curl -sS -X PUT 'https://spacebackup.net/account/api/tv/languages' \
  -H "Content-Type: application/json" \
  --data '{"languages":["de","ru"]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/languages",
    method="PUT",
    data=json.dumps({"languages": ["de", "ru"]}).encode(),
    headers={"Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/languages")!)
req.httpMethod = "PUT"
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"languages":["de","ru"]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/tv/languages");
req.Content = new StringContent("""{"languages":["de","ru"]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/signout#

The TV disconnects itself (its Sign out): as POST tvs/{id}/remove.

POST /api/tv/signout · from openapi.yaml (postTvSignout)

Authnone
204No Content
401Unauthorized
this TV was removed; pair it again
403Forbidden
only a TV's own token
curl
# answers 204; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/tv/signout'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/signout",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/signout")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/signout");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/viewer-key#

A PC registers its viewer key: the P-256 key of the self-signed TLS certificate it serves the TV app with (made once, kept with the PC's identity). Sent at each start; unchanged keys change nothing.

POST /api/devices/viewer-key · from openapi.yaml (postDevicesViewerKey)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json ViewerKeyRequest
publicKey string|null
204No Content
400publicKey must be a base64 P-256 SubjectPublicKeyInfo
publicKey must be a base64 P-256 SubjectPublicKeyInfo
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
curl
# answers 204; errors 400, 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/devices/viewer-key' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/viewer-key",
    method="POST",
    data=json.dumps({"publicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/viewer-key")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/viewer-key");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"publicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv-tickets/check#

A PC asks whether a TV's ticket lets it view through this PC now.

POST /api/tv-tickets/check · from openapi.yaml (postTvTicketsCheck)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json TvTicketCheck
ticket string|null
guests boolean|null
200`access`: `member` (the PC's own member's TV: it sees what that PC's Photos shows) → TvTicketCheckView {tvDevice: string, tvName: string, email: string, expires: string(date-time), access: string, albums?: TvGuestAlbumView[], company?: string|null}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no TV may view through this PC with that ticket (unknown or expired, made for another PC, the TV removed, its member no longer active or not this PC's member; a guest ticket: no album of this PC's company kept on this PC that the member is still a guest of)
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/tv-tickets/check' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ticket":"vt_Q2k8w3m7x1c9v4b6n2z5r8t1h3j7f0p"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv-tickets/check",
    method="POST",
    data=json.dumps({"ticket": "vt_Q2k8w3m7x1c9v4b6n2z5r8t1h3j7f0p"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv-tickets/check")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ticket":"vt_Q2k8w3m7x1c9v4b6n2z5r8t1h3j7f0p"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv-tickets/check");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ticket":"vt_Q2k8w3m7x1c9v4b6n2z5r8t1h3j7f0p"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/voice/wait#

What was said to the Alexa skill for this TV: a long poll the TV app keeps open while it is on the screen. The service holds the request up to 25 seconds and answers as soon as a sentence comes; the TV asks again at once. A newer wait of the same TV ends the older one (204). A TV that waited within the last 40 seconds counts as having Space Backup open; the most recent of the member's TVs gets the words. Sentences are kept in memory only, 10 seconds at most, never logged.

POST /api/tv/voice/wait · from openapi.yaml (postTvVoiceWait)

Authnone
200Or 204 when nothing came
204200 {...}, or 204 when nothing came
403for a TV's token only
for a TV's token only
curl
# answers 200, 204; errors 403
curl -sS -X POST 'https://spacebackup.net/account/api/tv/voice/wait'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/voice/wait",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 204; errors 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/voice/wait")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 204; errors 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/voice/wait");
using var res = await http.SendAsync(req);  // answers 200, 204; errors 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/tv/changed/wait#

The changed pushes for a TV: a Fire TV has no Google Play services, so FCM cannot reach it, and the TV app keeps this long poll open while it is on the screen instead. The service holds the request up to 25 seconds and answers as soon as something its member's devices are pushed changes (the same topics, coalesced the same way; forms excepted); the TV asks again at once and re-reads those parts (tv/pass, and its page's window.tvChanged(topics)). A newer wait of the same TV ends the older one (204). Changes are queued for a TV only while it listens (a wait open, or one ended within the last 40 seconds); a TV not open gets nothing and reads everything when it opens. Kept in memory only.

POST /api/tv/changed/wait · from openapi.yaml (postTvChangedWait)

Authnone
200(`v`: the #70 change counter per versioned topic, as in the push), or 204 when nothing changed
204200 {...} (`v`: the #70 change counter per versioned topic, as in the push), or 204 when nothing changed
401this TV was removed; pair it again
this TV was removed; pair it again
403for a TV's token only;
for a TV's token only
only a TV's own token
curl
# answers 200, 204; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/tv/changed/wait'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/tv/changed/wait",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 204; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/tv/changed/wait")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 204; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/tv/changed/wait");
using var res = await http.SendAsync(req);  // answers 200, 204; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Alexa skill#

"Alexa, show our Chicago 2026 photos in Space Backup" (docs/tv.md, "Alexa"): a custom Alexa skill whose endpoint is this service (no AWS Lambda). Account linking is the remote MCP's OAuth (Remote MCP) with the fixed client space-backup-alexa (settings alexa.clientId): a public client (PKCE S256 required, the secret Amazon sends not checked), or, when the service has SPACEBACKUP_ALEXA_CLIENT_SECRET in its environment, a confidential one (that secret checked at oauth/token, PKCE optional); the redirect URIs are Amazon's three for each vendor id in alexa.vendorIds (https://pitangui.amazon.com/api/skill/link/<vendor>, layla.amazon.com, alexa.amazon.co.jp); none configured: the client does not exist. The consent page is "Link Alexa to Space Backup?" with Link account (scope read); refresh tokens last a year. The skill's access token is refused by /account/mcp.

POST /alexa#

The skill's endpoint (the developer console's Endpoint, HTTPS, "a certificate from a trusted certificate authority"). Every request is checked as Amazon requires before anything else: SignatureCertChainUrl is https, host s3.amazonaws.com, port 443, a path under /echo.api/ once normalized; the chain there (kept 12 hours) is valid now, its leaf names echo-api.amazon.com and it leads to a trusted root; Signature-256 is the RSA SHA-256 signature of the body by that leaf; request.timestamp is within 150 seconds; the skill id is one of alexa.skillIds.

POST /alexa · from openapi.yaml (postAlexa)

Authnone
200Alexa's response envelope: `ShowIntent` sends "show <query>", `PlayIntent` "play <query>" to the member's TV that has Space Backup open (POST /api/tv/voice/wait) and waits up to 4 seconds for it to take the words
400not a request of this skill (not Amazon's, or not this skill's: the reason is in the service's log);
not a request of this skill
413the request is larger than 128 KB
the request is larger than 128 KB
curl
# answers 200; errors 400, 413
curl -sS -X POST 'https://spacebackup.net/account/alexa'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/alexa",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 413
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/alexa")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 413
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/alexa");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 413
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Albums#

An album is a plain copy of chosen photos and videos, kept on one or more destinations of the company's PCs that the owner picks. The service keeps the album's name, owner, members, drives and item count; the files are on the PCs. See Albums and Sharing albums.

Who sees an album: its owner, the members it is shared with, and the company's owner and admins. Anyone else gets 404.

POST /api/albums#

POST /api/albums · from openapi.yaml (postAlbums)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumCreate
name string|null
destinations AlbumDestinationSet[]
public boolean|null
200For a device's existing public album → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
201Album → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
400name is required, name is too long, at most 8 destinations per album
<name> is required
<name> is too long
<name> must not contain control characters
at most 8 destinations per album
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such device
no such device
curl
# answers 200, 201; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Las Vegas","destinations":[{"device":"d_4f2a7cqm3xk9wz2b","dest":"e3b0c442","label":"Backup disk"}]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums",
    method="POST",
    data=json.dumps({"name": "Las Vegas", "destinations": [{"device": "d_4f2a7cqm3xk9wz2b", "dest": "e3b0c442", "label": "Backup disk"}]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 201; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Las Vegas","destinations":[{"device":"d_4f2a7cqm3xk9wz2b","dest":"e3b0c442","label":"Backup disk"}]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 201; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Las Vegas","destinations":[{"device":"d_4f2a7cqm3xk9wz2b","dest":"e3b0c442","label":"Backup disk"}]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200, 201; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/albums#

Lists the caller's albums: their own, and the albums shared with them (shared with me).

GET /api/albums · from openapi.yaml (getAlbums)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[Album]`: the caller's own albums first, then those shared with them, by name → array of AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/albums' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/albums");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/albums/{id}#

GET /api/albums/{id} · from openapi.yaml (getAlbumsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Album → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such album
no such album
curl
# answers 200; errors 401, 403, 404
curl -sS -X GET 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}#

Changes an album. Every field is optional; a field left out stays.

POST /api/albums/{id} · from openapi.yaml (postAlbumsId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumUpdate
name string|null · rename (1–100 characters)
itemCount integer|null · the number of items now (0–10,000,000)
membersCanAdd boolean|null · the members may add their own photos and remove what they added. It sets everyone at once: each person's own setting (shares/can-add) is cleared, so all follow it
cover any · an item id of the album (up to 200 characters) as cover; `null` or `""` clears it (the newest item)
removed string[] · item ids just removed (with `itemCount`; at most 10,000): the cover among them is cleared, and their remove requests are done
faces boolean|null · recognise faces in the album's photos (on the company's PCs); may go with `name` and `membersCanAdd` in the same request
200Album → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
400itemCount out of range, too many removed ids, cover too long, cover must be an item id or null, the Shared publicly album keeps its name
itemCount out of range
too many removed ids
the <publicAlbumName> album keeps its name
<name> is required
<name> is too long
<name> must not contain control characters
cover too long
cover must be an item id or null
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner can change it (members and admins too)
not an active member of a company
only the album's owner can change it
404no such album
no such album
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"membersCanAdd":true,"cover":"2026-10-14/IMG_0412.HEIC"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c",
    method="POST",
    data=json.dumps({"membersCanAdd": True, "cover": "2026-10-14/IMG_0412.HEIC"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"membersCanAdd":true,"cover":"2026-10-14/IMG_0412.HEIC"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"membersCanAdd":true,"cover":"2026-10-14/IMG_0412.HEIC"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/destinations#

Replaces the list of drives the album is kept on. The phone then asks a PC holding the album to copy it to the new drives.

POST /api/albums/{id}/destinations · from openapi.yaml (postAlbumsIdDestinations)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumDestinationsRequest
destinations AlbumDestinationSet[]
200Album → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
400at most 8 destinations per album
at most 8 destinations per album
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be a string
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not the owner
only the album's owner can change it
not an active member of a company
404no such album, no such device
no such album
no such device
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/destinations' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"destinations":[{"device":null,"dest":null,"label":null}]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/destinations",
    method="POST",
    data=json.dumps({"destinations": [{"device": None, "dest": None, "label": None}]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/destinations")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"destinations":[{"device":null,"dest":null,"label":null}]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/destinations");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"destinations":[{"device":null,"dest":null,"label":null}]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/delete#

Deletes the album, kept 30 days in Recently deleted (GET /api/albums/deleted): it leaves every list (the owner's, its members' and guests', the sync's albums), its tickets and pending album-add pushes go, open remove requests are resolved, whole-album public links stop serving and open invitations are hidden. Its members and guests (with their own settings), invitations, name, cover, settings, filter, drives and links are kept for restore. After 30 days the service ends it for good (as purge). The PCs move their copies to their drives' deleted area (peer request album.delete, sent by the owner's device).

POST /api/albums/{id}/delete · from openapi.yaml (postAlbumsIdDelete)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can delete it
only the album's owner or an admin can delete it
not an active member of a company
404no such album
no such album
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/delete' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/delete",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/delete")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/delete");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/albums/deleted#

Recently deleted: the caller's own albums deleted in the last 30 days, and those they deleted as an admin, newest first.

GET /api/albums/deleted · from openapi.yaml (getAlbumsDeleted)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → array of AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/albums/deleted' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/deleted",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/deleted")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/albums/deleted");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/restore#

Put back: a recently deleted album returns exactly as it was: its members and guests with their own canAdd and shown, open invitations, name, cover, membersCanAdd, faces, filter, drives and public links. The owner's, members' and guests' devices get changed: ["albums", "album:<id>"], invitees' ["invitations"]. Remove requests resolved by the delete do not come back. The apps then send album.restore to the album's PCs.

POST /api/albums/{id}/restore · from openapi.yaml (postAlbumsIdRestore)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such deleted album (not deleted, deleted more than 30 days ago, deleted permanently, unknown)
no such deleted album
409that device has a new Shared publicly album since (a device's public album, when it made a new one)
that device has a new <publicAlbumName> album since
curl
# answers 200; errors 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/restore' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/restore",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/restore")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/restore");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/purge#

Delete permanently: a live or a recently deleted album ends for good at once (it cannot be put back). Its members, guests and drives go, open invitations are withdrawn, whole-album public links revoked. A relay ticket of it still answers deleted: true, so a PC's waiting delete job runs.

POST /api/albums/{id}/purge · from openapi.yaml (postAlbumsIdPurge)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204No Content
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can delete it
only the album's owner or an admin can delete it
not an active member of a company
404no such album, no such deleted album
no such album
no such deleted album
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/purge' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/purge",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/purge")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/purge");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/archive#

Archives the album for its owner: it leaves the album list on all of the owner's devices and is listed under Albums › Archived (archived in the owner's Album and the sync's Album briefs). Everything else stays: its items, drives, members (to whom it is an ordinary album), tickets and links. The owner's devices get changed: ["albums", "album:<id>"].

POST /api/albums/{id}/archive · from openapi.yaml (postAlbumsIdArchive)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner can archive it
only the album's owner can archive it
not an active member of a company
404no such album
no such album
curl
# answers 200; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/archive' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/archive",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/archive")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/archive");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/unarchive#

Unarchive: the album is back in the owner's album list (archived absent).

POST /api/albums/{id}/unarchive · from openapi.yaml (postAlbumsIdUnarchive)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner can archive it
only the album's owner can archive it
not an active member of a company
404no such album
no such album
curl
# answers 200; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/unarchive' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/unarchive",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/unarchive")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/unarchive");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/merge#

Merges two of the caller's albums (Vladimir, 2026-11-08; docs/albums.md "Merging two albums"): a new album of the caller's, unshared, with the first album's cover and faces setting, the first album's drives then the second's (at most 8) and mergedFrom [first, second]; both albums are archived. One transaction. The service holds no items: the app then sends the peer request album.merge to a PC holding both albums, which copies every item of the first and the second into the new album, duplicates once. Undo: unarchive both, then delete the new one. The caller's devices get `changed: ["albums", "album:<first>", "album:<second>"]`.

POST /api/albums/merge · from openapi.yaml (postAlbumsMerge)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumMergeRequest
albums string|null[]
name string|null
destinations AlbumDestinationSet[]
201The new Album, then the two merged ones as they are now → AlbumMergeView {album: AlbumView, archived: AlbumView[]}
400merge two different albums, the Shared publicly album cannot be merged, name …, at most 8 destinations per album
merge two different albums
the <publicAlbumName> album cannot be merged
<name> is required
<name> is too long
<name> must not contain control characters
at most 8 destinations per album
<name> must be a string
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only albums you own can be merged
only albums you own can be merged
not an active member of a company
404no such album, no such device
no such album
no such device
curl
# answers 201; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/merge' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"albums":["al_x7k2mq9pa4zw3n5c"],"name":"Chicago trip","destinations":[{"device":null,"dest":null,"label":null}]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/merge",
    method="POST",
    data=json.dumps({"albums": ["al_x7k2mq9pa4zw3n5c"], "name": "Chicago trip", "destinations": [{"device": None, "dest": None, "label": None}]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 201; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/merge")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"albums":["al_x7k2mq9pa4zw3n5c"],"name":"Chicago trip","destinations":[{"device":null,"dest":null,"label":null}]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 201; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/merge");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"albums":["al_x7k2mq9pa4zw3n5c"],"name":"Chicago trip","destinations":[{"device":null,"dest":null,"label":null}]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 201; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/shares#

Shares the album with people.

POST /api/albums/{id}/shares · from openapi.yaml (postAlbumsIdShares)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumShareRequest
email string|null
emails string[]
200When everyone had it already (or an invitation was open: pending or declined → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
201Album when anyone was added or invited → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
400the album is already anna@acme.com's, emails must not be empty, too many emails (at most 100), not a valid email address
emails must not be empty
too many emails (at most 100)
the album is already <email>'s
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can share it
only the album's owner or an admin can share it
not an active member of a company
404no such album, bob@acme.com is not a member of your company (invite them to the company first)
<email> is not a member of your company (invite them to the company first)
no such album
429too many invitations today (at most 200 a day)
too many invitations today (at most 200 a day)
curl
# answers 200, 201; errors 400, 401, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"email":"bob@acme.com"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares",
    method="POST",
    data=json.dumps({"email": "bob@acme.com"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 201; errors 400, 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"bob@acme.com"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 201; errors 400, 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"email":"bob@acme.com"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200, 201; errors 400, 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/shares/remove#

Stops sharing with one person, withdraws an invitation (pending or declined), or removes a guest. A member may remove themselves (leaving the album). It takes effect on the PCs within 5 minutes.

POST /api/albums/{id}/shares/remove · from openapi.yaml (postAlbumsIdSharesRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumShareRequest
email string|null
emails string[]
204(also when not shared)
400Bad Request
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can stop sharing it
only the album's owner or an admin can stop sharing it
not an active member of a company
404no such album
no such album
curl
# answers 204; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"email":"bob@acme.com"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/remove",
    method="POST",
    data=json.dumps({"email": "bob@acme.com"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"bob@acme.com"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"email":"bob@acme.com"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/show#

Turns an album shared with the caller off or back on, for them alone (Vladimir 2026-10-31). Off: the apps keep it out of Photos, Recent and Albums lists and download or cache nothing of it, and the service sends no album-add push (nor inbox entry) for it; the caller stays a member (or guest), the owner sees them in members with shown: false, and their tickets work as before. On: back as it was. This is not leaving the album (shares/remove with their own email, or guest leave).

The album's owner hides their own album the same way (iOS request #85): shown: false in their own album lists, on all their devices, and no album-add push (nor inbox entry) for them; it stays theirs (mine: true), and its sharing, members, tickets and backups are untouched: the people it is shared with see no difference.

POST /api/albums/{id}/show · from openapi.yaml (postAlbumsIdShow)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumShowRequest
on boolean|null
204(also when it already was)
400on is required (true or false)
on is required (true or false)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
404no such album (also not shared with the caller, or deleted)
no such album
curl
# answers 204; errors 400, 401, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/show' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"on":false}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/show",
    method="POST",
    data=json.dumps({"on": False}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/show")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"on":false}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/show");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"on":false}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/shares/can-add#

Lets one person the album is shared with add their own photos and videos (and remove what they added), or stops them. Their setting overrides the album's membersCanAdd until the album-wide switch is set again (POST /api/albums/{id} with membersCanAdd, which clears everyone's own setting). Someone with no setting of their own follows the album. Their tickets follow at the next check (within the PCs' 5-minute cache): member-add or member, and a relay ticket for their adds stops serving when it is turned off.

POST /api/albums/{id}/shares/can-add · from openapi.yaml (postAlbumsIdSharesCanAdd)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumCanAddRequest
email string|null
canAdd boolean|null
204No Content
400canAdd is required (true or false), not a valid email address, a guest of the album cannot add to it
canAdd is required (true or false)
a guest of the album cannot add to it
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can say who may add to it
only the album's owner or an admin can say who may add to it
not an active member of a company
404no such album, not shared with them (also the owner's own email)
not shared with them
no such album
curl
# answers 204; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/can-add' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"email":"bob@acme.com","canAdd":true}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/can-add",
    method="POST",
    data=json.dumps({"email": "bob@acme.com", "canAdd": True}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/can-add")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"bob@acme.com","canAdd":true}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/shares/can-add");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"email":"bob@acme.com","canAdd":true}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/added#

Tells the service that this device just added photos or videos to the album, so the others hear of it. Call it after a successful add.

POST /api/albums/{id}/added · from openapi.yaml (postAlbumsIdAdded)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumAddedRequest
count integer|null
job string|null
204No Content
400count is required, count must be 1 to 1000000, job is at most 64 characters
count is required
count must be 1 to 1000000
job is at most 64 characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner can add to it (its owner has not let members add)
only the album's owner can add to it (its owner has not let members add)
not an active member of a company
this device is not registered (devices/register)
404no such album
no such album
curl
# answers 204; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/added' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"count":12,"job":"job_3f9c2a71d04b8e65"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/added",
    method="POST",
    data=json.dumps({"count": 12, "job": "job_3f9c2a71d04b8e65"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/added")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"count":12,"job":"job_3f9c2a71d04b8e65"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/added");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"count":12,"job":"job_3f9c2a71d04b8e65"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/jobs/accept#

A PC accepted a detached album.add or album.clone (detach: true, iOS request #63): it binds the job to the device that sent it, so that when the job ends it can alert that device's member (POST albums/{id}/jobs/done) with the phone gone. The PC calls it as the job starts, off the request.

POST /api/albums/{id}/jobs/accept · from openapi.yaml (postAlbumsIdJobsAccept)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumJobAcceptRequest
ticket string|null
job string|null
op string|null
200`device`: the device that sent the job (the ticket's) → AlbumJobAcceptView {job: string, device: string, album: string, until: string(date-time)}
400job is required, op is required, op is add or clone, ticket is required
op is add or clone
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403that device may not add to this album
that device may not add to this album
not an active member of a company
this device is not registered (devices/register)
404no such album for that ticket (expired, another album's, or not a device's own album ticket) (a guest's, link's, filter's or assistant job's ticket too)
409this job is bound already
this job is bound already
curl
# answers 200; errors 400, 401, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/accept' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ticket":"at_…","job":"job_3f9c2a71d04b8e65","op":"add"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/accept",
    method="POST",
    data=json.dumps({"ticket": "at_…", "job": "job_3f9c2a71d04b8e65", "op": "add"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/accept")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ticket":"at_…","job":"job_3f9c2a71d04b8e65","op":"add"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/accept");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ticket":"at_…","job":"job_3f9c2a71d04b8e65","op":"add"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/jobs/done#

A PC's detached add or clone of the album ended (iOS request #63): the member whose device sent it gets one alert, the album's people re-read the album, and what was added goes to them as that device's POST albums/{id}/added would.

POST /api/albums/{id}/jobs/done · from openapi.yaml (postAlbumsIdJobsDone)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumJobDoneRequest
job string|null
ticket string|null
added integer|null
already integer|null
failed integer|null
kind string|null
error string|null
200OK → AlbumJobDoneView {title: string, body: string, notification: integer(int64), counted: boolean}
400job is required
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403no album job of this PC bound to that ticket (albums/{id}/jobs/accept; for the job's 24 hours) (not bound, another PC's, another ticket or album, ended already, or the 24 hours over)
not an active member of a company
this device is not registered (devices/register)
404no such album (deleted while the job ran)
no such album (deleted while the job ran)
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/done' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"job":"job_3f9c2a71d04b8e65","ticket":"at_…","added":23,"already":0,"failed":0,"kind":"photos","error":"The album drive CHIA2 G: is not connected"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/done",
    method="POST",
    data=json.dumps({"job": "job_3f9c2a71d04b8e65", "ticket": "at_…", "added": 23, "already": 0, "failed": 0, "kind": "photos", "error": "The album drive CHIA2 G: is not connected"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/done")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"job":"job_3f9c2a71d04b8e65","ticket":"at_…","added":23,"already":0,"failed":0,"kind":"photos","error":"The album drive CHIA2 G: is not connected"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/jobs/done");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"job":"job_3f9c2a71d04b8e65","ticket":"at_…","added":23,"already":0,"failed":0,"kind":"photos","error":"The album drive CHIA2 G: is not connected"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/remove-requests#

A member asks the album's owner to remove a photo that is not theirs.

POST /api/albums/{id}/remove-requests · from openapi.yaml (postAlbumsIdRemoveRequests)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumRemoveRequest
item string|null
source string|null
200With the same body when this person had asked for this item already (nothing new) → AlbumRemoveRequestView {album: string, item: string}
201Created → AlbumRemoveRequestView {album: string, item: string}
400item is required, source too long
source too long
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
404no such album (also for the owner, guests, admins who are not members)
no such album
429too many remove requests today (at most 50 a day)
too many remove requests today (at most 50 a day)
curl
# answers 200, 201; errors 400, 401, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/remove-requests' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"item":"2026-10-14/IMG_0412.HEIC","source":"Bobs-iPhone"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/remove-requests",
    method="POST",
    data=json.dumps({"item": "2026-10-14/IMG_0412.HEIC", "source": "Bobs-iPhone"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 201; errors 400, 401, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/remove-requests")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"item":"2026-10-14/IMG_0412.HEIC","source":"Bobs-iPhone"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 201; errors 400, 401, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/remove-requests");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"item":"2026-10-14/IMG_0412.HEIC","source":"Bobs-iPhone"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200, 201; errors 400, 401, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/filter#

Sets the album's standing filter, or stops it.

The morning push. One alert per member each morning, at 08:00 in their own time zone (the latest one their devices sent, X-SpaceBackup-TimeZone; UTC when none did), of what the filters of their albums (theirs, and those shared with them) added since the last one: kind album-auto-added, title "New in your albums", body "Night Chicago Views: 5 new · Chicago Trips: 2 new" (the owner's also says "3 could not be added: only in encrypted backups"), target {"type": "album", "id"} for one album, else {"type": "albums"}. Nothing when nothing was added. In the inbox like every kind; kinds["album-auto-added"] in me/notifications turns the push off.

POST /api/albums/{id}/filter · from openapi.yaml (postAlbumsIdFilter)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumFilterRequest
filter any
200The Album with its `filter` → AlbumView {id: string, name: string, ownerEmail: string, mine: boolean, created: string(date-time), updated: string(date-time), itemCount: integer, destinations: AlbumDestinationView[], members: AlbumMemberView[], ownerName?: string|null, membersCanAdd: boolean, faces: boolean, cover: string|null, filter: AlbumFilter|null, invited: AlbumInvitedView[], shown: boolean, public?: boolean, publicDevice?: string|null, archived?: string(date-time)|null, mergedFrom?: string[], deletedAt?: string(date-time)|null, deletedBy?: string|null, deletedByName?: string|null, purgeAt?: string(date-time)|null}
400filter is required (null stops it), filter.kind must be all, photos or videos, filter.timeFrom and filter.timeTo go together, filter.night and filter.day exclude each other, filter.timeFrom and timeTo are minutes after midnight (0-1440), filter.place needs lat (-90 to 90) and lon (-180 to 180), filter.place.radiusKm must be above 0 (at most 20000), filter.machines must name the devices whose new items are judged, filter.machines: at most 20, filter.words is too long (at most 500)
filter is required (null stops it)
filter must be an object or null
filter: <message>
filter.<name> is too long (at most <max>)
filter.kind must be all, photos or videos
filter.timeFrom and filter.timeTo go together
filter.night and filter.day exclude each other
filter.timeFrom and timeTo are minutes after midnight (0-1440)
filter.place needs lat (-90 to 90) and lon (-180 to 180)
filter.place.radiusKm must be above 0 (at most 20000)
filter.machines: a name is too long
filter.machines: at most 20
filter.machines must name the devices whose new items are judged
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the album's owner or an admin can set its filter
only the album's owner or an admin can set its filter
not an active member of a company
404no such album
no such album
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/filter' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"filter":null}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/filter",
    method="POST",
    data=json.dumps({"filter": None}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/filter")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"filter":null}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/filter");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"filter":null}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/auto#

A PC asks which albums to fill from one device's backups, after a vision pass over that device's new items.

POST /api/albums/auto · from openapi.yaml (postAlbumsAuto)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumAutoRequest
machine string|null
200Only active filters naming the machine, and only when it is one of the album owner's own devices. `added` and `removed` are the album's record: items its filter added, and items taken out of the album since (by the owner, or a PC reporting the remove with POST albums/{id} `removed`) → AlbumAutoList {machine: string, albums: AlbumAutoView[]}
400machine is required
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be a string
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
curl
# answers 200; errors 400, 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/albums/auto' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"machine":"Vlads-iPhone"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/auto",
    method="POST",
    data=json.dumps({"machine": "Vlads-iPhone"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/auto")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"machine":"Vlads-iPhone"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/auto");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"machine":"Vlads-iPhone"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/{id}/auto-added#

The PC says what it added for the album's filter.

POST /api/albums/{id}/auto-added · from openapi.yaml (postAlbumsIdAutoAdded)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumAutoAdded
machine string|null
added string[]
encrypted integer|null
200(`already`: recorded before, by this or another PC) → AlbumAutoAddedView {album: string, added: integer, already: integer, encrypted: integer}
400machine is required, at most 10000 ids at a time
at most 10000 ids at a time
encrypted out of range
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such album with an active filter for that machine
no such album with an active filter for that machine
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/auto-added' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"machine":"Vlads-iPhone","added":["A1B2C3","A7B8C9"],"encrypted":2}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/auto-added",
    method="POST",
    data=json.dumps({"machine": "Vlads-iPhone", "added": ["A1B2C3", "A7B8C9"], "encrypted": 2}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/auto-added")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"machine":"Vlads-iPhone","added":["A1B2C3","A7B8C9"],"encrypted":2}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/auto-added");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"machine":"Vlads-iPhone","added":["A1B2C3","A7B8C9"],"encrypted":2}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/assistant/jobs/ticket#

The phone takes a ticket for one assistant job before it sends assistant.job to a PC: without it no PC can make an album for it (POST assistant/jobs/album) or alert its member about the job (POST assistant/jobs/done).

POST /api/assistant/jobs/ticket · from openapi.yaml (postAssistantJobsTicket)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AssistantTicketRequest
pc string|null
action string|null
device string|null
200OK → AssistantTicketView {ticket: string, expires: string(date-time)}
400pc is required, action is required, action is show, makeAlbum or shareAlbum, pc is another device than the phone
action is show, makeAlbum or shareAlbum
device is too long
pc is another device than the phone
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403this device is not registered (devices/register), a job ticket for another device is taken only for a device of your own (device of another member)
a job ticket for another device is taken only for a device of your own
not an active member of a company
this device is not registered (devices/register)
404no such device (pc or device not of the phone's company, or removed)
no such device
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/assistant/jobs/ticket' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"pc":"d_4hq8xw2mz7rk3n9p","action":"shareAlbum"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/assistant/jobs/ticket",
    method="POST",
    data=json.dumps({"pc": "d_4hq8xw2mz7rk3n9p", "action": "shareAlbum"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/assistant/jobs/ticket")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"pc":"d_4hq8xw2mz7rk3n9p","action":"shareAlbum"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/assistant/jobs/ticket");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"pc":"d_4hq8xw2mz7rk3n9p","action":"shareAlbum"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/assistant/jobs/redeem#

The PC accepts a phone's assistant job: it redeems the phone's job ticket before it answers assistant.job, so a ticket that is no good refuses the job at once instead of failing it late (a job queued behind another, or a long selection, no longer outlasts its ticket).

POST /api/assistant/jobs/redeem · from openapi.yaml (postAssistantJobsRedeem)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AssistantRedeemRequest
jobTicket string|null
job string|null
200OK → AssistantRedeemView {job: string, device: string, action: string, until: string(date-time)}
400job is required
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403no valid job ticket from a phone for this PC (assistant/jobs/ticket; 15 minutes, redeemed once) (missing, unknown, for another PC, redeemed already, or expired; the ticket stays as it was)
not an active member of a company
this device is not registered (devices/register)
404no such device, the device's member is not active (the phone)
no such device
the device's member is not active
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/assistant/jobs/redeem' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"jobTicket":"jt_…","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/assistant/jobs/redeem",
    method="POST",
    data=json.dumps({"jobTicket": "jt_…", "job": "aj_3f9a1c07b2e4d5c6a7b8c9d0"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/assistant/jobs/redeem")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"jobTicket":"jt_…","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/assistant/jobs/redeem");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"jobTicket":"jt_…","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/assistant/jobs/album#

The PC running a phone's assistant job (iOS request #61; peer op assistant.job) makes the album the job asked for, owned by the member of that phone. When the member already has an album of their own of that name (trimmed, in any case), the job fills that one instead, as the phone does: its name stays as it is, its own standing filter stays (the job's is set only when it has none), and the calling PC is added to its drives when it is not one. An album of that name someone else shared with the member is never filled this way; a public album neither.

POST /api/assistant/jobs/album · from openapi.yaml (postAssistantJobsAlbum)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AssistantAlbumRequest
device string|null
job string|null
name string|null
dest string|null
label string|null
filter any
share string[]
jobTicket string|null
201`ticket`: access `filter` for this PC and the phone's items only (`filterMachines: [the phone]`), an hour → AssistantAlbumView {album: string, name: string, ticket: string, expires: string(date-time), filter: boolean, shared: string[], invited: boolean, shareError?: string|null, existing?: boolean|null}
400name is required, dest is required, device is required, job is required, a filter's error, too many emails to share with (at most 100)
too many emails to share with (at most 100)
<name> is required
<name> is too long
<name> must not contain control characters
filter must be an object or null
filter: <message>
filter.<name> is too long (at most <max>)
filter.kind must be all, photos or videos
filter.timeFrom and filter.timeTo go together
filter.night and filter.day exclude each other
filter.timeFrom and timeTo are minutes after midnight (0-1440)
filter.place needs lat (-90 to 90) and lon (-180 to 180)
filter.place.radiusKm must be above 0 (at most 20000)
filter.machines: a name is too long
filter.machines: at most 20
filter.machines must name the devices whose new items are judged
<name> must be a string
emails must not be empty
too many emails (at most 100)
the album is already <email>'s
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403no job ticket bound to this job of that phone on this PC (assistant/jobs/redeem; for the job's 24 hours) (missing, not redeemed, bound to another job, PC or phone, or the 24 hours over), the job's ticket is for show: it makes no album, this job has made its album already
the job's ticket is for show: it makes no album
this job has made its album already
not an active member of a company
this device is not registered (devices/register)
only the album's owner or an admin can share it
404no such device (not of the caller's company, or removed), the device's member is not active
no such device
the device's member is not active
<email> is not a member of your company (invite them to the company first)
no such album
409the album "<name>" has 8 drives already, none on this PC (the member's own album of that name, which this PC cannot be added to)
the album "<name>" has 8 drives already, none on this PC
429too many invitations today (at most 200 a day) (the share's invitations to people outside the company, as [POST albums/{id}/shares](#post-api-albums-id-shares))
too many invitations today (at most 200 a day)
curl
# answers 201; errors 400, 401, 403, 404, 409, 429
curl -sS -X POST 'https://spacebackup.net/account/api/assistant/jobs/album' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0","jobTicket":"jt_…","name":"Night Chicago Views","dest":"e3b0c442","label":"E:\\","filter":{"words":"Make an album of my night Chicago views","content":"view","night":true,"kind":"photos"},"share":["anna@acme.com"]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/assistant/jobs/album",
    method="POST",
    data=json.dumps({"device": "d_7k2mq9pa4zw3n5cx", "job": "aj_3f9a1c07b2e4d5c6a7b8c9d0", "jobTicket": "jt_…", "name": "Night Chicago Views", "dest": "e3b0c442", "label": "E:\\", "filter": {"words": "Make an album of my night Chicago views", "content": "view", "night": True, "kind": "photos"}, "share": ["anna@acme.com"]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 201; errors 400, 401, 403, 404, 409, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/assistant/jobs/album")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0","jobTicket":"jt_…","name":"Night Chicago Views","dest":"e3b0c442","label":"E:\\","filter":{"words":"Make an album of my night Chicago views","content":"view","night":true,"kind":"photos"},"share":["anna@acme.com"]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 201; errors 400, 401, 403, 404, 409, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/assistant/jobs/album");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_3f9a1c07b2e4d5c6a7b8c9d0","jobTicket":"jt_…","name":"Night Chicago Views","dest":"e3b0c442","label":"E:\\","filter":{"words":"Make an album of my night Chicago views","content":"view","night":true,"kind":"photos"},"share":["anna@acme.com"]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 201; errors 400, 401, 403, 404, 409, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/assistant/jobs/done#

The PC finished an assistant job: the phone's member gets one alert, and their devices re-read the album.

POST /api/assistant/jobs/done · from openapi.yaml (postAssistantJobsDone)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AssistantDoneRequest
device string|null
job string|null
album string|null
added integer|null
found integer|null
needsPhone integer|null
kind string|null
failed boolean|null
jobTicket string|null
200OK → AssistantDoneView {title: string, body: string, notification: integer(int64)}
400job is required, device is required
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403no job ticket bound to this job of that phone on this PC (assistant/jobs/redeem; for the job's 24 hours)
not an active member of a company
this device is not registered (devices/register)
404no such device, no such album of that device's member on this PC (the album is not the job's or the member's, or the caller is not one of its drives)
no such album of that device's member on this PC
no such device
the device's member is not active
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/assistant/jobs/done' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_…","jobTicket":"jt_…","album":"al_…","added":23,"found":25,"needsPhone":2,"kind":"photos","failed":false}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/assistant/jobs/done",
    method="POST",
    data=json.dumps({"device": "d_7k2mq9pa4zw3n5cx", "job": "aj_…", "jobTicket": "jt_…", "album": "al_…", "added": 23, "found": 25, "needsPhone": 2, "kind": "photos", "failed": False}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/assistant/jobs/done")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_…","jobTicket":"jt_…","album":"al_…","added":23,"found":25,"needsPhone":2,"kind":"photos","failed":false}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/assistant/jobs/done");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"device":"d_7k2mq9pa4zw3n5cx","job":"aj_…","jobTicket":"jt_…","album":"al_…","added":23,"found":25,"needsPhone":2,"kind":"photos","failed":false}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Album tickets#

A device reads or changes an album on a PC by handing it an album ticket over the peer channel; the PC checks it here. Access is worked out at every check, so an unshare or a deleted album stops being served within the PCs' 5-minute cache.

POST /api/albums/{id}/tickets#

POST /api/albums/{id}/tickets · from openapi.yaml (postAlbumsIdTickets)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`access`: `owner`, `member` (read-only) or `member-add` (a member who may add: their own `canAdd`, else the album's `membersCanAdd`) → AlbumTicketView {ticket: string, album: string, name: string, access: string, expires: string(date-time)}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such album
no such album
curl
# answers 200; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/tickets' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/tickets",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/tickets")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/al_x7k2mq9pa4zw3n5c/tickets");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/album-tickets/check#

A PC asks what an album ticket allows now.

POST /api/album-tickets/check · from openapi.yaml (postAlbumTicketsCheck)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumTicketCheck
ticket string|null
200| `access` | Meaning | |---|---| | `owner` | the album's owner | | `member` | a member, read-only | | `member-add` | a member who may add → AlbumTicketCheckView {requesterDevice: string, requesterName: string, requesterEmail: string, album: string, albumName: string, ownerEmail: string, access: string, destinations: AlbumDestinationView[], expires: string(date-time), requesterKey?: string|null, deleted: boolean, member?: string|null, filterMachines?: string[], memberDevices?: string[], link?: LinkScopeView|null, public?: boolean, publicDevice?: string|null, faces: boolean}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be a string
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such album for that ticket (expired, the album deleted or no longer shared) (also when the requester device or its member was removed); for a link ticket no such link for that ticket (revoked or expired)
no such link for that ticket (revoked or expired)
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/album-tickets/check' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ticket":"at_…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/album-tickets/check",
    method="POST",
    data=json.dumps({"ticket": "at_…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/album-tickets/check")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ticket":"at_…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/album-tickets/check");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ticket":"at_…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/album-tickets/relay#

A source PC exchanges a good ticket for a relay ticket bound to itself, valid 30 days, to finish transfer jobs to album drives that are offline. Renew it by sending the relay ticket itself.

POST /api/album-tickets/relay · from openapi.yaml (postAlbumTicketsRelay)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AlbumTicketCheck
ticket string|null
200OK → AlbumTicketView {ticket: string, album: string, name: string, access: string, expires: string(date-time)}
400Bad Request
<name> is required
<name> is too long
<name> must not contain control characters
<name> must be a string
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register)
404no such album for that ticket (expired, the album deleted, or not the owner's) (also a guest's ticket, a plain member ticket, or another PC's relay ticket)
curl
# answers 200; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/album-tickets/relay' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ticket":"at_…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/album-tickets/relay",
    method="POST",
    data=json.dumps({"ticket": "at_…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/album-tickets/relay")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ticket":"at_…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/album-tickets/relay");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ticket":"at_…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Invitations & guests#

Sharing an album with someone outside the company sends them an invitation; once they accept they are a guest of that album: they may view it and save copies, nothing else. A guest may be in another company or in none. A member of the company who turned off autoAcceptCompany gets an invitation too, and is a plain member once they accept. See Guests and Invitations from outside the company.

GET /api/albums/invitations#

The caller's open invitations: pending first, then declined, each newest first.

GET /api/albums/invitations · from openapi.yaml (getAlbumsInvitations)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`state`: `pending` or `declined`. `fromName`, `company` and `decided` (when declined) are *optional*. `sameCompany` (*optional*, `true`): from the caller's own company (they turned off `autoAcceptCompany`) → array of InvitationView {id: string, album: string, albumName: string, fromEmail: string, created: string(date-time), state: string, fromName?: string|null, company?: string|null, sameCompany?: boolean, decided?: string(date-time)|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/albums/invitations' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/invitations",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/invitations")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/albums/invitations");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/invitations/{id}/accept#

POST /api/albums/invitations/{id}/accept · from openapi.yaml (postAlbumsInvitationsIdAccept)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json InvitationAnswer
trustSender boolean|null
204No Content
400Bad Request
<name> must be a string
<name> is too long
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
404no such invitation (accepted already, withdrawn, or the album was deleted) (also another person's)
no such invitation (accepted already, withdrawn, or the album was deleted)
curl
# answers 204; errors 400, 401, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/accept' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"trustSender":true}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/accept",
    method="POST",
    data=json.dumps({"trustSender": True}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/accept")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"trustSender":true}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/accept");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"trustSender":true}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/albums/invitations/{id}/decline#

POST /api/albums/invitations/{id}/decline · from openapi.yaml (postAlbumsInvitationsIdDecline)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204The invitation is `declined`, still listed for the caller (who may accept it later) and in the album's `invited` for the owner
400Bad Request
<name> must be a string
<name> is too long
401Unauthorized
not signed in
not signed in (token unknown or revoked)
404no such invitation (accepted already, withdrawn, or the album was deleted) (also another person's)
no such invitation (accepted already, withdrawn, or the album was deleted)
curl
# answers 204; errors 400, 401, 404
curl -sS -X POST 'https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/decline' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/decline",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/decline")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/albums/invitations/inv_c4n7zq2m9xa3kw5p/decline");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/me/trusted-senders#

GET /api/me/trusted-senders · from openapi.yaml (getMeTrustedSenders)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`[{"email": "anna@acme.com", "since": "2026-10-17T10:05:00.000+00:00", "name": "Anna Smith"}]` (`name` *optional*) → array of TrustedSenderView {email: string, since: string(date-time), name?: string|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/me/trusted-senders' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/trusted-senders",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/trusted-senders")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me/trusted-senders");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/me/trusted-senders/remove#

POST /api/me/trusted-senders/remove · from openapi.yaml (postMeTrustedSendersRemove)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json TrustedSenderRequest
email string|null
204(also when not trusted)
400not a valid email address
not a valid email address
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 204; errors 400, 401
curl -sS -X POST 'https://spacebackup.net/account/api/me/trusted-senders/remove' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"email":"anna@acme.com"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/trusted-senders/remove",
    method="POST",
    data=json.dumps({"email": "anna@acme.com"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/trusted-senders/remove")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"email":"anna@acme.com"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/me/trusted-senders/remove");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"email":"anna@acme.com"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/guest/devices/register#

Registers the device of someone in no company, so it can read albums it is a guest of. (A device in a company uses POST /api/devices/register and needs nothing else.)

POST /api/guest/devices/register · from openapi.yaml (postGuestDevicesRegister)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json GuestDeviceRequest
name string|null
publicKey string|null
200OK → GuestDeviceRegistered {deviceId: string}
400name must be a machine name: …, publicKey must be a base64 P-256 SubjectPublicKeyInfo
name must be a machine name: 1-64 ASCII letters, digits, '-', '_' or '.'
publicKey must be a base64 P-256 SubjectPublicKeyInfo
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only a device's own session registers it
only a device's own session registers it
409you are in a company: register the device there (devices/register)
you are in a company: register the device there (devices/register)
curl
# answers 200; errors 400, 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/guest/devices/register' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"name":"Carols-iPhone","publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/guest/devices/register",
    method="POST",
    data=json.dumps({"name": "Carols-iPhone", "publicKey": "<base64 P-256 SubjectPublicKeyInfo>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/guest/devices/register")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"name":"Carols-iPhone","publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/guest/devices/register");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"name":"Carols-iPhone","publicKey":"<base64 P-256 SubjectPublicKeyInfo>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/guest/pass#

Everything a guest's device needs to reach the albums it is a guest of: per album a ticket and the album's PCs with their public keys, and per company a relay pass for Space Relay. Valid 1 hour; ask again when less than 10 minutes are left, or after a refusal.

POST /api/guest/pass · from openapi.yaml (postGuestPass)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`shown: false`: the guest turned it off (show) → GuestPassView {expires: string(date-time), companies: GuestCompanyView[], albums: GuestAlbumView[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403this device is not registered (devices/register, or guest/devices/register outside a company)
this device is not registered (devices/register, or guest/devices/register outside a company)
curl
# answers 200; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/guest/pass' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/guest/pass",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/guest/pass")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/guest/pass");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/guest/albums/{id}/leave#

POST /api/guest/albums/{id}/leave · from openapi.yaml (postGuestAlbumsIdLeave)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when not a guest of it)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 204; errors 401
curl -sS -X POST 'https://spacebackup.net/account/api/guest/albums/al_x7k2mq9pa4zw3n5c/leave' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/guest/albums/al_x7k2mq9pa4zw3n5c/leave",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/guest/albums/al_x7k2mq9pa4zw3n5c/leave")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/guest/albums/al_x7k2mq9pa4zw3n5c/leave");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Notifications & push#

Every event the service tells someone about is kept in their inbox for 90 days and pushed to their phones unless they turned that kind off. The desktop apps read the inbox and long-poll it. See Notification history and Notification settings.

kindSent toAbouttarget.type
album-addedeveryone in the album but the adderphotos or videos added (one unread entry per album and adder, its count summed)album
sharedthe recipientan album or a device's backups shared with you, or stopped; an album invitationalbum, share, device, invitation
key-waitingowners/adminsa device has waited 2 minutes for the company key (read for all once resolved)key-release
device-joinedowners/adminsa new device joined (not your own)device
restore-approvalowners/adminsa restore asks for a data key (read for all once decided)datakey-request
relay-creditowners/adminsrelay credit low (below 10 % of the last pack, auto top-up off) or used uprelay
invitation-acceptedthe invitera company or album invitation was acceptedmember, album
remove-requestthe album's ownera member asks to remove a photo (read once the item leaves the album)album-item
album-auto-addedeveryone in an album its filter added to (owner and members)the morning summary, once a day at 08:00 their time (filters)album, albums
assistant-jobthe member whose phone sent an assistant jobthe job finished on a PC: "Night Chicago Views" / "23 photos added", or "Found 25 photos" (assistant jobs)album, assistant-job

An inbox is per email: in the caller's company, plus entries that belong to no company (a guest's).

GET /api/notifications#

The history, newest first.

GET /api/notifications · from openapi.yaml (getNotifications)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
querybefore integer(int64)|null (optional)
querylimit integer|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Notification list → NotificationList {notifications: NotificationView[], unread: integer, latest: integer(int64), update?: UpdateNews|null}
400limit must be 1 to 200
limit must be 1 to 200
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 400, 401
curl -sS -X GET 'https://spacebackup.net/account/api/notifications?before=120&limit=50' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/notifications?before=120&limit=50",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/notifications?before=120&limit=50")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/notifications?before=120&limit=50");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/notifications/read#

POST /api/notifications/read · from openapi.yaml (postNotificationsRead)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json NotificationsReadRequest
ids integer(int64)[]
all boolean|null
200OK → NotificationsUnread {unread: integer}
400ids or all is required, at most 1000 ids at a time
ids or all is required
at most 1000 ids at a time
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 400, 401
curl -sS -X POST 'https://spacebackup.net/account/api/notifications/read' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"ids":[1842,1839]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/notifications/read",
    method="POST",
    data=json.dumps({"ids": [1842, 1839]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/notifications/read")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"ids":[1842,1839]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/notifications/read");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"ids":[1842,1839]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/notifications/wait#

The long-poll: answers as soon as there is a notification newer than after.

curl -s "https://spacebackup.net/account/api/notifications/wait?after=1842&timeout=55" \
  -H "Authorization: Bearer $TOKEN" -H "X-SpaceBackup-Version: 1.8.2"

GET /api/notifications/wait · from openapi.yaml (getNotificationsWait)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryafter integer(int64)|null (optional)
querytimeout number|null (optional)
queryupdate integer(int64)|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Notification list with the notifications newer than `after`, oldest first (up to 200), as soon as there is one → NotificationList {notifications: NotificationView[], unread: integer, latest: integer(int64), update?: UpdateNews|null}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/notifications/wait?after=41&timeout=25&update=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/notifications/wait?after=41&timeout=25&update=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/notifications/wait?after=41&timeout=25&update=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/notifications/wait?after=41&timeout=25&update=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/me/notifications#

Which kinds are pushed and popped up (the history keeps everything).

GET /api/me/notifications · from openapi.yaml (getMeNotifications)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200All kinds default to on. `albumAdds` is the same setting as `kinds["album-added"]` → NotificationsView {albumAdds: boolean, kinds: map<string,boolean>}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/me/notifications' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/notifications",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/notifications")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me/notifications");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/me/notifications#

PUT /api/me/notifications · from openapi.yaml (putMeNotifications)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json NotificationsRequest
albumAdds boolean|null
kinds map<string,boolean>
200The same shape as GET → NotificationsView {albumAdds: boolean, kinds: map<string,boolean>}
400albumAdds or kinds is required, unknown notification kind x (one of album-added, shared, …), albumAdds and kinds["album-added"] disagree
albumAdds and kinds["album-added"] disagree
albumAdds or kinds is required
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 400, 401
curl -sS -X PUT 'https://spacebackup.net/account/api/me/notifications' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"albumAdds":false,"kinds":{"device-joined":false}}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/notifications",
    method="PUT",
    data=json.dumps({"albumAdds": False, "kinds": {"device-joined": False}}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/notifications")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"albumAdds":false,"kinds":{"device-joined":false}}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/me/notifications");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"albumAdds":false,"kinds":{"device-joined":false}}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/me/settings#

The member's own settings (Vladimir 2026-10-31).

GET /api/me/settings · from openapi.yaml (getMeSettings)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200`autoAcceptCompany` (default `true`): Automatically accept albums shared by people in my company → MeSettingsView {autoAcceptCompany: boolean, languages: string[], companyLanguages: string[], selectAllSkipsWork: boolean}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
curl
# answers 200; errors 401
curl -sS -X GET 'https://spacebackup.net/account/api/me/settings' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/settings",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/settings")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/me/settings");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/me/settings#

PUT /api/me/settings · from openapi.yaml (putMeSettings)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json MeSettingsRequest
autoAcceptCompany boolean|null
languages string[]
selectAllSkipsWork boolean|null
200The same shape as GET → MeSettingsView {autoAcceptCompany: boolean, languages: string[], companyLanguages: string[], selectAllSkipsWork: boolean}
400unknown language "ko" (one of en, fr, …), "ru" is given twice, at most 3 languages a member
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only an active member of a company has these settings
only an active member of a company has these settings
curl
# answers 200; errors 400, 401, 403
curl -sS -X PUT 'https://spacebackup.net/account/api/me/settings' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"autoAcceptCompany":false,"languages":["ru","en"],"selectAllSkipsWork":true}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/me/settings",
    method="PUT",
    data=json.dumps({"autoAcceptCompany": False, "languages": ["ru", "en"], "selectAllSkipsWork": True}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/me/settings")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"autoAcceptCompany":false,"languages":["ru","en"],"selectAllSkipsWork":true}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/me/settings");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"autoAcceptCompany":false,"languages":["ru","en"],"selectAllSkipsWork":true}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

PUT /api/devices/push#

Sets the calling device's push token: an iPhone's or iPad's Apple push (APNs) token, or an Android phone's Firebase Cloud Messaging (FCM) registration token.

PUT /api/devices/push · from openapi.yaml (putDevicesPush)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json PushTokenRequest
token string|null
env string|null
app string|null
tz string|null
provider string|null
204No Content
400token must be the APNs device token in hex, env must be sandbox or production, app must be the app's bundle id, provider must be apns or fcm, token must be the FCM registration token (URL-safe text, at most 4096 characters)
token must be the FCM registration token (URL-safe text, at most 4096 characters)
token must be the APNs device token in hex
env must be sandbox or production
provider must be apns or fcm
app must be the app's bundle id
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
this device is not registered (devices/register, or guest/devices/register outside a company)
this device is not registered (devices/register)
curl
# answers 204; errors 400, 401, 403
curl -sS -X PUT 'https://spacebackup.net/account/api/devices/push' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"token":"<hex APNs device token>","env":"production","app":"net.spacebackup.ios","tz":"America/Chicago"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/push",
    method="PUT",
    data=json.dumps({"token": "<hex APNs device token>", "env": "production", "app": "net.spacebackup.ios", "tz": "America/Chicago"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/push")!)
req.httpMethod = "PUT"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"token":"<hex APNs device token>","env":"production","app":"net.spacebackup.ios","tz":"America/Chicago"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Put, "https://spacebackup.net/account/api/devices/push");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"token":"<hex APNs device token>","env":"production","app":"net.spacebackup.ios","tz":"America/Chicago"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Push payloads#

What a phone receives (APNs, apns-push-type: alert):

EventPayloadCollapse id
photos added to an album{"aps": {"alert": {"title": "Las Vegas", "body": "Bob Jones added 12 photos and videos"}, "sound": "default", "thread-id": "album-al_…"}, "album": "al_…"} (one: "added 1 photo or video"; at most one per album per 5 minutes)album-<id>
an album shared with you{"aps": {"alert": {"title": "Las Vegas", "body": "Anna Smith shared an album with you"}, "sound": "default"}, "album": "al_…"}album-<id>
an album invitation{"aps": {"alert": {"title": "Las Vegas", "body": "Anna Smith invited you to a shared album"}, "sound": "default"}, "invite": "inv_…", "album": "al_…"}invite-<id>
every other kind{"aps": {"alert": {"title", "body"}, "sound": "default"}, "notification": 1842, "kind": "key-waiting", "target": {"type": "key-release", "id": "kq_…"}}<type>-<id>

The name in a body is the person's display name, else their email.

Android (FCM) gets the same pushes, to the same people with the same coalescing and opt-outs, as FCM HTTP v1 **data messages** (no notification part: the app builds the notification and its tap target itself). Every value is a string: title, body, kind (album-added, shared for a share or an invitation, else the notification's kind), and the payload's other keys as they are (album, invite, notification; target as its JSON, {"type":"key-release","id":"kq_…"}). Alerts go with "android": {"priority": "high", "collapse_key": "<the collapse id above>"}, for example `{"message": {"token": "…", "data": {"kind": "album-added", "title": "Las Vegas", "body": "Bob Jones added 12 photos and videos", "album": "al_…"}, "android": {"priority": "high", "collapse_key": "album-al_…"}}}`. A changed push (below) is {"data": {"changed": "albums,album:al_…"}, "android": {"priority": "normal"}} (the topics comma-separated; v as its JSON when it has one).

Changed pushes#

Besides the alerts, every change a phone shows sends a silent background push (iOS request #56) to each device of each member concerned, so an open app re-reads that part at once:

{"aps": {"content-available": 1}, "changed": ["albums", "album:al_…"]}

It goes with apns-push-type: background and apns-priority: 5, no alert, sound or badge, and holds topics only: never a name, a title, an email or a count. The device that made the change is left out; only devices with a push token get one. A TV (a Fire TV has no FCM) gets the same topics of its member, forms excepted, on its long poll tv/changed/wait while it is open, never a push: "to the member" below means the member's listening TVs too (a PC's backups/vision for a device: that device's member's TVs). A PC (no push token either) gets them the same way on devices/changed/wait while its window is open, and its window re-reads that part at once.

TopicWhenTo
albumsan album made, renamed, deleted; its cover, destinations, who may add; shared, unshared, left, turned off or on by a member; an invitation to it made, answered or withdrawn; a public link to the whole album made, changed or revokedthe owner and every member (a guest on all their devices)
album:<id>items added (albums/{id}/added), the item count or removed items reported, the cover, who may add; a remove request (to the owner)the owner and the members
sharesa device's backups shared or stopped; a member removed (their shares end)the recipient, the device's member, whoever shared or stopped it; everyone in the company for a removal
shares (2026-11-03)a single device removed: the shares of its backups endeveryone its backups were shared with, and the device's member
shares (2026-11-03)a restore request decided (approved, denied, or released at once to the same member's device; me/approvals, the admin page, a mailed link)the requester's devices (the requesting one too), the source device's member and the owners/admins
invitationsan album invitation made, accepted, declined, withdrawn, or its album deletedthe invitee
groupsthe member's groups made, changed, deleted (Coworkers hidden or shown)the member
devicesa device joined, renamed, labelled, removed, got the company key (first ack, or a key release approved)owners/admins and the device's member
devices (2026-11-03)a member's name set (by them or an admin), a join approved, a member removed, the company's name or Recognize faces changedevery device of every active member of the company
devices (2026-11-03)a member's role changed or join denied; a TV paired, removed or signed out; an iCloud source added or removedowners/admins and that member
devices (2026-11-03)a key handed to a device that waits for it (devices/deliver)that device
devices (2026-11-03)the company key set or rotated (company/key); a device's signing key replaced (devices/{id}/signing-key, a new key only)every device of every active member of the company
backupsa date of this device became complete on a PC (the PC reports it: POST /api/devices/changed)that device
visiona vision pass over this device's items finished (the PC reports it)that device
formsa PC asks this phone for another form on one of its drives (Encrypt… / Don't encrypt…; the PC reports it, the phone reads forms)that device
backups:<device>items of that device's backups moved to Deleted or Archived, put back, or deleted for good (the PC reports it with its v)every device of that device's member and of everyone its backups are shared with
facesthe member's people book changed: a name given, a merge, split, move, reject, hide, delete or stranger, from a phone, the PC's window or CLI (the PC where it was made reports it; a book taken from another PC is not reported again; iOS request #84)the member's other devices: of from's member, else of the PC's member; the device that made it and the PC left out
faces (2026-11-03)the company's face names on the service: a new name, its spelling, its member or its other names (POST faces/names; one more use of a name: none), a name or all of them forgotten (DELETE faces/names)every device of every active member of the company
computers (2026-11-03)a PC's setup others read: a backed-up folder added or removed, its frequency, destinations, retention or encryption (folders add/remove/set, Backed-up folders…); an iCloud source added, removed or set (icloud add/remove/set); a Google Drive account added, removed, moved or set (gdrive add/remove/move/set); a setting others read (settings set max-backups, frequency, night-window, incoming, name-first, scrub, rearrange-wait-days, dead-run-hours, album-put-max-gb). The PC reports it with company: true; re-read that PC's folders, sources and keep countevery device of every active member of the company
destinationsa destination of a PC added, removed or changed (LAN path, drive kind), or another PC's destination forgotten on one (the PC reports it with company: true); re-read destinations, copy counts and storageevery device of every active member of the company
notificationsthe inbox changed with no alert: read on another device, resolved, a quiet kind, an album add (its alert is coalesced)the member
picturesa member's own picture set or removed (PUT /api/me/picture, DELETE; requests #125); re-read GET /api/people (and GET /api/me) and the pictures whose version changedevery device of every active member of the company (in no company: the member's other devices)
languages (2026-11-05)the company's languages changed: a member picked, changed or cleared their languages and the union (company.languages) is another; re-read GET /api/me/settings (companyLanguages) or the sessionevery device of every active member of the company
work (2026-11-08)a member marked items work or not work (POST /api/work/marks, changed > 0); re-read GET /api/work/marks?since=<the v held>every device of every active member of the company, the marking device too
links (2026-11-08)a public link to items (kind item or selection) made, its end changed (PATCH) or revoked; re-read GET /api/links (Settings › Public links, About's Create public link)the link's maker's devices, and the caller's own other devices when an owner/admin changed someone else's link; the device that made the change left out
settingsthe member's own settings (me/settings: autoAcceptCompany, languages, selectAllSkipsWork), notification settings (me/notifications), trusted senders or own birth (PUT /api/me) changed on another of their devices or the web pagethe member

Coalescing: a topic goes to a device at once, then at most once every 10 seconds (push.changedSeconds); a topic a PC reports with topics (backups, vision, forms) at most once every 5 minutes (push.changedPcSeconds); faces, a person's own change, keeps the 10 seconds. Changes meanwhile go in one push at the end of the window, each topic once. Different topics do not hold each other up. At most 20 topics go in one push (more go in the next).

Change counters (#70): when a PC reports a batch of changes to one part (backups:<device>, or an album's items as album:<id>) with its counter, the push also carries v, the part's new counter at that PC, and still no item id:

{"aps": {"content-available": 1}, "changed": ["album:al_…"], "v": {"album:al_…": "pc_7f3a:42"}}

The device asks that PC for the changes since the counter it holds (album.changes / backups.changes, over the relay); the ids travel only between devices and PCs. A newer counter queued before the push goes replaces the older; a change of the same topic without a counter (made on the service) drops it, and the device reads the part as before.

POST /api/devices/changed#

A PC reports what it finished for a device, so that device's app updates at once (a changed push, above).

POST /api/devices/changed · from openapi.yaml (postDevicesChanged)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeviceChangedRequest
topics string[]
device string|null
topic string|null
v string|null
from string|null
company boolean|null
204Also when push is off (nothing is kept then)
400topics is required, unknown topic x (one of backups, vision, forms, faces, destinations, computers), from goes with the topic faces alone, company goes with the topics faces, destinations, computers alone, destinations goes with company: true (or computers …), v is required as "<pc>:<n>", unknown topic x (backups:<device> or album:<id>)
topics is required
device too long
from too long
from goes with the topic faces alone
<only> goes with company: true
v is required as "<pc>:<n>"
unknown topic <topic> (backups:<device> or album:<id>)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only a device reports its changes
not an active member of a company
this device is not registered (devices/register)
404no such album (unknown, deleted, or of another company)
no such device
no such album
429too many change reports (at most 30 a minute) (per calling device, push.changedCallsPerMinute)
too many change reports (at most <changedCallsPerMinute> a minute)
curl
# answers 204; errors 400, 401, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/devices/changed' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"topics":["backups"],"device":"d_…"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/changed",
    method="POST",
    data=json.dumps({"topics": ["backups"], "device": "d_…"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/changed")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"topics":["backups"],"device":"d_…"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/changed");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"topics":["backups"],"device":"d_…"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/changed/wait#

The changed pushes for a PC: a computer has no APNs or FCM token, so while its Space Backup window is open (the window's own long poll on the PC, GET /api/changed/wait; the desktop app) the PC keeps this long poll open, as an open TV keeps tv/changed/wait. The service holds the request up to 25 seconds and answers as soon as something its member's devices are pushed changes (the same topics, coalesced the same way; forms excepted); the changes this PC made or reported itself are left out (it knows them). The PC asks again at once and its window re-reads those parts. A newer wait of the same device ends the older (204). Changes are queued for a PC only while it listens (a wait open, or one ended within the last 40 seconds); a PC whose window is closed gets nothing, and the window reads everything when it opens. Kept in memory only.

POST /api/devices/changed/wait · from openapi.yaml (postDevicesChangedWait)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200Or 204 when nothing changed
204200 {...}, or 204 when nothing changed
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403for a device's token only;
for a device's token only
this device is not registered (devices/register)
curl
# answers 200, 204; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/devices/changed/wait' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/changed/wait",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200, 204; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/changed/wait")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200, 204; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/changed/wait");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200, 204; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/devices/notify#

A PC says that one of its drives a device backs up to is nearly full (nearly full drives): the device's member gets one alert, in the inbox and as an APNs push to their devices.

POST /api/devices/notify · from openapi.yaml (postDevicesNotify)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json DeviceNotifyRequest
device string|null
kind string|null
drive string|null
freeBytes integer(int64)|null
totalBytes integer(int64)|null
text string|null
open string[]
204No Content
400unknown kind x (one of drive-nearly-full, vision-coverage, vision-attention, vision-open), device is required, drive is required
unknown kind <kind> (one of <driveNearlyFull>, <visionCoverage>, <visionAttention>, <visionOpenKind>)
device is required
drive is required
drive (the host PC) is required
text is required
drive (the finding's key) is required
open (the findings that still stand) is required
<name> must be a string
<name> is too long
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
only a device reports its drives
not an active member of a company
only a device reports its coverage
this device is not registered (devices/register)
only a device reports what its photo analysis needs
404no such device (unknown, removed, or of another company)
no such device
429too many change reports (at most 30 a minute) (shared with devices/changed)
too many change reports (at most <changedCallsPerMinute> a minute)
curl
# answers 204; errors 400, 401, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/api/devices/notify' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"device":"d_…","kind":"drive-nearly-full","drive":"mars-001 /home/space","freeBytes":65485598720,"totalBytes":2000398934016,"text":"Space Backup: mars-001 /home/space is nearly full (61 GB left). New backups go to your other drives until space is freed."}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/devices/notify",
    method="POST",
    data=json.dumps({"device": "d_…", "kind": "drive-nearly-full", "drive": "mars-001 /home/space", "freeBytes": 65485598720, "totalBytes": 2000398934016, "text": "Space Backup: mars-001 /home/space is nearly full (61 GB left). New backups go to your other drives until space is freed."}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/devices/notify")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"device":"d_…","kind":"drive-nearly-full","drive":"mars-001 /home/space","freeBytes":65485598720,"totalBytes":2000398934016,"text":"Space Backup: mars-001 /home/space is nearly full (61 GB left). New backups go to your other drives until space is freed."}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/devices/notify");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"device":"d_…","kind":"drive-nearly-full","drive":"mars-001 /home/space","freeBytes":65485598720,"totalBytes":2000398934016,"text":"Space Backup: mars-001 /home/space is nearly full (61 GB left). New backups go to your other drives until space is freed."}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Space Relay billing#

Space Relay carries traffic between a company's devices when they cannot reach each other directly. Each company gets 5 GB free per calendar month (UTC; relayed in + out; 1 GB = 10^9 bytes), then uses prepaid packs that never expire: sb_pack_500 (500 GB, $9), sb_pack_2000 (2 TB, $25), sb_pack_5000 (5 TB, $49). Optional auto top-up buys the chosen pack again when the balance drops below 10 % of it. What people see: Billing.

POST /api/relay/group#

Links the device's relay group to the caller's company, so its relayed bytes are counted to the company. The group id is derived from the company key (only a holder of the key knows it). The apps call it after sign-in and whenever the company key changes.

POST /api/relay/group · from openapi.yaml (postRelayGroup)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json RelayGroupRequest
groupId string|null
204(also when it was linked already)
400groupId must be 64 lower-case hex digits
groupId must be 64 lower-case hex digits
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
409this relay group belongs to another company
this relay group belongs to another company
curl
# answers 204; errors 400, 401, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/api/relay/group' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"groupId":"<64 lower-case hex digits>"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/relay/group",
    method="POST",
    data=json.dumps({"groupId": "<64 lower-case hex digits>"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/relay/group")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"groupId":"<64 lower-case hex digits>"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/relay/group");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"groupId":"<64 lower-case hex digits>"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/relay/balance#

GET /api/relay/balance · from openapi.yaml (getRelayBalance)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200| Field | Meaning | |---|---| | `month` | the current month, `YYYY-MM` (UTC) | | `freeBytes` | the free allowance per month → RelayBalanceView {month: string, freeBytes: integer(int64)|null, freeUsedBytes: integer(int64), prepaidBytes: integer(int64), activationNeeded: boolean, autoTopUp: boolean, autoTopUpPack: string|null, paymentsEnabled: boolean, prepaidTotalBytes: integer(int64), lowBytes: integer(int64), packs: PackView[], usedBytes: integer(int64), unlimitedUntil: string|null, usageLine: string}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/relay/balance' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/relay/balance",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/relay/balance")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/relay/balance");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/relay/buy-link#

A one-time link that opens the buy screen in a browser, already signed in as the device's user.

POST /api/relay/buy-link · from openapi.yaml (postRelayBuyLink)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → BuyLinkView {url: string, expiresAt: string(date-time)}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
curl
# answers 200; errors 401, 403
curl -sS -X POST 'https://spacebackup.net/account/api/relay/buy-link' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/relay/buy-link",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/relay/buy-link")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/relay/buy-link");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /internal/relay/report#

The relay's usage report. Only the relay running on the same server calls it (it is not reachable through the public web server); integrators never do. Listed for completeness.

POST /internal/relay/report · from openapi.yaml (postInternalRelayReport)

AuthX-SpaceRelay-Signature header (HMAC of the body with the relay secret; only from spacerelay on the same machine)
Bodyapplication/json RelayReport
id string|null
month string|null
usage RelayUsageDelta[]
groups string[]
200The state of the linked groups only: `remainingBytes` = free bytes left + balance → RelayReportAnswer {groups: map<string,RelayGroupState>}
400bad JSON: …, empty report, and the checks of the report's content (month must be YYYY-MM, too many groups, bytes must not be negative; these three come back as an HTML error page, since the route is not under /api)
month must be YYYY-MM
too many groups
bytes must not be negative
<name> is required
<name> is too long
<name> must not contain control characters
empty report
401bad signature
bad signature
404the call came through the public web server
not found
503relay secret not set up (spaceaccount init)
relay secret not set up (spaceaccount init)
curl
# answers 200; errors 400, 401, 404, 503
curl -sS -X POST 'https://spacebackup.net/account/internal/relay/report' \
  -H "X-SpaceRelay-Signature: $RELAY_SIGNATURE" \
  -H "Content-Type: application/json" \
  --data '{"id":"rep-20261018-091200-0001","month":"2026-10","usage":[{"group":"<64 hex>","bytes":12884901}],"groups":["<64 hex>","<64 hex>"]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/internal/relay/report",
    method="POST",
    data=json.dumps({"id": "rep-20261018-091200-0001", "month": "2026-10", "usage": [{"group": "<64 hex>", "bytes": 12884901}], "groups": ["<64 hex>", "<64 hex>"]}).encode(),
    headers={"X-SpaceRelay-Signature": os.environ["RELAY_SIGNATURE"], "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 404, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let relaySignature = ProcessInfo.processInfo.environment["RELAY_SIGNATURE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/internal/relay/report")!)
req.httpMethod = "POST"
req.setValue("\(relaySignature)", forHTTPHeaderField: "X-SpaceRelay-Signature")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"id":"rep-20261018-091200-0001","month":"2026-10","usage":[{"group":"<64 hex>","bytes":12884901}],"groups":["<64 hex>","<64 hex>"]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 404, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/internal/relay/report");
req.Headers.TryAddWithoutValidation("X-SpaceRelay-Signature", Environment.GetEnvironmentVariable("RELAY_SIGNATURE"));
req.Content = new StringContent("""{"id":"rep-20261018-091200-0001","month":"2026-10","usage":[{"group":"<64 hex>","bytes":12884901}],"groups":["<64 hex>","<64 hex>"]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 404, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /stripe/webhook#

Stripe's events about payments. Only Stripe calls it.

POST /stripe/webhook · from openapi.yaml (postStripeWebhook)

AuthStripe-Signature header (Stripe's HMAC of the payload with the webhook secret)
Bodyapplication/json
200OK
curl
# answers 200
curl -sS -X POST 'https://spacebackup.net/account/stripe/webhook' \
  -H "Stripe-Signature: $STRIPE_SIGNATURE" \
  -H "Content-Type: application/json" \
  --data '{}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/stripe/webhook",
    method="POST",
    data=json.dumps({}).encode(),
    headers={"Stripe-Signature": os.environ["STRIPE_SIGNATURE"], "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let stripeSignature = ProcessInfo.processInfo.environment["STRIPE_SIGNATURE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/stripe/webhook")!)
req.httpMethod = "POST"
req.setValue("\(stripeSignature)", forHTTPHeaderField: "Stripe-Signature")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/stripe/webhook");
req.Headers.TryAddWithoutValidation("Stripe-Signature", Environment.GetEnvironmentVariable("STRIPE_SIGNATURE"));
req.Content = new StringContent("""{}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Assistant#

The iPhone assistant runs on Apple's on-device model where it can. Phones without Apple Intelligence send the request here instead. The service only plans: it turns the words into the app's own actions and returns them; the phone shows say and runs the actions only after the person confirms. See Assistant.

POST /api/assistant#

POST /api/assistant · from openapi.yaml (postAssistant)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json AssistantRequest
text string|null · 1–1,000 characters; line breaks become spaces
today string|null · the phone's local date, `YYYY-MM-DD` (relative dates count from it)
context AssistantContext|null · the phone's place names and found trips, newest first. At most 200 places and 100 trips are used; names are cut to 80 characters; dates that are not `YYYY-MM-DD` are dropped. `kinds` is any small JSON value (up to 2,000 characters, else left out). `appCommands` (`[{"id", "what"}]`, at most 100) are the app's own commands it runs as an `app_command` action, and `pcs` (names, at most 50) the company's computers, for `pc_space`. `history` (`[{"q", "a"}]`, the chat's exchanges before this request, oldest first; the last 3 are used, `a` cut at 800 characters) makes the request a follow-up: it is read, searched in the manual and cached with them. `appSettings` (names, at most 100) are the app's own settings; an answer about one names it exactly so. `languages` (codes, first first, at most 3 of the 14 of `me/settings`; unknown ones dropped) are the asker's languages, which the answer is in; absent: the member's own `me/settings` languages. `geo`: `1` when the app reads `show_items`' `geo` filter (below); the bare `place` is then left out wherever `geo` has it
mode string|null · `developer`: a developer's question about the APIs (see below); `today` may then be left out. `select-assist`: a computer's photo selection box; planned exactly as a phone's request, counted apart in the usage
language string|null · the code sample's language in developer mode: `curl` (default), `python`, `swift` or `csharp`
200Or only {...} when nothing fits (no `actions` key). `say` is one plain line, at most 300 characters → AssistantReply {actions?: AssistantAction[], say: string, kind: string, text?: string|null, links?: AssistantLink[]}
400text is required, text is too long (at most 1000 characters), today must be a date (YYYY-MM-DD), mode must be developer, select-assist or left out, language must be curl, python, swift or csharp
mode must be developer, select-assist or left out
language must be curl, python, swift or csharp
today must be a date (YYYY-MM-DD)
text is required
text is too long (at most 1000 characters)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403the assistant is for signed-in devices, not an active member of a company, this device is not registered (devices/register)
not an active member of a company
the assistant is for signed-in devices
this device is not registered (devices/register)
missing CSRF token
429Too many assistant requests in a short time (at most 20 a minute from one device and 200 an hour for a company). Please wait a minute and try again. There is no daily limit: this is an abuse guard a person never reaches (assistant.devicePerMinute, assistant.companyPerHour; every request counts, one the app gave up on too)
503The assistant is not available on this server., The assistant is busy right now. Please try again in a minute
The assistant is not available on this server.
The assistant is busy right now. Please try again in a minute.
curl
# answers 200; errors 400, 401, 403, 429, 503
curl -sS -X POST 'https://spacebackup.net/account/api/assistant' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"text":"back up all photos from my last Chicago trip","today":"2026-10-14","context":{"places":[{"name":"Chicago","count":412}],"trips":[{"name":"Chicago, Sep 2026","place":"Chicago","from":"2026-09-03","to":"2026-09-06","count":412}],"kinds":{"photo":5000,"video":300}}}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/assistant",
    method="POST",
    data=json.dumps({"text": "back up all photos from my last Chicago trip", "today": "2026-10-14", "context": {"places": [{"name": "Chicago", "count": 412}], "trips": [{"name": "Chicago, Sep 2026", "place": "Chicago", "from": "2026-09-03", "to": "2026-09-06", "count": 412}], "kinds": {"photo": 5000, "video": 300}}}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 429, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/assistant")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"text":"back up all photos from my last Chicago trip","today":"2026-10-14","context":{"places":[{"name":"Chicago","count":412}],"trips":[{"name":"Chicago, Sep 2026","place":"Chicago","from":"2026-09-03","to":"2026-09-06","count":412}],"kinds":{"photo":5000,"video":300}}}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 429, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/assistant");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"text":"back up all photos from my last Chicago trip","today":"2026-10-14","context":{"places":[{"name":"Chicago","count":412}],"trips":[{"name":"Chicago, Sep 2026","place":"Chicago","from":"2026-09-03","to":"2026-09-06","count":412}],"kinds":{"photo":5000,"video":300}}}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 429, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /api/geo/resolve#

GET /api/geo/resolve · from openapi.yaml (getGeoResolve)

AuthAuthorization: Bearer <device token>, or the admin page's web session (cookie sa_session) plus X-CSRF-Token
querywords string|null (optional)
querylangs string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403not an active member of a company, this device is not registered (devices/register)
missing CSRF token
curl
# answers ; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/geo/resolve?words=1&langs=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/geo/resolve?words=1&langs=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/geo/resolve?words=1&langs=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/geo/resolve?words=1&langs=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers ; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Usage#

The apps report how they are used, as counts and outcomes, for the company's usage page and the service's operator (iOS request #59). Nothing in a report may name a person, a place, a file or a photo, and nothing but the fields below is stored. Raw events are kept 90 days, the daily totals 13 months.

POST /api/usage#

A batch of events, sent at most every few minutes and when the app goes to the background.

Phones send it now; computers will send the same shape. The device's type (from the os it registered with: ios, android, macos, windows, linux, other) is recorded with each event, so the usage pages can show each type apart.

POST /api/usage · from openapi.yaml (postUsage)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json UsageReport
events UsageEvent|null[] · 0–500 events (`usage.maxEvents`)
204No body
400events is required, too many events (at most 500 in one report), events[1].kind must be one of open, backup_run, backup_items, album_create, album_add, share, link_create, restore, select_job, crash, events[0].t must be a time (Unix milliseconds or ISO 8601), events[0].n is required for crash, events[0]: open has no n, events[0].n must be a count from 0 to 1000000000000, events[0].ms is required for backup_run, events[0]: share has no ms, events[0].ms must be from 0 to 86400000, events[0].outcome is required for album_add, events[0]: open has no outcome, events[0].outcome of restore must be ok or problems or stopped, events[0].outcome must be a short word (letters, digits, _ and -, at most 32): the whole batch is refused; drop it rather than send it again
events is required
too many events (at most <max> in one report)
events[<i>] is empty
events[<i>].t must be a time (Unix milliseconds or ISO 8601)
events[<i>].n is required for <kind>
events[<i>]: <kind> has no n
events[<i>].n must be a count from 0 to 1000000000000
events[<i>].ms is required for <kind>
events[<i>]: <kind> has no ms
events[<i>].ms must be from 0 to 86400000
events[<i>]: <kind> has no outcome
events[<i>].outcome is required for <kind>
events[<i>].outcome must be a short word (letters, digits, _ and -, at most 32)
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403usage is reported by signed-in devices, not an active member of a company, this device is not registered (devices/register)
usage is reported by signed-in devices
not an active member of a company
this device is not registered (devices/register)
429Too many usage reports from this device (at most 60 an hour). Send them batched, at most every few minutes. (usage.reportsPerHour; keep the batch and send it later)
Too many usage reports from this device (at most <reportsPerHour> an hour). Send them batched, at most every few minutes.
curl
# answers 204; errors 400, 401, 403, 429
curl -sS -X POST 'https://spacebackup.net/account/api/usage' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"events":[{"t":1792058400000,"kind":"open"},{"t":1792058431000,"kind":"backup_run","outcome":"tapped","ms":93000},{"t":1792058431000,"kind":"backup_items","n":412},{"t":"2026-10-22T09:21:07Z","kind":"select_job","n":900,"outcome":"done","ms":5200}]}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/usage",
    method="POST",
    data=json.dumps({"events": [{"t": 1792058400000, "kind": "open"}, {"t": 1792058431000, "kind": "backup_run", "outcome": "tapped", "ms": 93000}, {"t": 1792058431000, "kind": "backup_items", "n": 412}, {"t": "2026-10-22T09:21:07Z", "kind": "select_job", "n": 900, "outcome": "done", "ms": 5200}]}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 400, 401, 403, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/usage")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"events":[{"t":1792058400000,"kind":"open"},{"t":1792058431000,"kind":"backup_run","outcome":"tapped","ms":93000},{"t":1792058431000,"kind":"backup_items","n":412},{"t":"2026-10-22T09:21:07Z","kind":"select_job","n":900,"outcome":"done","ms":5200}]}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 400, 401, 403, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/usage");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"events":[{"t":1792058400000,"kind":"open"},{"t":1792058431000,"kind":"backup_run","outcome":"tapped","ms":93000},{"t":1792058431000,"kind":"backup_items","n":412},{"t":"2026-10-22T09:21:07Z","kind":"select_job","n":900,"outcome":"done","ms":5200}]}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 204; errors 400, 401, 403, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Web pages & forms#

The account pages are server-rendered HTML in the site's style. They are for people, not for programs, but every one is listed here. All form posts are application/x-www-form-urlencoded and carry the csrf field (Web sessions and CSRF); a missing or wrong token answers 403. A form post without a web session redirects to /account/. A form post that succeeds redirects (302) back to its page with ?msg=<what was done>, which the page shows at the top. An error is shown as a page with the same status codes as the API. See The admin page.

Sign-in pages.

GET /#

The sign-in page (an email field). Signed in, it redirects to /account/admin for the owner and admins and to /account/me for everyone else; ?next=relay redirects to the relay buy screen instead.

GET / · from openapi.yaml (get)

Authnone
querynext string|null (optional)
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
curl
# answers 200; errors 302, 400
curl -sS -X GET 'https://spacebackup.net/account/'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /signin#

Form: email. Starts a sign-in for "a web browser (Firefox)" and the like, keeps the browser's secret in the sa_signin cookie, and redirects to /account/signin/wait. A bad address (400), too many requests (429) or a mail failure (503) shows the sign-in page again with the error.

POST /signin · from openapi.yaml (postSignin)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
email string
200OK
302Found (redirect)
400not a valid email address
secretHash must be base64 of a SHA-256
not a valid email address
<name> is required
<name> is too long
<name> must not contain control characters
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
429too many sign-in requests; try again later
too many sign-in requests; try again later
503could not send the sign-in mail; try again later
could not send the sign-in mail; try again later
curl
# answers 200; errors 302, 400, 403, 429, 503
curl -sS -X POST 'https://spacebackup.net/account/signin' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&email=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "email": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403, 429, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&email=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403, 429, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/signin");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["email"] = "…" });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403, 429, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /signin/wait#

The waiting page: "Check your email", a field for the 6-digit code, and a script that polls POST /account/signin/poll every 2 seconds. Without a sign-in in progress it redirects to /account/.

GET /signin/wait · from openapi.yaml (getSigninWait)

Authnone
200OK
302Found (redirect)
curl
# answers 200; errors 302
curl -sS -X GET 'https://spacebackup.net/account/signin/wait'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin/wait",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin/wait")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/signin/wait");
using var res = await http.SendAsync(req);  // answers 200; errors 302
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /signin/code#

Form: code. A right code signs the browser in (sets sa_session) and redirects to /account/; a wrong one shows the waiting page with "Wrong code; 3 attempt(s) left." (400). Without a sign-in in progress it redirects to /account/.

POST /signin/code · from openapi.yaml (postSigninCode)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
code string
csrf string
200OK
302Found (redirect)
400the waiting page with Wrong code; 3 attempt(s) left
wrong code
<name> is required
<name> is too long
<name> must not contain control characters
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
404no such sign-in request (the browser's sign-in is gone)
no such sign-in request
410this sign-in was already used, this sign-in has expired; start again, too many wrong codes; start again. 404 and 410 are error pages; start the sign-in again
this sign-in was already used
this sign-in has expired; start again
too many wrong codes; start again
curl
# answers 200; errors 302, 400, 403, 404, 410
curl -sS -X POST 'https://spacebackup.net/account/signin/code' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'code=…&csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin/code",
    method="POST",
    data=urllib.parse.urlencode({"code": "…", "csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403, 404, 410
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin/code")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"code=…&csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403, 404, 410
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/signin/code");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["code"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403, 404, 410
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /signin/poll#

The waiting page's poll. Header X-CSRF-Token (else 403 {"error": "missing CSRF token"}); no body. Answers JSON {"status": "pending"}, {"status": "approved"} (the session cookie is set; reload), {"status": "expired"} (start again) or {"status": "none"} (no sign-in in progress).

POST /signin/poll · from openapi.yaml (postSigninPoll)

Auththe sign-in cookie sa_signin plus the header X-CSRF-Token
200OK
400Bad Request
wrong code
<name> is required
<name> is too long
<name> must not contain control characters
403Forbidden
missing CSRF token
curl
# answers 200; errors 400, 403
curl -sS -X POST 'https://spacebackup.net/account/signin/poll' \
  -H "Cookie: sa_signin=$SA_COOKIE" \
  -H "X-CSRF-Token: $SA_CSRF"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin/poll",
    method="POST",
    headers={"Cookie": "sa_signin=" + os.environ["SA_COOKIE"], "X-CSRF-Token": os.environ["SA_CSRF"]},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCsrf = ProcessInfo.processInfo.environment["SA_CSRF"]!
let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin/poll")!)
req.httpMethod = "POST"
req.setValue("sa_signin=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("\(saCsrf)", forHTTPHeaderField: "X-CSRF-Token")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/signin/poll");
req.Headers.TryAddWithoutValidation("Cookie", "sa_signin=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Headers.TryAddWithoutValidation("X-CSRF-Token", Environment.GetEnvironmentVariable("SA_CSRF"));
using var res = await http.SendAsync(req);  // answers 200; errors 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /signin/confirm#

The mailed link: ?r=<request id>&t=<link token>. Shows "Sign in <device name>?" with the email, when it was asked, and a Sign in button (it does not sign in by itself, so mail scanners cannot use the link up). An expired or used link shows "Link expired".

GET /signin/confirm · from openapi.yaml (getSigninConfirm)

Authnone
queryr string|null (optional)
queryt string|null (optional)
200OK
curl
# answers 200
curl -sS -X GET 'https://spacebackup.net/account/signin/confirm?r=r_2mxq7k4a9fz3wn5c&t=<link+token>'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin/confirm?r=r_2mxq7k4a9fz3wn5c&t=<link+token>",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin/confirm?r=r_2mxq7k4a9fz3wn5c&t=<link+token>")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/signin/confirm?r=r_2mxq7k4a9fz3wn5c&t=<link+token>");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /signin/confirm#

Form: r, t. Approves the sign-in. In the browser that asked, it signs in at once and redirects to /account/; anywhere else it says "ANNA-PC is signed in as anna@acme.com now. You can close this tab." and the device (or the original browser tab) picks up its token with its next poll. An unknown, expired or used link shows "Link expired" (200).

POST /signin/confirm · from openapi.yaml (postSigninConfirm)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
r string
t string
200OK
302Found (redirect)
400Bad Request
wrong code
<name> is required
<name> is too long
<name> must not contain control characters
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
curl
# answers 200; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/signin/confirm' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&r=…&t=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signin/confirm",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "r": "…", "t": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signin/confirm")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&r=…&t=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/signin/confirm");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["r"] = "…", ["t"] = "…" });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /signout#

Form: only csrf. Ends the web session and redirects to /account/.

The member's page.

POST /signout · from openapi.yaml (postSignout)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403Forbidden
This form has expired. Go back, reload the page and try again.
curl
# answers 200; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/signout' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/signout",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/signout")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/signout");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /me#

The member's own page, for any signed-in email: first and last name, Your devices (rename, remove), **Shared backups (the shares of their own devices only, also for the owner and admins), Shared with me, Shared albums** (the setting "Automatically accept albums shared by people in my company", the invitations waiting with Accept / Decline, declined ones with Accept, and the albums shared with them, of their company and as a guest of others, each On or Off with Turn off / Turn on), Your groups (read-only), Space Relay credit and **Sign out**. Someone who is not an active member sees why (not in a company yet, or waiting for approval), and their Shared albums without the setting. Not signed in: redirects to /account/.

GET /me · from openapi.yaml (getMe)

Authnone
querymsg string|null (optional)
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403Forbidden
not an active member of a company
curl
# answers 200; errors 302, 400, 403
curl -sS -X GET 'https://spacebackup.net/account/me'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/me");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/name#

Form: firstName, lastName (empty clears). The rules of PUT /api/me.

POST /me/name · from openapi.yaml (postMeName)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
firstName string
lastName string
302Found (redirect)
400Bad Request
first name is required with a last name
<what> is too long (at most 40 characters)
<what> must not contain control characters
403Forbidden
not an active member of a company
This form has expired. Go back, reload the page and try again.
curl
# answers ; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/me/name' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&firstName=…&lastName=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/name",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "firstName": "…", "lastName": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/name")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&firstName=…&lastName=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/name");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["firstName"] = "…", ["lastName"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/devices/{id}/label#

Form: label (empty resets). Renames one of the caller's own devices, as POST /api/devices/{id}/label.

POST /me/devices/{id}/label · from openapi.yaml (postMeDevicesIdLabel)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
label string
302Found (redirect)
400the name is too long (at most 64 characters), the name must not contain control characters
the name is too long (at most 64 characters)
the name must not contain control characters
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such device (not one of the caller's own)
no such device
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/label' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&label=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/label",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "label": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/label")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&label=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/label");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["label"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/devices/{id}/remove#

Removes one of the caller's own active devices (the page asks first); the company key is then replaced, as POST /api/devices/{id}/remove.

POST /me/devices/{id}/remove · from openapi.yaml (postMeDevicesIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
only the company's owner or an admin (or the device's member) may remove a device
This form has expired. Go back, reload the page and try again.
404no such device (not one of the caller's own active devices)
no such device
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/devices/d_4f2a7cqm3xk9wz2b/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/agents/{id}/remove#

Disconnects an AI agent the caller allowed (AI agents on /me, the page asks first): its access and refresh tokens end at once, and the company's audit log gets a line. The OAuth endpoints themselves (/account/oauth/authorize, token, register, revoke), the MCP endpoint /account/mcp and the discovery documents under /.well-known/ are described in docs/mcp.md "Remote" and on spacebackup.net/developers.

POST /me/agents/{id}/remove · from openapi.yaml (postMeAgentsIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
404no such connection
no such connection
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/agents/x_k3xq7m2pa9fz4w8r/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/agents/x_k3xq7m2pa9fz4w8r/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/agents/x_k3xq7m2pa9fz4w8r/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/agents/x_k3xq7m2pa9fz4w8r/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/tvs/{id}/remove#

Disconnects one of the caller's TVs (Your TVs on /me, the page asks first), as POST /api/tvs/{id}/remove.

POST /me/tvs/{id}/remove · from openapi.yaml (postMeTvsIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
not an active member of a company
a TV cannot do this
This form has expired. Go back, reload the page and try again.
404no such TV
no such TV
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/tvs/x_k3xq7m2pa9fz4w8r/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/tvs/x_k3xq7m2pa9fz4w8r/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/tvs/x_k3xq7m2pa9fz4w8r/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/tvs/x_k3xq7m2pa9fz4w8r/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /tv#

The TV code page (the TV shows https://spacebackup.net/tv, which nginx sends here; ?code= from its QR code fills the code in). Not signed in: the sign-in page ("Sign in to connect your TV."), which comes back here with the code after the sign-in. Signed in: the code box and Continue.

GET /tv · from openapi.yaml (getTv)

Authnone
querycode string|null (optional)
200OK
400Bad Request
<name> must be a string
<name> is too long
curl
# answers 200; errors 400
curl -sS -X GET 'https://spacebackup.net/account/tv?code=1'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/tv?code=1",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/tv?code=1")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/tv?code=1");
using var res = await http.SendAsync(req);  // answers 200; errors 400
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /tv/{code}#

The TV's QR code (https://spacebackup.net/tv/<code>, a universal link the iPhone app claims; without the app the service redirects it here). Signed in on the web: the code page with the code filled in, as GET /tv?code=. Not signed in: only "Open Space Backup on your iPhone to sign in this TV", the code, and where to get the app (Android: the Android app's link when there is one). No sign-in form, and the code is not looked up. Not a code: redirects to /tv. The site's /.well-known/apple-app-site-association (application/json) claims /tv/* for the iPhone app.

GET /tv/{code} · from openapi.yaml (getTvCode)

Authnone
pathcode string
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
curl
# answers 200; errors 302, 400
curl -sS -X GET 'https://spacebackup.net/account/tv/x_k3xq7m2pa9fz4w8r'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/tv/x_k3xq7m2pa9fz4w8r",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/tv/x_k3xq7m2pa9fz4w8r")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/tv/x_k3xq7m2pa9fz4w8r");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /tv#

The code typed (form code, csrf): the TV it names (name, model, when it asked) with a name box, Approve and **Not my TV**.

POST /tv · from openapi.yaml (postTv)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
code string
csrf string
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403This form has expired. Go back, reload the page and try again
This form has expired. Go back, reload the page and try again.
not an active member of a company
a TV cannot do this
404no TV is showing that code; check it, or show a new one on the TV;
no TV is showing that code; check it, or show a new one on the TV
429too many wrong codes; wait a few minutes (the code page again, with the message);
too many wrong codes; wait a few minutes
curl
# answers 200; errors 302, 400, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/tv' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'code=…&csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/tv",
    method="POST",
    data=urllib.parse.urlencode({"code": "…", "csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/tv")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"code=…&csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/tv");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["code"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /tv/approve#

Form code, name, csrf: approves the pairing (as POST /api/tv/pair/{code}/approve); "&lt;name&gt; is connected".

POST /tv/approve · from openapi.yaml (postTvApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
code string
csrf string
name string
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403This form has expired. Go back, reload the page and try again
This form has expired. Go back, reload the page and try again.
not an active member of a company
a TV cannot do this
404no TV is showing that code; check it, or show a new one on the TV;
no TV is showing that code; check it, or show a new one on the TV
429too many wrong codes; wait a few minutes (the code page again, with the message);
too many wrong codes; wait a few minutes
curl
# answers 200; errors 302, 400, 403, 404, 429
curl -sS -X POST 'https://spacebackup.net/account/tv/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'code=…&csrf='"$SA_CSRF"'&name=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/tv/approve",
    method="POST",
    data=urllib.parse.urlencode({"code": "…", "csrf": os.environ["SA_CSRF"], "name": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403, 404, 429
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/tv/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"code=…&csrf=\#(saCsrf)&name=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403, 404, 429
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/tv/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["code"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["name"] = "…" });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403, 404, 429
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /tv/deny#

Form code, csrf: declines it (as POST /api/tv/pair/{code}/deny); the TV shows that it was declined.

POST /tv/deny · from openapi.yaml (postTvDeny)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
code string
csrf string
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403This form has expired. Go back, reload the page and try again
This form has expired. Go back, reload the page and try again.
not an active member of a company
a TV cannot do this
curl
# answers 200; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/tv/deny' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'code=…&csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/tv/deny",
    method="POST",
    data=urllib.parse.urlencode({"code": "…", "csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/tv/deny")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"code=…&csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/tv/deny");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["code"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/approvals/{id}/approve, POST /me/approvals/{id}/deny#

Approve / Deny under Restore requests: decides a request to restore one of the caller's own devices, as POST /api/me/approvals/{id}/approve|deny.

POST /me/approvals/{id}/approve · from openapi.yaml (postMeApprovalsIdApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such request to restore a device of yours, no such data-key request
no such request to restore a device of yours
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/approve",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/approvals/{id}/deny · from openapi.yaml (postMeApprovalsIdDeny)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such request to restore a device of yours, no such data-key request
no such request to restore a device of yours
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/deny' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/deny",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/deny")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/approvals/dr_z3k7xq2ma9pw4n5c/deny");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/shares#

Form: device (one of the caller's own devices), email. Shares that device's backups, as POST /api/shares.

POST /me/shares · from openapi.yaml (postMeShares)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
device string
email string
302Found (redirect)
400not a valid email address, these backups are already <email>'s
these backups are already <email>'s
<name> is required
<name> is too long
<name> must not contain control characters
not a valid email address
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); the 403s of POST /api/shares
not an active member of a company
only the device's owner or an admin can share its backups
you cannot share <name>'s backups with yourself: ask to restore them instead, which <email> or another owner or admin approves
This form has expired. Go back, reload the page and try again.
404no such device, <email> is not a member of your company
no such device
<email> is not a member of your company
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/shares' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&device=…&email=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/shares",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "device": "…", "email": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/shares")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&device=…&email=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/shares");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["device"] = "…", ["email"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/settings#

Form: autoAcceptCompany (on when ticked; an unticked box sends nothing, which turns it off). As PUT /api/me/settings.

POST /me/settings · from openapi.yaml (postMeSettings)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
autoAcceptCompany string
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); only an active member of a company has these settings
only an active member of a company has these settings
This form has expired. Go back, reload the page and try again.
curl
# answers ; errors 302, 403
curl -sS -X POST 'https://spacebackup.net/account/me/settings' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'autoAcceptCompany=…&csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/settings",
    method="POST",
    data=urllib.parse.urlencode({"autoAcceptCompany": "…", "csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/settings")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"autoAcceptCompany=…&csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/settings");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["autoAcceptCompany"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/languages#

Form: lang1, lang2, lang3 (codes; an empty one is left out). Your languages on the account page, as PUT /api/me/settings languages.

POST /me/languages · from openapi.yaml (postMeLanguages)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
lang1 string
lang2 string
lang3 string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); only an active member of a company has these settings
only an active member of a company has these settings
This form has expired. Go back, reload the page and try again.
curl
# answers ; errors 302, 403
curl -sS -X POST 'https://spacebackup.net/account/me/languages' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&lang1=…&lang2=…&lang3=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/languages",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "lang1": "…", "lang2": "…", "lang3": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/languages")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&lang1=…&lang2=…&lang3=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/languages");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["lang1"] = "…", ["lang2"] = "…", ["lang3"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/albums/{id}/show#

Form: on (1 turns the album on, anything else off). Turn off / Turn on under Shared albums, as POST /api/albums/{id}/show.

POST /me/albums/{id}/show · from openapi.yaml (postMeAlbumsIdShow)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
on string
302Found (redirect)
400Bad Request
on is required (true or false)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
404no such album
no such album
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/albums/al_x7k2mq9pa4zw3n5c/show' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&on=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/albums/al_x7k2mq9pa4zw3n5c/show",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "on": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/albums/al_x7k2mq9pa4zw3n5c/show")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&on=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/albums/al_x7k2mq9pa4zw3n5c/show");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["on"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/invitations/{id}/accept#

Accept under Shared albums: accepts a pending or declined invitation, as POST /api/albums/invitations/{id}/accept (without trusting the sender).

POST /me/invitations/{id}/accept · from openapi.yaml (postMeInvitationsIdAccept)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
404no such invitation (accepted already, withdrawn, or the album was deleted)
no such invitation (accepted already, withdrawn, or the album was deleted)
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/accept' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/accept",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/accept")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/accept");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/invitations/{id}/decline#

Decline under Shared albums, as POST /api/albums/invitations/{id}/decline; it stays listed, declined, with Accept.

POST /me/invitations/{id}/decline · from openapi.yaml (postMeInvitationsIdDecline)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf)
This form has expired. Go back, reload the page and try again.
404no such invitation (accepted already, withdrawn, or the album was deleted)
no such invitation (accepted already, withdrawn, or the album was deleted)
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/decline' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/decline",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/decline")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/invitations/x_k3xq7m2pa9fz4w8r/decline");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /me/shares/{id}/remove#

Stops a share of the caller's own device, or removes a share from Shared with me, as POST /api/shares/{id}/remove.

The admin page.

POST /me/shares/{id}/remove · from openapi.yaml (postMeSharesIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such share
no such share
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/me/shares/sh_m3k9xq2a7pz4wn5c/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/me/shares/sh_m3k9xq2a7pz4wn5c/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/me/shares/sh_m3k9xq2a7pz4wn5c/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/me/shares/sh_m3k9xq2a7pz4wn5c/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /admin#

The owner's and admins' page: members (name, email, role, status), devices, shared backups, pending restore requests, devices waiting for the company key, key-recovery requests, the Space Relay panel and the company settings. A plain member is redirected to /account/me (with its msg); not signed in: to /account/.

Each form below needs an owner or admin; it does what the API route named does, then returns to /account/admin?msg=….

GET /admin · from openapi.yaml (getAdmin)

Authnone
querymsg string|null (optional)
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
403Forbidden
only the company's owner or an admin may do this
only the company's owner or an admin may list every link
not an active member of a company
this device is not registered (devices/register)
curl
# answers 200; errors 302, 400, 403
curl -sS -X GET 'https://spacebackup.net/account/admin'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/admin");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/invite#

Form: email, role (member or admin). As POST /api/members/invite.

POST /admin/invite · from openapi.yaml (postAdminInvite)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
email string
role string
302Found (redirect)
400not a valid email address, role must be admin or member
role must be admin or member
not a valid email address
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
409bob@acme.com is already a member, bob@acme.com belongs to another company
<e> is already a member
<e> belongs to another company
curl
# answers ; errors 302, 400, 403, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/invite' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&email=…&role=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/invite",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "email": "…", "role": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/invite")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&email=…&role=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/invite");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["email"] = "…", ["role"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/members/{id}/role#

Form: role (admin or member; never the owner). As POST /api/members/{id}/role.

POST /admin/members/{id}/role · from openapi.yaml (postAdminMembersIdRole)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
role string
302Found (redirect)
400role must be admin or member
role must be admin or member
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such member
no such member
409the owner's role cannot be changed
the owner's role cannot be changed
curl
# answers ; errors 302, 400, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/role' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&role=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/role",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "role": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/role")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&role=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/role");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["role"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/members/{id}/name#

Form: firstName, lastName, or name alone (split at its first space); empty clears. As POST /api/members/{id}/name.

POST /admin/members/{id}/name · from openapi.yaml (postAdminMembersIdName)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
firstName string
lastName string
name string
302Found (redirect)
400the name rules of POST /api/members/{id}/name
first name is required with a last name
<what> is too long (at most 40 characters)
<what> must not contain control characters
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such member
no such member
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/name' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&firstName=…&lastName=…&name=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/name",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "firstName": "…", "lastName": "…", "name": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/name")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&firstName=…&lastName=…&name=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/name");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["firstName"] = "…", ["lastName"] = "…", ["name"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/members/{id}/approve#

Lets a pending person join. As POST /api/members/{id}/approve.

POST /admin/members/{id}/approve · from openapi.yaml (postAdminMembersIdApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such member
no such member
409bob@acme.com is active, not waiting for approval, bob@acme.com belongs to another company now
<email> is <status>, not waiting for approval
<email> belongs to another company now
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/approve",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/members/{id}/deny#

As POST /api/members/{id}/deny.

POST /admin/members/{id}/deny · from openapi.yaml (postAdminMembersIdDeny)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such member
no such member
409bob@acme.com is active, not waiting for approval, bob@acme.com belongs to another company now
<email> is <status>, not waiting for approval
<email> belongs to another company now
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/deny' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/deny",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/deny")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/deny");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/members/{id}/remove#

Removes a member with their devices (never the owner); the company key is then replaced. As POST /api/members/{id}/remove.

POST /admin/members/{id}/remove · from openapi.yaml (postAdminMembersIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such member
no such member
409the owner cannot be removed
the owner cannot be removed
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/members/m_7hd2kq9wz3xa5npe/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/devices/{id}/remove#

Remove device; the company key is then replaced. As POST /api/devices/{id}/remove.

POST /admin/devices/{id}/remove · from openapi.yaml (postAdminDevicesIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin (or the device's member) may remove a device, not an active member of a company
only the company's owner or an admin (or the device's member) may remove a device
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such device
no such device
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/admin/devices/d_4f2a7cqm3xk9wz2b/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/devices/d_4f2a7cqm3xk9wz2b/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/devices/d_4f2a7cqm3xk9wz2b/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/devices/d_4f2a7cqm3xk9wz2b/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/datakey-requests/{id}/approve#

Approves a restore request: the requesting device (only) may then read the source's encrypted backups.

POST /admin/datakey-requests/{id}/approve · from openapi.yaml (postAdminDatakeyRequestsIdApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such data-key request
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/approve",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/datakey-requests/{id}/deny#

Denies a restore request.

POST /admin/datakey-requests/{id}/deny · from openapi.yaml (postAdminDatakeyRequestsIdDeny)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such data-key request
no such data-key request
409this request was already approved|denied
this request was already <state>
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/deny' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/deny",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/deny")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/datakey-requests/dr_z3k7xq2ma9pw4n5c/deny");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/key-release/{id}/approve#

Approves a device waiting for the company key. As POST /api/key-release/{id}/approve.

POST /admin/key-release/{id}/approve · from openapi.yaml (postAdminKeyReleaseIdApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403the 403s of POST /api/key-release/{id}/approve, This form has expired. Go back, reload the page and try again
a device cannot approve itself: approve it from the email we sent, or from another signed-in device or the admin page
only the company's owner or an admin may do this
only the company's owner or an admin may approve this
This form has expired. Go back, reload the page and try again.
404no such key request
no such key request
409ANNA-LAPTOP already has the company key, that device was removed, the company has no recovery copy of its key
that device was removed
<name> already has the company key
the company has no recovery copy of its key
503the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it
the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it
curl
# answers ; errors 302, 403, 404, 409, 503
curl -sS -X POST 'https://spacebackup.net/account/admin/key-release/kq_w2m7zx4qa9k3pn5c/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/key-release/kq_w2m7zx4qa9k3pn5c/approve",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/key-release/kq_w2m7zx4qa9k3pn5c/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/key-release/kq_w2m7zx4qa9k3pn5c/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/links/{id}/revoke#

Revoke in the admin page's Public links: the link stops at once. As POST /api/links/{id}/revoke.

POST /admin/links/{id}/revoke · from openapi.yaml (postAdminLinksIdRevoke)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such link
no such link
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/admin/links/x_k3xq7m2pa9fz4w8r/revoke' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/links/x_k3xq7m2pa9fz4w8r/revoke",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/links/x_k3xq7m2pa9fz4w8r/revoke")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/links/x_k3xq7m2pa9fz4w8r/revoke");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/key-recovery/{id}/cancel#

Cancels a company-key recovery. As POST /api/key-recovery/{id}/cancel.

POST /admin/key-recovery/{id}/cancel · from openapi.yaml (postAdminKeyRecoveryIdCancel)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
404no such key recovery request
no such key recovery request
409the recovery copy was already released
the recovery copy was already released
curl
# answers ; errors 302, 403, 404, 409
curl -sS -X POST 'https://spacebackup.net/account/admin/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/key-recovery/kr_p4xq9m2ka7zw3n5c/cancel");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/shares#

Form: device (any device of the company), email. Share a device's backups, as POST /api/shares.

POST /admin/shares · from openapi.yaml (postAdminShares)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
device string
email string
302Found (redirect)
400not a valid email address, these backups are already <email>'s
these backups are already <email>'s
<name> is required
<name> is too long
<name> must not contain control characters
not a valid email address
403This form has expired. Go back, reload the page and try again.; the 403s of POST /api/shares
only the device's owner or an admin can share its backups
you cannot share <name>'s backups with yourself: ask to restore them instead, which <email> or another owner or admin approves
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such device, <email> is not a member of your company
no such device
<email> is not a member of your company
curl
# answers ; errors 302, 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/admin/shares' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&device=…&email=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/shares",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "device": "…", "email": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/shares")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&device=…&email=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/shares");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["device"] = "…", ["email"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/shares/{id}/remove#

Stop sharing, as POST /api/shares/{id}/remove.

POST /admin/shares/{id}/remove · from openapi.yaml (postAdminSharesIdRemove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
pathid string
Bodyapplication/x-www-form-urlencoded
csrf string
302Found (redirect)
403This form has expired. Go back, reload the page and try again. (a missing or wrong csrf); not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
404no such share
no such share
curl
# answers ; errors 302, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/admin/shares/sh_m3k9xq2a7pz4wn5c/remove' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"''
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/shares/sh_m3k9xq2a7pz4wn5c/remove",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"]}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/shares/sh_m3k9xq2a7pz4wn5c/remove")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/shares/sh_m3k9xq2a7pz4wn5c/remove");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")! });
using var res = await http.SendAsync(req);  // answers ; errors 302, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/settings#

Form: name, autoJoin (on when ticked; ignored when the company has no domain). As POST /api/company/settings.

POST /admin/settings · from openapi.yaml (postAdminSettings)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
autoJoin string
csrf string
faces string
name string
302Found (redirect)
400Bad Request
auto-join needs a company domain; this company has none
<name> is required
<name> is too long
<name> must not contain control characters
403Forbidden
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
curl
# answers ; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/admin/settings' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'autoJoin=…&csrf='"$SA_CSRF"'&faces=…&name=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/settings",
    method="POST",
    data=urllib.parse.urlencode({"autoJoin": "…", "csrf": os.environ["SA_CSRF"], "faces": "…", "name": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/settings")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"autoJoin=…&csrf=\#(saCsrf)&faces=…&name=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/settings");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["autoJoin"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["faces"] = "…", ["name"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /admin/relay/auto-topup#

Form: autoTopUp (on when ticked), pack (sb_pack_500, sb_pack_2000 or sb_pack_5000). Turns auto top-up on with that pack, or off. Turning it on needs a card saved by an earlier purchase; otherwise the page says "Buy a pack once first: Stripe keeps that card for auto top-up." Returns to /account/admin?msg=…#relay.

Usage pages. Never indexed (X-Robots-Tag: noindex, nofollow and the robots meta tag), never cached.

POST /admin/relay/auto-topup · from openapi.yaml (postAdminRelayAutoTopup)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
autoTopUp string
csrf string
pack string
302Found (redirect)
400no such pack
no such pack
403This form has expired. Go back, reload the page and try again., only the company's owner or an admin may do this. (Turning it on without a saved card is not an error: it returns to the page with that message.)
only the company's owner or an admin may do this
This form has expired. Go back, reload the page and try again.
curl
# answers ; errors 302, 400, 403
curl -sS -X POST 'https://spacebackup.net/account/admin/relay/auto-topup' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'autoTopUp=…&csrf='"$SA_CSRF"'&pack=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/relay/auto-topup",
    method="POST",
    data=urllib.parse.urlencode({"autoTopUp": "…", "csrf": os.environ["SA_CSRF"], "pack": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/relay/auto-topup")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"autoTopUp=…&csrf=\#(saCsrf)&pack=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/admin/relay/auto-topup");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["autoTopUp"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["pack"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /admin/usage#

The company's usage, for its owner and admins: the assistant's requests by outcome, tokens and cost, by day and by device; the apps' events by day (with the active devices) and by device. Query: days = 7, 30 (default), 90 or 395 (13 months). Days are UTC. A plain member is redirected to /account/me; not signed in: to /account/. It shows counts only: nothing anyone asked the assistant, nothing in the photos.

GET /admin/usage · from openapi.yaml (getAdminUsage)

Authnone
querydays string|null (optional)
200OK
302Found (redirect)
400Bad Request
<name> must be a string
<name> is too long
curl
# answers 200; errors 302, 400
curl -sS -X GET 'https://spacebackup.net/account/admin/usage?days=1'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/admin/usage?days=1",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 400
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/admin/usage?days=1")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 400
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/admin/usage?days=1");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 400
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /operator#

All companies' usage, for the operator accounts named in the service settings (usage.operators) only: the assistant's requests and cost, active devices and companies by day, and per company its active devices, requests, tokens, cost and app events. Query: days as above. Anyone else, signed in or not, gets 404, the same answer as an address that does not exist; the link to it shows only in an operator's page header. Its Unlimited Space Relay panel lists the unlimited relay months of this month or later, with Revoke on each, and gives more (the two forms below).

GET /operator · from openapi.yaml (getOperator)

Authnone
querydays string|null (optional)
querymsg string|null (optional)
200OK
400Bad Request
<name> must be a string
<name> is too long
curl
# answers 200; errors 400
curl -sS -X GET 'https://spacebackup.net/account/operator?days=1'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/operator?days=1",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/operator?days=1")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/operator?days=1");
using var res = await http.SendAsync(req);  // answers 200; errors 400
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /operator/relay/grant#

Form company (a company's id, name or domain, or a member's email), months (1–120), note (optional), csrf; the operator accounts only (anyone else: 404). Gives the company unlimited Space Relay for whole UTC months: from this month, or on from the end of the months it already has. The same as spaceaccount relay grant on the server. Redirects to /account/operator with the outcome, an error too ("Not done: …", below).

POST /operator/relay/grant · from openapi.yaml (postOperatorRelayGrant)

Authnone
400months must be 1 to 120. Not an operator: 404 (no page)
months must be a whole number
403Forbidden
This form has expired. Go back, reload the page and try again.
404no company "<company>". A name two companies share: more than one company is called "<what>": use its id
no company "<company>"
curl
# answers ; errors 400, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/operator/relay/grant'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/operator/relay/grant",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 400, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/operator/relay/grant")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 400, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/operator/relay/grant");
using var res = await http.SendAsync(req);  // answers ; errors 400, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /operator/relay/revoke#

Form what (a grant's id rg_…, or a company as above: all its grants of this month or later), csrf; the operator accounts only (anyone else: 404). The company is back on its free allowance and balance at once. The same as spaceaccount relay revoke. Redirects to /account/operator with the outcome ("Nothing to revoke" when none is left).

Relay credit pages.

POST /operator/relay/revoke · from openapi.yaml (postOperatorRelayRevoke)

Authnone
403Forbidden
This form has expired. Go back, reload the page and try again.
404no company or grant "<what>". A name two companies share: more than one company is called "<what>": use its id. Not an operator: 404 (no page)
no company or grant "<what>"
curl
# answers ; errors 403, 404
curl -sS -X POST 'https://spacebackup.net/account/operator/relay/revoke'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/operator/relay/revoke",
    method="POST",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/operator/relay/revoke")!)
req.httpMethod = "POST"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/operator/relay/revoke");
using var res = await http.SendAsync(req);  // answers ; errors 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /relay#

The buy screen, for any active member: the balance, a warning when activation is needed, the three packs with a Buy button each and the box "Buy this pack again automatically when the balance drops below 10 %". Not signed in: redirects to /account/?next=relay.

GET /relay · from openapi.yaml (getRelay)

Authnone
querymsg string|null (optional)
200OK
302Found (redirect)
403Forbidden
not an active member of a company
curl
# answers 200; errors 302, 403
curl -sS -X GET 'https://spacebackup.net/account/relay'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/relay");
using var res = await http.SendAsync(req);  // answers 200; errors 302, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /relay/activate#

The relay's "activation needed" link (?group=<short group code>) for devices not signed in and older apps. Signed in, it redirects to /account/relay; otherwise it explains how to sign in.

GET /relay/activate · from openapi.yaml (getRelayActivate)

Authnone
querygroup string|null (optional)
200OK
302Found (redirect)
curl
# answers 200; errors 302
curl -sS -X GET 'https://spacebackup.net/account/relay/activate?group=g7k2mq'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay/activate?group=g7k2mq",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay/activate?group=g7k2mq")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/relay/activate?group=g7k2mq");
using var res = await http.SendAsync(req);  // answers 200; errors 302
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /relay/open#

The app's buy link (?t=<token> from POST /api/relay/buy-link). Signs the browser in as the device's user and redirects to /account/relay. A used or expired link shows "Link expired".

GET /relay/open · from openapi.yaml (getRelayOpen)

Authnone
queryt string|null (optional)
200OK
302Found (redirect)
curl
# answers 200; errors 302
curl -sS -X GET 'https://spacebackup.net/account/relay/open?t=<link+token>'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay/open?t=<link+token>",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 302
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay/open?t=<link+token>")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 302
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/relay/open?t=<link+token>");
using var res = await http.SendAsync(req);  // answers 200; errors 302
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /relay/checkout#

Form: pack, autoTopUp (on when ticked). Starts a Stripe Checkout payment for the company and redirects (302) to Stripe.

POST /relay/checkout · from openapi.yaml (postRelayCheckout)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
autoTopUp string
csrf string
pack string
302Found (redirect)
400no such pack
no such pack
403This form has expired. Go back, reload the page and try again., not an active member of a company
not an active member of a company
This form has expired. Go back, reload the page and try again.
502The payment page could not be opened (Stripe: <message>). Please try again in a minute
The payment page could not be opened (Stripe: <message>). Please try again in a minute.
503Payments are not set up yet. Please try again later
Payments are not set up yet. Please try again later.
curl
# answers ; errors 302, 400, 403, 502, 503
curl -sS -X POST 'https://spacebackup.net/account/relay/checkout' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'autoTopUp=…&csrf='"$SA_CSRF"'&pack=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay/checkout",
    method="POST",
    data=urllib.parse.urlencode({"autoTopUp": "…", "csrf": os.environ["SA_CSRF"], "pack": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers ; errors 302, 400, 403, 502, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay/checkout")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"autoTopUp=…&csrf=\#(saCsrf)&pack=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers ; errors 302, 400, 403, 502, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/relay/checkout");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["autoTopUp"] = "…", ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["pack"] = "…" });
using var res = await http.SendAsync(req);  // answers ; errors 302, 400, 403, 502, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /relay/success#

Stripe's return address after paying (?session_id=). Credits the purchase if the webhook has not yet, and says "Space Relay 500 GB was added to your relay credit" (or that the payment is being confirmed), with the new balance.

GET /relay/success · from openapi.yaml (getRelaySuccess)

Authnone
querysession_id string|null (optional)
200OK
403Forbidden
not an active member of a company
curl
# answers 200; errors 403
curl -sS -X GET 'https://spacebackup.net/account/relay/success?session_id=cs_test_a1b2'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay/success?session_id=cs_test_a1b2",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay/success?session_id=cs_test_a1b2")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/relay/success?session_id=cs_test_a1b2");
using var res = await http.SendAsync(req);  // answers 200; errors 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /relay/cancel#

Stripe's return address after cancelling (?p=<purchase id>): "Payment cancelled. Nothing was charged."

Album invitation link.

GET /relay/cancel · from openapi.yaml (getRelayCancel)

Authnone
queryp string|null (optional)
200OK
curl
# answers 200
curl -sS -X GET 'https://spacebackup.net/account/relay/cancel?p=p_q7m2xk9a4zw3pn5c'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/relay/cancel?p=p_q7m2xk9a4zw3pn5c",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/relay/cancel?p=p_q7m2xk9a4zw3pn5c")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/relay/cancel?p=p_q7m2xk9a4zw3pn5c");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

GET /invite/{id}#

The link in an album invitation mail. A page with Open in Space Backup (spacebackup://invite/<id>, which opens the app) and a link to get the app. It shows nothing about the invitation itself: the app fetches it with the invitee's own sign-in (GET /api/albums/invitations).

GET /invite/{id} · from openapi.yaml (getInviteId)

Authnone
pathid string
200OK
curl
# answers 200
curl -sS -X GET 'https://spacebackup.net/account/invite/inv_c4n7zq2m9xa3kw5p'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/invite/inv_c4n7zq2m9xa3kw5p",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/invite/inv_c4n7zq2m9xa3kw5p")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/invite/inv_c4n7zq2m9xa3kw5p");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Every approve, deny or cancel mail carries a link https://spacebackup.net/account/approve?t=<token>: one single-use token per recipient, valid 7 days. Restore-request mails add &d=approve or &d=deny to preselect the button.

KindMailed toButtons
a restore request (data key)the owner and adminsApprove, Deny
a pending jointhe owner and adminsApprove, Deny (the person gets a "You joined" mail)
a device waiting for the company keythe owner and adminsApprove
a company-key recoveryevery adminCancel the recovery

The person following the link must still be the owner or an admin when they click; signing in is not needed (the token is the proof).

GET /approve#

Query: t, d? Shows what the link is about ("Restore OLD-LAPTOP's backups?", "Let bob@acme.com join Acme?") with its buttons, or that it can no longer be used (decided, used or expired). An unknown token: "Link not valid".

GET /approve · from openapi.yaml (getApprove)

Authnone
queryt string|null (optional)
queryd string|null (optional)
200OK
curl
# answers 200
curl -sS -X GET 'https://spacebackup.net/account/approve?t=<link+token>&d=approve'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/approve?t=<link+token>&d=approve",
    method="GET",
    headers={},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

var req = URLRequest(url: URL(string: "https://spacebackup.net/account/approve?t=<link+token>&d=approve")!)
req.httpMethod = "GET"
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/approve?t=<link+token>&d=approve");
using var res = await http.SendAsync(req);  // answers 200
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /approve#

Form: t, d (approve, deny or cancel), csrf. Decides and shows the result ("Approved: the requesting device can now restore those backups.").

POST /approve · from openapi.yaml (postApprove)

Auththe web session (cookie sa_session) and the form field csrf (the value of the sa_csrf cookie)
Bodyapplication/x-www-form-urlencoded
csrf string
d string
t string
200OK
400unknown decision (not one of this kind of link's buttons)
unknown decision
403This form has expired. Go back, reload the page and try again.; only the company's owner or an admin may do this (the link's email is no longer the owner or an admin)
This form has expired. Go back, reload the page and try again.
only the company's owner or an admin may do this
only the company's owner or an admin may approve this
404this link is not valid; or the request is gone: no such data-key request, no such member, no such key request, no such key recovery request
this link is not valid
no such data-key request
no such member
no such key request
no such key recovery request
409already decided or no longer possible: this request was already approved|denied, the 409s of the approve routes above (bob@acme.com is active, not waiting for approval, that device was removed, the recovery copy was already released, …)
this request was already <state>
<email> is <status>, not waiting for approval
<email> belongs to another company now
that device was removed
<name> already has the company key
the company has no recovery copy of its key
the recovery copy was already released
410this link was already used or has expired
this link was already used or has expired
503the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it (a device waiting for the company key)
the recovery copy cannot be opened with this service's recovery key; try again after the operator has fixed it
curl
# answers 200; errors 400, 403, 404, 409, 410, 503
curl -sS -X POST 'https://spacebackup.net/account/approve' \
  -H "Cookie: sa_session=$SA_COOKIE" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data 'csrf='"$SA_CSRF"'&d=…&t=…'
Python (stdlib)
import json, os, urllib.parse, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/approve",
    method="POST",
    data=urllib.parse.urlencode({"csrf": os.environ["SA_CSRF"], "d": "…", "t": "…"}).encode(),
    headers={"Cookie": "sa_session=" + os.environ["SA_COOKIE"], "Content-Type": "application/x-www-form-urlencoded"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 403, 404, 409, 410, 503
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let saCookie = ProcessInfo.processInfo.environment["SA_COOKIE"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/approve")!)
req.httpMethod = "POST"
req.setValue("sa_session=\(saCookie)", forHTTPHeaderField: "Cookie")
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"csrf=\#(saCsrf)&d=…&t=…"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 403, 404, 409, 410, 503
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/approve");
req.Headers.TryAddWithoutValidation("Cookie", "sa_session=" + Environment.GetEnvironmentVariable("SA_COOKIE"));
req.Content = new FormUrlEncodedContent(new Dictionary<string, string> { ["csrf"] = Environment.GetEnvironmentVariable("SA_CSRF")!, ["d"] = "…", ["t"] = "…" });
using var res = await http.SendAsync(req);  // answers 200; errors 400, 403, 404, 409, 410, 503
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

A public link is a URL anyone can open in a browser, no app and no account: one photo or video (kind: "item"), or a selection of them (kind: "selection", a page of thumbnails), or a whole album (kind: "album", a page of what the album holds when the link is opened). It is deliberately public until it expires or is revoked: whoever has the URL sees the items. See Public links and the design in docs/public-links.md.

POST /api/links#

Makes a public link.

POST /api/links · from openapi.yaml (postLinks)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json LinkCreate
items LinkItemRequest[]
kind string|null
expiresDays integer|null
title string|null
album string|null
date string|null
ids string[]
days integer|null
never boolean|null
until string|null
201`expires`: when the link stops → LinkView {id: string, url: string, kind: string, title: string|null, device: string, deviceName: string, email: string, created: string(date-time), expires: string(date-time)|null, revoked: string(date-time)|null, views: integer(int64), lastView: string(date-time)|null, state: string, items: LinkItemView[], token: string, albumName?: string|null}
400items (or ids) is required, give album or date, not both, items must name at least one item, a link holds at most 200 items, kind must be item, selection or album, a link of kind item names exactly one item, expiresDays must be 1 to 90, give only one of never, until or expiresDays, until must be a date, yyyy-MM-dd, or an ISO 8601 time with an offset, until must be today or later, until must be later than now, until must be at most 10 years ahead, items[].date must be a date folder, yyyy-MM-dd, album is required for a link of kind album, a link of kind album names the album only (no items, ids or date)
give album or date, not both
items (or ids) is required
items must name at least one item
a link holds at most 200 items
kind must be item, selection or album
a link of kind item names exactly one item
items[].date must be a date folder, yyyy-MM-dd
album is required for a link of kind album
a link of kind album names the album only (no items, ids or date)
<name> is required
<name> is too long
<name> must not contain control characters
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403this device is not registered (devices/register), the album … is not shared with you, only the album's owner or the company's owner or an admin may make a public link to the whole album
the album <name> is not shared with you
not an active member of a company
only the album's owner or the company's owner or an admin may make a public link to the whole album
this device is not registered (devices/register)
404no such album: …
no such album: <albumId>
curl
# answers 201; errors 400, 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/links' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"items":[{"album":"al_x7k2mq9pa4zw3n5c","id":"4F2A-77B1"},{"id":"9C1D-0E3F","date":"2026-10-18"}],"kind":"selection","expiresDays":7,"title":"Las Vegas, day 2"}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/links",
    method="POST",
    data=json.dumps({"items": [{"album": "al_x7k2mq9pa4zw3n5c", "id": "4F2A-77B1"}, {"id": "9C1D-0E3F", "date": "2026-10-18"}], "kind": "selection", "expiresDays": 7, "title": "Las Vegas, day 2"}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 201; errors 400, 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/links")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"items":[{"album":"al_x7k2mq9pa4zw3n5c","id":"4F2A-77B1"},{"id":"9C1D-0E3F","date":"2026-10-18"}],"kind":"selection","expiresDays":7,"title":"Las Vegas, day 2"}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 201; errors 400, 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/links");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"items":[{"album":"al_x7k2mq9pa4zw3n5c","id":"4F2A-77B1"},{"id":"9C1D-0E3F","date":"2026-10-18"}],"kind":"selection","expiresDays":7,"title":"Las Vegas, day 2"}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 201; errors 400, 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

The calling device's links, newest first; ?all=1: every link of the company (owner and admins only). Revoked and expired links stay listed (with their state) for 30 days. A link that never ends has "expires": null, `"never": trueand staysactive` until it is revoked. The company's admin page lists the same links (Public links: Expires Never for those), with a Revoke button.

GET /api/links · from openapi.yaml (getLinks)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
queryall string|null (optional)
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
200OK → LinkListView {links: LinkView[]}
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403only the company's owner or an admin may list every link
only the company's owner or an admin may list every link
not an active member of a company
this device is not registered (devices/register)
curl
# answers 200; errors 401, 403
curl -sS -X GET 'https://spacebackup.net/account/api/links?all=1' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/links?all=1",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 401, 403
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/links?all=1")!)
req.httpMethod = "GET"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 401, 403
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Get, "https://spacebackup.net/account/api/links?all=1");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 200; errors 401, 403
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

A new end for an existing link (iOS request #50). Takes the link's id or its token. An expired link works again (while it is still listed, 30 days); a revoked link stays revoked.

PATCH /api/links/{id} · from openapi.yaml (patchLinksId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
Bodyapplication/json LinkExpiryChange
never boolean|null
until string|null
expiresDays integer|null
days integer|null
200The link as in POST /api/links with its new `expires` (`null` for never), `never` and `state` → LinkView {id: string, url: string, kind: string, title: string|null, device: string, deviceName: string, email: string, created: string(date-time), expires: string(date-time)|null, revoked: string(date-time)|null, views: integer(int64), lastView: string(date-time)|null, state: string, items: LinkItemView[], token: string, albumName?: string|null}
400give one of never, until or expiresDays, give only one of never, until or expiresDays, until must be a date, yyyy-MM-dd, or an ISO 8601 time with an offset, until must be today or later, until must be later than now, until must be at most 10 years ahead, expiresDays must be 1 to 90
give only one of never, until or expiresDays
until must be later than now
until must be at most 10 years ahead
until must be today or later
give one of never, until or expiresDays
expiresDays must be 1 to <maxDays>
bad request: <the JSON parser's message>
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such link
no such link
409the link is revoked; make a new one
the link is revoked; make a new one
curl
# answers 200; errors 400, 401, 403, 404, 409
curl -sS -X PATCH 'https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2" \
  -H "Content-Type: application/json" \
  --data '{"never":true}'
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r",
    method="PATCH",
    data=json.dumps({"never": True}).encode(),
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2", "Content-Type": "application/json"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 200; errors 400, 401, 403, 404, 409
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r")!)
req.httpMethod = "PATCH"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
req.setValue("application/json", forHTTPHeaderField: "Content-Type")
req.httpBody = Data(#"{"never":true}"#.utf8)
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 200; errors 400, 401, 403, 404, 409
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Patch, "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
req.Content = new StringContent("""{"never":true}""", Encoding.UTF8, "application/json");
using var res = await http.SendAsync(req);  // answers 200; errors 400, 401, 403, 404, 409
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

POST /api/links/{id}/revoke#

Stops a link at once (its URL answers 404 from then on, and the PCs refuse its ticket at their next check).

POST /api/links/{id}/revoke · from openapi.yaml (postLinksIdRevoke)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when it was revoked already)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such link
no such link
curl
# answers 204; errors 401, 403, 404
curl -sS -X POST 'https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r/revoke' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r/revoke",
    method="POST",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r/revoke")!)
req.httpMethod = "POST"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Post, "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r/revoke");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

The same as POST /api/links/{id}/revoke. Both take the link's id or its token.

DELETE /api/links/{id} · from openapi.yaml (deleteLinksId)

AuthAuthorization: Bearer <device token> (POST /api/signin/code or /api/signin/poll gives it)
pathid string
headerX-SpaceBackup-Version string (optional) · The app's version (up to 40 characters), recorded as the device's app version.
204(also when it was revoked already)
401Unauthorized
not signed in
not signed in (token unknown or revoked)
403Forbidden
not an active member of a company
404no such link
no such link
curl
# answers 204; errors 401, 403, 404
curl -sS -X DELETE 'https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r' \
  -H "Authorization: Bearer $SPACEBACKUP_TOKEN" \
  -H "X-SpaceBackup-Version: 1.8.2"
Python (stdlib)
import json, os, urllib.request, urllib.error

req = urllib.request.Request(
    "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r",
    method="DELETE",
    headers={"Authorization": "Bearer " + os.environ["SPACEBACKUP_TOKEN"], "X-SpaceBackup-Version": "1.8.2"},
)
try:
    with urllib.request.urlopen(req) as r:  # answers 204; errors 401, 403, 404
        raw = r.read()
        print(r.status, json.loads(raw) if raw else None)
except urllib.error.HTTPError as e:
    print(e.code, e.read().decode())  # {"error": "..."}
Swift (URLSession)
import Foundation

let spacebackupToken = ProcessInfo.processInfo.environment["SPACEBACKUP_TOKEN"]!
var req = URLRequest(url: URL(string: "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r")!)
req.httpMethod = "DELETE"
req.setValue("Bearer \(spacebackupToken)", forHTTPHeaderField: "Authorization")
req.setValue("1.8.2", forHTTPHeaderField: "X-SpaceBackup-Version")
let (data, response) = try await URLSession.shared.data(for: req)
let status = (response as! HTTPURLResponse).statusCode  // answers 204; errors 401, 403, 404
print(status, String(decoding: data, as: UTF8.self))
C# (HttpClient)
using System.Net.Http.Headers;
using System.Text;

using var http = new HttpClient();
var req = new HttpRequestMessage(HttpMethod.Delete, "https://spacebackup.net/account/api/links/x_k3xq7m2pa9fz4w8r");
req.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("SPACEBACKUP_TOKEN"));
req.Headers.TryAddWithoutValidation("X-SpaceBackup-Version", "1.8.2");
using var res = await http.SendAsync(req);  // answers 204; errors 401, 403, 404
Console.WriteLine($"{(int)res.StatusCode} {await res.Content.ReadAsStringAsync()}");

Served by the account service at https://spacebackup.net/l/<token> (nginx location /l/), no sign-in:

URLWhat
/l/<token>an item link: the file itself (Content-Type from its name, inline for photos and videos), or its single view when a browser asks for HTML (Accept: text/html); a selection: the gallery (a grid of thumbnails, each linking to its single view)
/l/<token>/<n>item n (from 0) of the link
/l/<token>/<n>/thumbits thumbnail (JPEG)
/l/<token>/<n>/jpga HEIC (HEIF, TIFF, RAW) photo as JPEG, converted by the PC that serves it (full size, orientation applied, no location data; named <stem>.jpg); any other item as it is
/l/<token>/v/<n>the single view of item n: an HTML page with that item open (its own URL to share or reload)
/l/<token>?page=<n>an album link: the gallery of what the album holds now, 60 per page (page from 1), oldest first, with the number of items not shown because no plain copy is on the PC serving it
/l/<token>/a/<key>an item of an album link (key: 16 hex characters, from its page; it names no device or id)
/l/<token>/a/<key>/thumb, /l/<token>/a/<key>/jpgits thumbnail (JPEG); its JPEG, as above
/l/<token>/v/<key>the single view of an album link's item (on the album's page that holds it)

Service settings#

For people running their own account service: the settings file is /etc/spaceaccount/settings.json (or spaceaccount --config <file>). The values that change what an integrator sees:

SettingDefaultEffect
publicUrlhttps://spacebackup.net/accountthe base of every mailed link
recoveryDelayHours24how long a company-key recovery waits before release
keyHandoverWaitSeconds120how long a new device waits for a handover before the owner and admins are mailed
secureCookiestruethe Secure flag on cookies (off only for local tests)
relay.freeGbPerMonth5free relay GB per company per month; null = unlimited
appStoreUrlhttps://spacebackup.net/download/where an album invitation sends someone without the app
assistant.devicePerMinute, assistant.companyPerHour20, 200the assistant's abuse guard (there is no daily limit)
assistant.pricesHaiku 5.5, Haiku 4.5, Sonnet 5.5, Opus 5.5 list pricesUSD per million tokens (input, output, cacheRead, cacheWrite) by model, for the cost on the usage pages; a model missing here costs 0
alexa.skillIds, alexa.vendorIdsnonethe Alexa skill's skill ids (requests of any other refused) and the Amazon vendor ids its account-linking redirects may name (none: linking refused)
usage.operatorsnonethe emails that may open /account/operator
usage.rawDays, usage.dailyMonths90, 13how long raw usage rows and daily totals are kept
usage.maxEvents, usage.reportsPerHour500, 60events in one POST /api/usage, and reports an hour per device
push.windowMinutes, push.gatherSeconds5, 30album-add push coalescing
links.publicBasehttps://spacebackup.net/l/the base of a public link's URL
links.defaultDays, links.maxDays7, 90a public link's expiry in days (until up to 10 years and never are apart)
links.perLinkPerMinute, links.thumbsPerLinkPerMinute, links.perIpPerMinute300, 1200, 600requests to the public pages (per link: pages and files; per link: /thumb; per client address: all)
links.relayAddressrelay.spacebackup.net:47900the relay the service reaches the PCs through

Secrets (the Stripe key and webhook secret, the assistant's API key, the Alexa skill's client secret if one is used (SPACEBACKUP_ALEXA_CLIENT_SECRET), the SMTP password, the APNs key, the recovery key and the relay secret) come only from the environment or from files readable by the service; they are never in the settings file or the repository. Without a Stripe key payments are off (paymentsEnabled: false); without an assistant key the assistant answers 503; without an APNs key pushes are dropped (the inbox still works).

Errors and limits#

The error shape#

Every error of a /api/… route is JSON:

{"error": "only the company's owner or an admin may do this"}

The error text is a plain sentence that can be shown to a person. Extra fields where said:

FieldOn
attemptsLeft (int)400 wrong sign-in code
keyVersion (int)409 on key/deliver and company/key: the company's current key version
code (string)invite_needed (409 company/join), name_invalid (400 devices/register), name_taken (409 devices/register), name_clash (409 PUT devices/state)

A body that is not valid JSON, or of the wrong shape, answers 400 {"error": "bad request: <details>"}. Errors of the web pages are HTML pages with the same status codes.

Status codes#

StatusMeaning
200done; the body is the answer
201done, something new was made (a group, an album, a share, an invitation, a remove request)
204done, no body
302(web pages) go to the Location
400bad input: a missing or invalid field, JSON that does not parse
401no token, or the token is unknown or revoked: sign in again
403not allowed: role, not an active member, no registered device, the wrong device, a missing CSRF token
404unknown, or not yours to see (the service does not tell the two apart)
409conflict: already a member, name taken, the key changed, already decided
410gone: a sign-in or invitation expired or was used, a mailed link was used or expired
413the request body is too large
415PUT /api/devices/state without Content-Type: application/json
429a rate limit; try again later
500an unexpected server fault (a bug; reported in its log); no route answers it on purpose
502(web) Stripe could not be reached for a checkout
503the sign-in mail could not be sent; the assistant is unavailable; (web) payments are not set up; (webhook, relay report) not set up; the recovery copy of the company key does not open with the service's recovery key (an operator fault, reported in its log; try again later)

Size limits#

WhatLimit
Request body1 MB (413 beyond)
PUT /api/devices/state body12 MB; sealed up to 8 MB decoded
sealed, recovery, wrapped (key boxes)64 KB of base64
Email addresses3–254 characters
Company names, album names, sign-in device names1–100 characters
First name, last name40 characters each
Group names40 characters; 500 members; 200 groups per person
Device labels64 characters
Machine names (devices/register)1–64 characters
Album destinations8 per album
Album share in one request100 addresses
Album item and cover ids200 characters
notifications page1–200 (default 50); notifications/read at most 1,000 ids
notifications/waitat most 55 s (default 25 s)
people?q=200 characters; 50 results (all=1: 500)
Assistant text1,000 characters
POST /api/usage500 events; outcome 32 characters

Rate limits#

WhatLimitBeyond
POST /api/signin/start (and the web sign-in)per email: 5 per 15 minutes and 20 per day; per client IP: 30 per hour429 too many sign-in requests; try again later
Wrong sign-in codes5 per sign-in requestthe request is dead: 410
GET /api/people60 per minute per person429 too many searches; try again in a minute
Album invitations (outside the company)200 per sender per 24 hours429 too many invitations today (at most 200 a day)
POST /api/albums/{id}/remove-requests50 new requests per person per 24 hours (repeats not counted)429 too many remove requests today (at most 50 a day)
POST /api/assistant20 a minute per device and 200 an hour per company (an abuse guard; no daily limit)429 Too many assistant requests in a short time (…). Please wait a minute and try again.
POST /api/usage60 reports an hour per device429 Too many usage reports from this device (at most 60 an hour). …
Album-add pushesat most one per album per person per 5 minutes (adds are summed)coalesced, not refused
Public link pages and files (/l/…, single views and JPEG conversions included)300 per minute per link (thumbnails apart: 1200 per minute per link); 600 per minute per client IP over all links429

The client IP used for the sign-in limit is the address the public web server saw. The service's logs never hold tokens, codes, secrets or sealed boxes.