Docs Home Return to Homepage
Get Started Login

Crates

On this page

Use a full access key, or a key scoped to the crate. Every GET needs read access; everything else needs write.

Names

What Named by Example
Crate its handle c7xk2m9p
Folder its name photos
Master login the crate’s handle c7xk2m9p
Sub-user handle, dash, name c7xk2m9p-nas
SSH key its SHA256 fingerprint SHA256:3yQ…

The master login reads and writes every folder. A sub-user reaches only the folders it’s given, read-only or read-write. SSH keys are added to the crate once, then accepted login by login.

Passwords

Passwords are generated, never chosen. Adding a sub-user or asking for a new password returns it once; it can’t be read back later.

Units

  • size_gb: a crate’s size, or a folder’s cap, in GB.
  • used_gb: what’s stored, in GB. Updated through the day, not live.
  • used_bytes (snapshots): what deleting the snapshot would free, in bytes.

Errors

A change reaches the crate’s storage node before it’s saved, so a call that fails has changed nothing.

Status Code When
400 operation_rejected The storage node refused the change. error says why.
400 limit_reached The plan’s sub-users or snapshots, or 10 domains, are used up.
403 scope_denied The key can’t read, or can’t change, this crate.
403 service_inactive The service is suspended or cancelled: the crate can be read, not changed.
403 not_in_plan A snapshot change on a plan without snapshots.
404 not_found The crate isn’t on this account.
502 upstream_unavailable The storage node couldn’t be reached. Try again shortly.

Each endpoint’s page lists the errors it can return.

List Crates

GET /crates Returns the account's crates, by handle. Scoped keys only see crates they can read. Response [ { "handle": "c7xk2m9p", "hostname": "c7xk2m9p.crates.works...

Get Crate

GET /crates/{handle} One crate, as List Crates shows it. used_gb is null until the crate's usage has been read. folders is how many folders it has. snapshots.kept_by_schedules is how many snapshots it...

List Folders

GET /crates/{handle}/folders The crate's folders, by name. Every login finds the folders it can use at /data/<name>. size_gb is a folder's cap (null: none, up to the crate's size) and used_gb wh...

Add Folder

POST /crates/{handle}/folders Adds an empty folder. Only the master login can use it until sub-users are given access, with Set Folder Access or a sub-user's folders. 422 when the name is taken or isn...

Update Folder

PUT /crates/{handle}/folders/{folder} Changes a folder's size cap. A cap below what the folder holds is refused with 400. A folder can't be renamed. Parameters Field Type Required Description size_gb...

Delete Folder

DELETE /crates/{handle}/folders/{folder} Deletes the folder with everything in it and its snapshots, and its snapshot schedules. Every login loses it and those using it are disconnected; a sub-user le...

Set Folder Access

PUT /crates/{handle}/folders/{folder}/access Sets which sub-users can use a folder, in one change: each one listed gets read, write or none, and the rest keep what they have. A sub-user whose access c...

List Logins

GET /crates/{handle}/logins The master login first, then the sub-users by name. folders is what each login can use: read lists and downloads, write also adds, changes and deletes. The master reads and...

Add Sub-user

POST /crates/{handle}/logins Adds a sub-user named <handle>-<name>, with the folders it can use. Returns its password, once. Without a folder it's kept but can't sign in until it's given o...

Update Login

PUT /crates/{handle}/logins/{login} Changes only the fields given; the rest keep their current values. Takes the fields of Add Sub-user except name (a login can't be renamed), plus enabled: false paus...

New Password

POST /crates/{handle}/logins/{login}/password Generates a new password for the login and returns it, once. The old password stops working at once; SSH keys are unaffected. Works for the master login t...

Delete Sub-user

DELETE /crates/{handle}/logins/{login} Deletes the sub-user. The folders it could use stay, with their files. The master login can't be deleted (400). Response { "message": "Sub-user de...

List Crate SSH Keys

GET /crates/{handle}/keys The SSH keys loaded onto the crate, oldest first, each with the logins that accept it. A key is loaded once and each login ticks the keys it accepts; a key no login accepts s...

Add Crate SSH Key

POST /crates/{handle}/keys Loads a public key onto the crate, accepted by the logins named (none is fine: logins can accept it later). ssh-ed25519, ecdsa-sha2-nistp256/384/521, security keys (sk-ssh-e...

Update Crate SSH Key

PATCH /crates/{handle}/keys/{fingerprint} Changes a key on the crate. Send only what changes. A new public_key rotates it: every login that accepted the old key accepts the new one instead, and their...

Remove Crate SSH Key

DELETE /crates/{handle}/keys/{fingerprint} Takes the key off the crate, and so off every login that accepted it. {fingerprint} is the key's fingerprint as listed, with or without SHA256:. Its / and +...

List a Login's SSH Keys

GET /crates/{handle}/logins/{login}/keys The crate's keys the login accepts, oldest first. Keys the login keeps in its own /data/.ssh/authorized_keys aren't listed here. Response [ { "fingerprint...

Accept an SSH Key

POST /crates/{handle}/logins/{login}/keys Has the login accept a key. A key the crate already has (matched by fingerprint) is ticked for the login; a new one is loaded onto the crate on the way. ssh-e...

Stop Accepting an SSH Key

DELETE /crates/{handle}/logins/{login}/keys/{fingerprint} The login stops accepting the key; the key stays on the crate for the other logins. {fingerprint} is the key's fingerprint as listed, with or...

List Snapshots

GET /crates/{handle}/snapshots Read live from the crate's storage node, newest first. kind is auto (taken by a schedule, with its schedule) or manual. target is crate for every folder at once, or the...

Take Snapshot

POST /crates/{handle}/snapshots Takes a snapshot now and returns it. Snapshots use the crate's space. The plan's snapshot limit covers scheduled and manual ones together, so a manual snapshot needs ro...

Delete Snapshot

DELETE /crates/{handle}/snapshots/{name} Deletes the snapshot and frees its used_bytes. A schedule's snapshots can be deleted too; the schedule takes its next one as usual. Response { "message&qu...

Roll Back to Snapshot

POST /crates/{handle}/snapshots/{name}/rollback Puts the snapshot's target (every folder, or one folder) back as it was when the snapshot was taken. Changes since then are lost, and newer snapshots of...

List Snapshot Schedules

GET /crates/{handle}/snapshot-schedules The crate's schedules: whole-crate ones first, then each folder's (target is its name). Times are UTC. weekday (0 is Sunday) is set for weekly schedules only, m...

Replace Snapshot Schedules

PUT /crates/{handle}/snapshot-schedules Replaces all of the crate's schedules with the ones sent, in one change; {"schedules": []} removes them all. Snapshots already taken stay until you de...

List Domains

GET /crates/{handle}/domains The crate's own domains: subdomains of the customer's, each pointed at the crate with a CNAME to cname_target. An active domain is served over WebDAV and FTPS, with a cert...

Add Domain

POST /crates/{handle}/domains Adds one of the customer's subdomains to the crate. Point it at the crate first, or after, with a CNAME record to the crate's cname_target (Get Crate's hostname); on Clou...

Check Domain

POST /crates/{handle}/domains/{hostname}/check Checks a domain's CNAME now, rather than waiting for the next check: a pending domain that points at the crate is served from now on. DNS can take a whil...

Remove Domain

DELETE /crates/{handle}/domains/{hostname} Removes a domain: it stops serving the crate at once. The crate's files aren't touched, and the domain can be added again later. Response (200) { "messa...

Snagged on something?

Our sysadmins answer tickets around the clock.