Skip to main content
Workspaces give your app the B2B/SaaS collaboration layer: an account/team that people are invited into, with granular per-member authority and optional self-nesting (org → client → project). Unlike Spaces (a community shape), Workspaces is invite-only with an owner apex and a capability/permission model.
Requires the workspaces bundle. See Bundles to add it.
The React/React Native surface is a set of plain hooks re-exported from @sublay/core (there is no WorkspaceProvider). The one stateful hook is the workspace list, useWorkspaceList, which keeps each list in the Redux store under a listId.

Key concepts

  • capabilities vs permissions — Sublay enforces the closed capabilities vocabulary; it is blind to your opaque permissions.
  • Ownership — one owner per workspace (the creator); ancestor owners are gods over descendants.
  • Reach & the wall/door rule — strict per-node by default; opt-in downward reach via the child-owned inheritsFromParent flag.
  • Invitations — identity-matched + verified-email, no token.

Project settings

Three project-level settings configure this bundle. They live under workspaces in your project’s settings blob — set them in the dashboard under Settings → project settings, or via the update-project-settings endpoint. All three are absent by default, and absent means the strict behavior in the table below.
Project settings
Set workspaces.inviteAcceptUrl before you ship invitations. It has no default, so a freshly added bundle has none — and an invitation is delivered as an email whose only call to action is that deep-link.Because of that, Create Invite and Resend Invite refuse outright when it is unset, with 409 workspace/missing-invite-accept-url. This applies even when the invitee already has an account — the in-app inbox is not a substitute for the emailed link, so the invite surface behaves the same for every invitee. Nothing is persisted and no email or webhook is emitted on the refusal; configure the setting and retry the identical request.
The accept link carries nothing secret. Acceptance is identity-matched — the signed-in caller must be the invitation’s target and have a verified email — so there is no token to leak and no domain allowlist to maintain. The email is a plain nudge into your app. See the acceptance model.

What a client app can do

All 22 workspace endpoints are callable from a browser or mobile app with a normal signed-in user’s bearer token — including every management operation: editing a workspace, deleting it, transferring ownership, flipping the inherit flag, editing a member’s capabilities/rank, removing a member, offboarding across a subtree, and the full invite lifecycle (create, list, revoke, resend). Every one of these is exposed as a @sublay/core hook and as a @sublay/js function. A members-management panel needs no server-side code and no hand-rolled fetch. With a client token, every endpoint in the bundle resolves the actor from that token and authorizes the action against that user’s own standing on the workspace. Most routes enforce this in guard middleware ahead of the controller; the self-scoped ones (create a workspace, list your own, list the ones you share with another user, read your own membership, leave, accept or decline an invite, read your own invites or your own authority) carry no guard middleware and authorize inside the controller instead. The one endpoint that does not require a token at all is the single-workspace read, GET /workspaces/:workspaceId — it takes an optional token and returns the workspace when visibility permits. Everything else requires a signed-in user, and whether the call then succeeds depends on their standing:
Your own reads are gated too. GET /workspaces/:workspaceId/authority/me and GET /workspaces/:workspaceId/members/me answer a signed-in user with no relation to the workspace with 404 workspace/not-found, as every other workspace route does, so no route confirms that a workspace exists to someone who can’t see it. For a UI gate, treat that 404 as “no standing here”.
Your own membership is /workspaces/:workspaceId/members/me: GET to read your standing, PATCH to edit your title (no capability needed; nothing else on a member’s own membership is editable there, while the workspace’s owner edits their title and metadata there and nowhere else), DELETE to leave. me is the acting user — the token’s user, or the user a service key names in actingUserId. The /workspaces/:workspaceId/members/:userId routes (read, edit, remove, remove from the subtree) act on other members and refuse your own id with 400 workspace/own-member-id.
Seeing the roster and seeing people’s authority are two different tiers. Any relation may read the roster and one member’s standing — who is there, their reasons, title and metadata. But the authority-bearing fields — capabilities, permissions, rank, relativeRank — are omitted (absent, not null) unless the caller holds one of the four people-operating capabilities (invite, remove-member, edit-member-access, edit-member-profile) or is the owner / an ancestor-owner.A caller always sees their own — their own roster row, their own standing (GET /workspaces/:workspaceId/members/me), and the authority read, which is inherently a self read and never fenced. So a plain member can always discover their own access; they just cannot enumerate everyone else’s. A service key reads the roster and member standing only by naming an actingUserId (a key that names nobody gets 400 workspace/missing-user-id), and is fenced exactly as that user is — see Acting on behalf of a user. Type all four fields as optional on client surfaces. (relativeRank is fenced with rank because it is rank minus a number the caller already knows — leaking it would leak rank exactly.)The gate is answered per node, not once per request. Every row a response returns is judged against your resolved standing on the workspace that row belongs to — including capabilities reaching in through an unbroken open inherit chain, and ownership from any ancestor, but not authority a sealed node blocks. The place this bites is include=descendants on the roster: a descendant-member row is judged on its own node, so holding invite on a parent does not unfence a sealed child’s ranks and capabilities. Being allowed to see a descendant’s roster (sealing) and being allowed to see its members’ authority (the fence) are two tiers, and passing the first does not pass the second.
What actually needs a service key: acting on behalf of a different user. Every endpoint accepts an actor field, actingUserId, so a service key can perform an action as some named user. That parameter is node SDK only — @sublay/core and @sublay/js never expose it, because a client’s actor is always the token’s own user. (There is no client-side strip: a call that hand-writes actingUserId past the types is bound by the same rule as any user token — any actingUserId, even the token’s own user, is rejected with 400 workspace/acting-user-not-allowed.) This is the only difference in reach between the client SDKs and the node SDK for this bundle; it is not a restriction on which operations a client may perform. The rule that governs it is below.Note that a target-identifying userId is a different thing and is fully available on the client: the invitee userId on useCreateWorkspaceInvite, and the targetUserId path param on the member hooks.

