Spaces
Without a space, every call happens in a hidden workspace. Files there are temporary and unindexed. They die with the run that used them. A space is the opposite. Files belong to the space and outlive their runs. They are indexed, so you can search them.
Use a space when several calls belong together: one customer onboarding, one case file, one batch you want to search later.
Create a space
Lifetime
expiresAt is the deadline. Extend it at any time. The new ttl counts from now:
DELETE /v1/spaces/{spaceId} closes the space immediately and deletes its files. It is idempotent. Call it again to finish a purge that was too large for one pass.
Expiry is lazy
No background process sweeps expired spaces today. The first call that addresses an expired space closes it. The space is archived, its files are deleted in the background, and the call answers 404.
Design for three consequences:
- A space past
expiresAtis already gone as far as this API is concerned, even before anything touched it. - The
space.expiredwebhook fires at that moment — once per space, not at the deadline. Advance warnings arrive with the sweeper later. - An explicit
DELETEdoes not emitspace.expired. Deleting your own space is not an expiry.
The namespaced mirror
Every /v1 route that works on the hidden workspace works inside a space, under /v1/spaces/{spaceId}/…:
Bodies and responses are identical to the unscoped routes. Only the path changes.
The mirror works on any live space of your organization, including spaces people created in the app. Lifecycle does not. PATCH and DELETE accept only a space created with POST /v1/spaces, so this API can never change or delete a space a person made.
Search a space
Only files in a space are indexed. Files in the hidden workspace are not, so there is nothing to search there.