Partitions
Give every user their own slice of an index, isolated by a scoped token.
A partition is a private slice of an index that belongs to one key — a user ID, a workspace ID, a tenant ID. Toread uses one partition per reader for its library index, so one reader's highlights never surface in another reader's results.
Declaring a partition key
Set partitionKey in an index's index-time settings once, before you start writing:
{ "partitionKey": "userId" }Every record you write to that index must then carry a userId attribute. suo routes it to that partition's own store automatically — you never manage partitions directly.
Searching a partition
A search against a partitioned index must be scoped to exactly one partition. You do this with a scoped token minted on your own server, which pins the partition (and can add its own filters) so a client-side bug or a forged parameter can never cross into another reader's data:
{ "keyId": "key_9f2", "indexes": ["library"], "partition": "user_482", "filters": [], "exp": 1732554000 }The widget or SDK on the page then searches with that token instead of a shared search key. See Scoped tokens for private content for how to mint one.
Clearing a partition
Deleting a partition — for account deletion, for example — is one call:
DELETE /1/indexes/library/partitions/user_482See Clear a partition. Every record and tombstone in that partition is gone; there is no undo.
When to use a partition versus a filter
Use a partition when the data must be isolated, not just filtered — when it would be a real incident if one reader's results leaked into another's. Use an ordinary attribute and a query-time filter (see Search) when the split is just a view over shared, non-sensitive content, like filtering by lang or type.
Quota
Partitions are one of the three metered units in the beta — see Limits and quotas.