Acting on behalf of a user

One rule governs every workspace endpoint, with no exceptions:
If a request acts as Bob, then for all intents and purposes it is Bob. Reads and writes alike. The credential decides only whether you may name an acting user at all (a service key may; a user token never does) — never how much authority that user has.
A service key therefore acts as a named user, actingUserId: "<uuid>", and gets exactly that user’s authority: their capabilities, their rank, their visibility, their fencing — the same answer their own token would get. There is no mode in which a key acts as the app with authority of its own:
“Names nobody” means the field is absent, not falsy. actingUserId: "" and actingUserId: null are a caller attempting to name someone, and they are a 400 for a malformed actor. So actingUserId: user?.id ?? "" — the shape a backend reaches for naturally — fails with a message about the field itself rather than about a missing user. See Shapes the server rejects.
A plain user token has only one mode: itself. It must not send actingUserId at all: any value, even the token’s own user id, is a 400 workspace/acting-user-not-allowed. The field is never silently ignored for a user token. Naming an acting user is not a hint or an audit field. It binds: if the named user would be refused, so are you. That covers the capability gate, the owner-only gate, the rank guard, no-escalation, roster/standing fencing, and the visibility 404 on a workspace the named user has no relation to.

Acting with full authority

Backends that need to do something a normal member could not — reset a team, seed an org, repair a bad grant — act as the workspace owner:
The owner resolves the full capability vocabulary and apex rank, so nothing is out of reach, and the resulting webhooks carry that user id.
This is naming, not authentication. A service key may name any user in the project. The server checks that the id is a user in this project (404 workspace/user-not-found otherwise), so a deleted user can’t be named, but nothing more: the user id on a webhook tells you what the caller claimed, with the same trust level as the key itself. It is not evidence a person acted.If you need attribution you can actually trust, record it in your own system at the point you decide to make the call.
The node SDK types actingUserId as required on every workspace function, fetchWorkspace included: a key always uses it, since naming nobody there only ever gets the anonymous 404.

Shapes the server rejects

The shapes below are refused outright rather than ignored, all of them 400s. Most carry workspace/invalid-body or workspace/invalid-query, depending on which side of the request the offending field sat on; a field in the wrong place carries workspace/body-not-allowed or workspace/wrong-location, and a malformed path parameter carries workspace/invalid-params. Where each field goes is decided by the HTTP method, as on the rest of the API: a GET or DELETE takes every field, actingUserId included, in the query string and no body; a POST or PATCH takes every field in the JSON body. The project is read from the URL path only. They come from three layers, and knowing which one answered tells you what to fix:
  1. The placement checks, first of all. A body on a GET or DELETE is 400 workspace/body-not-allowed. actingUserId sent in the query string of a POST or PATCH is 400 workspace/wrong-location. Any other body field sent in a write’s query string is also 400 workspace/wrong-location, but that one comes from the route’s body schema (layer 3), so it is reported only after the gate and the acting-user checks below.
  2. A gate, mounted ahead of every route on the bundle. It reads the raw request, so it behaves identically whichever endpoint you call and whatever that route declares. It refuses a userId, a near-miss spelling of actingUserId, and (when a key names nobody) a body no parser read.
  3. Each route’s own schema. A GET or DELETE validates its query string; a POST or PATCH validates its body. Every schema declares exactly the fields its endpoint accepts, and a top-level field it does not declare is refused, not stripped. On a GET or DELETE two checks run just ahead of the schema — the length limit and the cache-buster rule below — and the first reads the raw query string rather than the parsed one. On a POST or PATCH, query parameters other than the ones refused above are ignored.
Between the two, on the routes that check the acting user’s standing before anything else — editing, deleting or transferring a workspace, its inherit flag, the four invitation routes, and the member routes (listing members, reading, editing or removing another member, editing your own title, removing one from the subtree) — that check runs after the gate and before the schemas. It refuses a malformed actingUserId, a key that names nobody (400 workspace/missing-user-id), a workspace that doesn’t exist or that the acting user has no relation to (404 workspace/not-found, the two alike) and, on a workspace the acting user can see, a missing role or capability (403 workspace/forbidden, for example Owner access required). So on those routes a request that is refused there never reaches its schemas, and an undeclared field is only reported once the request names a user who may perform it. The one exception is editing your own title: it refuses capabilities, permissions, rank and relativeRank (400 workspace/unsupported-param) before the standing check, for any signed-in caller or service key; metadata from anyone but the owner gets the same 400 after it, on a workspace the acting user can see.
A GET or DELETE takes actingUserId and every other field in the query string, so any request body is refused, whatever it holds: a JSON object with keys, a non-empty array, or a non-JSON payload such as multipart or text/plain (then params is omitted). An absent body and {} pass. Send ?actingUserId=<id> instead.
A POST or PATCH reads actingUserId and every field it declares from the JSON body. Sent in the query string instead, the field is refused with its name in param, rather than silently missed.
That is the text a service key gets. A user token, or a request with no credentials, can’t send actingUserId either, so it gets:
On a workspace route userId never names the caller — it addresses the request target. The rejection is unconditional: it fires for user tokens and keys alike, on every route, and even when a correct actingUserId is also present, because a request carrying both is malformed regardless. It is checked at the gate, on the raw request, ahead of any route’s own schema.One exception: the invitee userId in the body of Create Invite, where the field has always meant the target. The carve-out covers that body field and nothing else — a query ?userId= is refused on Create Invite exactly as it is everywhere else, because no workspace route reads one, so there it can only be the stale actor spelling. The path parameter :userId (on the member routes) is untouched — that is the target too.
The actor is read by presence, not truthiness. "", null and a non-UUID string are all a caller attempting to name someone, and they fail here as a malformed actor. On a route with no capability guard the rejection comes from the schema instead and reads actingUserId: Invalid UUID format — same status, same code, same outcome.This is the trap behind actingUserId: user?.id ?? "": the error names the field you sent rather than reporting a missing user. Only an absent key (or undefined, which is indistinguishable from omission) means the request names nobody.
A key that differs from actingUserId only in capitalization — actingUserID, ActingUserId, actinguserid — gets this precise message rather than the generic one below. It fires on every request, user tokens included, where a typo cannot escalate anything but still means your stated intent was silently dropped.This is message quality, not a second line of defence: any other misspelling (acting_user_id, actingUseId, ACTING-USER-ID) is refused too, one accordion down, as a field the endpoint does not declare.
Every workspaces endpoint declares its fields exactly and refuses a top-level field it does not declare, for every caller: in the query string of a GET or DELETE (workspace/invalid-query), and in the body of a POST or PATCH (workspace/invalid-body). Two or more at once are named together — Unrecognized keys: "onBehalfOf", "impersonate" — and param names the first. The query string of a POST or PATCH is not a field channel: a field the route reads from the body is workspace/wrong-location there, a userId or a near-miss spelling of actingUserId is refused by the gate, and any other query parameter is ignored.That is a categorical rule, not a list of bad names. onBehalfOf, impersonate, acting_user_id, ACTING-USER-ID, actingUserId with a trailing space, requestId, traceId, sort — none of them is a field of any workspaces route, so all of them fail at the wire, whatever they carry. The rule is the same for a service key and for a signed-in user: a request the API cannot fully read is answered rather than half-honored.Two consequences worth designing around:
  • Send only the documented fields. The SDKs pass your props object to the request body as-is, so createWorkspace({ ...orgTemplate }) carries every extra key orgTemplate holds into the request and fails. Name the fields you mean; put your own data in metadata, which is opaque to Sublay and accepts any JSON.
  • A field this API declares is never judged by its name. username on Create Invite, newOwnerId on Transfer Ownership, userId as an invitee — all real fields, all accepted on their own terms.
On a GET or DELETE, two query parameters are the exception: _ and _t, the automatic cache-busters some HTTP clients append, are dropped before the request is read. Nothing else is reserved — in particular tracing and correlation identifiers are not, because distributed tracing propagates in HTTP headers (traceparent, X-B3-*, X-Amzn-Trace-Id), never in the query string.
A workspaces GET or DELETE whose raw query string holds 1,000 or more &-separated segments is refused before its parameters are checked against the route’s schema. The most any workspaces request may carry is 999; the largest query vocabulary on the bundle is five parameters, so no real call comes near it.This is a rule about the query string’s length, not about which names are in it. The parser’s budget is spent per &-separated segment, and a segment that parses to nothing spends it just the same — so 1,000 bare ampersands (?&&&…), 1,000 copies of __proto__=1 (a name the parser discards on sight, leaving no key behind), and 1,000 copies of an ordinary declared parameter such as include= all reach the limit identically and are all refused identically. Which names you used has nothing to do with it, and neither does whether any of them is reserved.What makes the limit worth a rule is that the parser truncates silently: past the budget, everything beyond it is discarded with no error and no trace, and actingUserId goes with it. A silently dropped actor turns a request its caller believes is scoped to one person into one that names nobody. Counting segments on the raw URL is the only rule that can close that — how many segments you sent is not a property of any field name, and after truncation there is nothing left in the parsed request for a schema or an allowlist to inspect.
The two cache-busters are stripped before the strict schema runs, so no schema ever sees the shape they arrived in — this rule is what stands in for one on those two names. Each must arrive exactly once, as a scalar: ?_=1699000000 passes, ?_=1&_=2 (an array) and ?_[a]=1 (an object) do not. Repeating a declared parameter needs no rule of its own: its schema expects a single value, receives an array, and refuses it.This is a rule about the shape those two names arrive in, and it is not what keeps a long query string from losing actingUserId — a query string long enough to be truncated is refused by the length limit above, whatever names it uses, and that check runs first.
Sublay parses application/json and nothing else. A body sent as text/plain, application/x-www-form-urlencoded or application/vnd.api+json is read off the wire and thrown away — so an actingUserId inside it never reaches the server, and the request names nobody through no fault of its spelling. This is the one shape the schemas cannot catch: with an unparsed content-type the server is handed an empty body, which has no unrecognized key in it.This applies to a POST or PATCH; a GET or DELETE takes no body at all (see the first accordion).This is the fetch() default. fetch(url, { method: "POST", body: JSON.stringify({ actingUserId }) }) with no headers sends text/plain;charset=UTF-8. Set "Content-Type": "application/json". Client libraries that set it for you — axios, the Sublay node SDK, @sublay/js — never hit this.Detected by media type, not by “is the body empty”: a legitimate {} sent as JSON is indistinguishable from a discarded body after the fact, so an empty JSON body and a bodiless request both pass.
Every :workspaceId, :userId and :inviteId on the bundle is checked for UUID shape before the route runs, so a malformed one is a plain 400 rather than a 500 echoing driver internals. The message names which parameter — workspace id, user id, invitation id.On GET, PATCH and DELETE /workspaces/:workspaceId/members/me the me segment is a literal rather than a :userId, so it is never UUID-checked — the :workspaceId still is.
Why this bundle is stricter than the rest of the API. Elsewhere in Sublay an undeclared field is dropped and the request proceeds. Here it is refused, so that an actor lost on the way is reported as what it is.A caller who writes onBehalfOf: "<bob>", or acting_user_id, or spells the field correctly inside a body no parser read, believes the request is scoped to Bob. The server never sees Bob, so the request names nobody, and it is never carried out as anyone. A near-miss spelling and an unread body are refused at the gate with an error that points at the cause. Any other stray field is refused by the route’s schema: on the routes that check the acting user first, a key that named nobody gets 400 workspace/missing-user-id before that, and the stray field is reported once a user is named.Guessing which stray fields “look like” an actor cannot work: an open input space can always be shown a name nobody enumerated. Refusing categorically fails the other way — a field we forgot to declare is a 400 on first use, in development, fixed the same day.
The guarantee covers TOP-LEVEL keys. State it with that scope rather than as “unknown fields are impossible”:
  • metadata is caller-owned JSON and is never inspected, so {"metadata":{"actingUserId":"<bob>"}} parses and names nobody (so a key gets 400 workspace/missing-user-id, or the anonymous view on Fetch Workspace). That is correct — metadata is your data — but it is not an actor channel.
  • A nested or wrapped actor is refused, not ignored — the wrapper itself is an undeclared top-level key: { data: { actingUserId } } and ?ctx[actingUserId]= come back 400 Unrecognized key: "data" / "ctx", and an array-wrapped body is 400 Invalid input: expected object, received array. On the routes that check the acting user first, a key that names nobody at the top level gets 400 workspace/missing-user-id instead, before the schema sees the wrapper.
Spell actingUserId at the top level and none of this applies.
The content-type rule is the one asymmetric check — deliberately. It applies only when a service key named nobody. Under a user token, or a key that did name an actor, a text/plain body is merely an empty one, exactly as on every other bundle.The reason is what a dropped body could mean on each path. Under a token the actor comes from the token no matter what you send, so nothing lost in transit can change who is acting. Under a key naming nobody, a body the server could not read is exactly the shape of an actor it failed to receive: one missing header, and a request the caller believed was bound to one person names nobody. The error says so, rather than a bare missing-user error.Everything else on this page — the userId rejection, the undeclared-field rule, the cache-buster rule — applies uniformly to every caller.
Don’t confuse these 400s with the missing-actor 400. Two different failures, two different codes, checked in a fixed order.
  • workspace/invalid-body / workspace/invalid-query — the request is malformed. It carries a userId, a field the endpoint does not declare, an unreadable body, a bad actingUserId, or a query string that is too long or repeats a cache-buster.
  • workspace/missing-user-id — the route’s own rule. On every route but Fetch Workspace a key must name someone. Nothing about the request’s shape is wrong; it is simply an operation that has to belong to a person.
The placement refusals (workspace/body-not-allowed, and workspace/wrong-location for actingUserId) come first, then the gate’s (a userId, a near-miss spelling, an unread body). Another body field in a write’s query string is workspace/wrong-location from the body schema, so it is ordered with the schema refusals. After that the order depends on the route:
  • On the routes that check the acting user first (see the layers above), workspace/missing-user-id comes before the schema refusals: a key with no actingUserId that also carries an undeclared field, an over-long query or a repeated _, gets workspace/missing-user-id, and the malformed part is reported once a user is named.
  • On the other routes, such as POST /workspaces, the schemas run first: a key with no actingUserId and a clean request gets workspace/missing-user-id, but the same call carrying an undeclared field gets workspace/invalid-body instead, and the missing-actor error appears once the request is otherwise well formed.
Fix what the message names, then send again.Read the code, not the status: both are 400, and only the code tells you whether to add an actor or repair the request.

Consequence: accepting an invite on someone’s behalf

acceptWorkspaceInvite is bound like everything else, so a backend auto-join flow must satisfy the invitee’s own gates:
  • the invitation must be actually addressed to the named user (by userId, or by an email that matches their account) — accepting Alice’s invite while naming Bob is a 404 workspace/invite-not-found;
  • the named user’s email must be verified — otherwise 403 workspace/email-not-verified.
The same two gates apply to declineWorkspaceInvite. There is no key bypass for either: ownership and membership have exactly three doors (create, accept an invite, receive a transfer) and all three enforce verification identically.

Consequence: a tier cannot grow itself

Rank is strict — you may only act on, and invite at, a rank strictly below your own (smaller number = more senior). So a rank-5 manager can mint rank 6, 7, 8… but not another rank 5. Minting a peer requires someone above that tier: If your “add a manager” button is server-driven, act as the owner for it. The floor applies only to an actor with a direct member row on the workspace, so it is skipped for an owner or ancestor owner, and for a cross-node reach holder with no direct row. A key always names its actor on these routes, so it faces exactly that actor’s floors.

Choosing a rank

Almost every rule the ladder enforces is relative — act only on someone strictly below you, assign only strictly below yourself (minting rank 0 is the one absolute exception, below) — so rank can be named in either coordinate, on Create Invite and Update Member alike:
The same two fields exist on the @sublay/js and @sublay/node equivalents — this is a server-side rule, not a hook convenience. The two are mutually exclusive: sending both is a 400. Storage stays absolute — a relative offset is resolved to a number at write time and the member row holds that number. Reads return both. The roster and member-standing reads each carry rank (absolute) alongside relativeRank (that member’s position as an offset from you, where -3 means “three rungs above you”). So there is no “write 2, read 5” asymmetry to reconcile — you can read back in the same coordinate you wrote in. The authority read carries rank only: its subject is you, so an offset from yourself could only ever be 0.
relativeRank: 1 is the happy path, and the invite default. Omit both rank fields on an invite and the server applies relativeRank: 1 — one rung below the inviter. That is well defined for every actor (an inviter with no member row here anchors at apex, so their default lands on rank 0) and, by construction, it can never fail the rank floor. There is no equivalent default on Update Member: omitting both there means rank unchanged, so editing someone’s capabilities never quietly moves them on the ladder.

The anchor is your member row, not your job title

An offset is measured from your own rank on this workspace if you hold a member row here, and from apex (one step above rank 0) if you do not. Owners, ancestor owners and reach holders normally have no row on the node in question, so they normally anchor at apex — but that is a coincidence of the common case, not the rule. An ancestor owner who also sits in this node’s roster measures from that row: Alice owns root and is rank 3 on child, so on child her relativeRank: 1 resolves to rank 4, and she reads child’s rank-0 member back as -3. See rank semantics. One consequence worth knowing: because an in-ladder anchor is >= 0 and a write offset is >= 1, a direct member can never mint rank 0 through the relative form — the arithmetic simply cannot reach it. The absolute form does not need a special case either. Naming rank: 0 outright is refused by the ordinary assign rule, which requires a strictly larger number than your own: an actor with a member row here is at rank >= 0, and nothing is strictly below 0. They get 403 workspace/insufficient-rank — “You may only set ranks strictly below your own.” on Update Member, or “You may only invite at a rank strictly below your own.” on Create Invite. There is no separate “only the owner may assign rank 0” check — owners are the only minters of rank 0 because they skip the rank block entirely, not because a guard names them. So rank 0 is reachable by the owner, and by any actor with no member row on this workspace — an ancestor owner or a reach holder — who skips or clears the same floor and, from relativeRank: 1, anchors at apex and lands on 0.
A relative offset is a snapshot, not a live link. It is resolved once, at write time, and frozen as an absolute number. Invite at relativeRank: 1 while you are rank 1 and they land on rank 2 — get promoted to rank 0 later and they are still 2, now two rungs below you rather than one. Nothing re-derives.(relativeRank on a read is the opposite: recomputed per request against whoever is asking, so the same member shows a different relativeRank to different callers. Only rank is caller-independent.)
Omitting the rank field is the easiest way in the whole API to mint rank 0. “One rung below me” is measured from your anchor, and an inviter with no member row on this workspace anchors at apex — so for an owner, an ancestor owner or a reach holder with no direct row, the default lands on rank 0, the most senior rung there is. Everything else in this bundle gates that rung carefully; the default reaches it by leaving a field off.It is semantically correct — one below apex is the top rung — and it is not changing. But it inverts the usual instinct that omitting a field is the conservative choice. The case to watch is a backend invite flow: a server route that invites people with a service key acting as the owner and no rank field creates a workspace of rank-0 members, each able to manage all the others and none manageable by anyone but the owner. A service-key flow that wants new members at the bottom of the ladder has to name a coordinate — an absolute rank, or a relativeRank anchored on an actingUserId who actually sits in the ladder.The milder version applies to in-ladder inviters. A lead at rank 0 who invites six people with no rank field gets six rank-1 members — and equals cannot act on equals, so none of those six can manage each other. Only the lead can manage any of them. That is often exactly right for a flat team. But if your product has tiers, say so on the invite instead of discovering the flat layer later.

When you want absolute instead

rank is the escape hatch, and it is the right call whenever the number means something in your product rather than something about the caller. It buys more freedom and costs more care: naming a rank you are not entitled to grant is a 403 workspace/insufficient-rank, and rank: 0 is simply the extreme case of that — no one holding a row on this workspace can name it. A relative offset clears the rank floor by construction — but that is the floor specifically, not a blanket exemption from the rank checks. One pattern some apps like — not the prescribed approach, just one that works — is a set of named tier constants with gaps left for later:
Apps built this way will naturally prefer absolute input — they already know the number they want, and computing TIER.MANAGER - myRank just to send it relatively would be a detour. That is precisely why absolute stays. Apps whose hierarchy is a real chain of command, where “under me” is the actual intent, are better served by relativeRank. Neither is deprecated.

Quick start

Workspace lists

GET /workspaces lists the caller’s workspaces, and useWorkspaceList keeps such a list in the Redux store with load-more. Three filters shape it:
  • relation — which workspaces. reachable (the default) is every workspace the user can open: one they own, one they are a member of, one under a workspace they own, and one a capability they hold on an ancestor reaches. direct is only the workspaces they own or have a member row on.
  • parentWorkspaceId — where in the tree, within that relation: none (top-level only), a workspace id (the workspaces directly under it) or any (every level, the default).
  • sortDir — by creation time, desc (newest first, the default) or asc (oldest first).
Every row carries reasons, the user’s standing on it: owner, member, ancestor-owner or reach-holder, with viaWorkspaceId naming the ancestor for the last two. They are the same entries the authority read returns, so a list can show why each workspace is there without a request per row.

Everything you can open

The defaults — relation: "reachable", every level, newest first — list every workspace the user can open. Use reasons to group or label the rows: a workspace whose only reason is ancestor-owner is one the user oversees from above but was never added to, and one whose only reason is reach-holder is one they work in through a capability granted on a parent.

Building a workspace switcher

A switcher usually shows the workspaces the user is actually in — the ones they own or were added to — not every workspace they could open from above. That is relation: "direct" with parentWorkspaceId: "any", so sub-workspaces they were added to show up even when they aren’t in the parent. To show those workspaces as a tree, fetch them oldest first (sortDir: "asc"). A workspace can’t be moved to another parent, so a sub-workspace is always created after its parent, and oldest first always lists a parent before its children. Building the tree on the client is then one pass in the order the rows arrive: by the time a row comes, its parent’s node already exists, so the row attaches to it straight away, and that stays true across pages. With the default, newest first, children come before their parents, and a client has to hold every row until it has loaded all of them before it can attach anything. Under direct, a row’s parent may not be in the list at all (the user is in the sub-workspace but not in its parent). Treat a row whose parent you haven’t seen as a root of its own.
Creating a workspace from the switcher with the list’s createWorkspace adds it in the right place: last under oldest first (once every page is loaded), first under newest first.

Workspaces in common

useFetchMutualWorkspaces lists the workspaces the current user shares with another user, under the same relation and sortDir — for example, on a profile page, “Workspaces you share”. Each row’s reasons is the current user’s standing.

Hooks

Workspace lifecycle & ownership

Membership

Invitations

useFetchWorkspaceInvites and useFetchMyWorkspaceInvites are the two most confusable hooks in this bundle. The first is the outbox of one workspace (GET /workspaces/:workspaceId/invites) — who this team has invited and not yet heard back from; it powers the “Pending invitations” section of a members panel. The second is the signed-in user’s inbox (GET /workspace-invites) across every workspace — it powers a “You’ve been invited” list.

Authority

Drive your UI off useFetchWorkspaceAuthority rather than guessing: it returns { reasons, capabilities, permissions, rank }, so showing the “Remove member” button is authority.capabilities.includes("remove-member"). reasons are structured { type, viaWorkspaceId? } entries — the same shape a roster entry carries — so you can also show which ancestor grants an inherited standing. A user with no standing on the workspace at all gets 404 workspace/not-found instead of a record, so treat that 404 as “no standing here”.