Skip to content

Spaces API

Spaces hold docs pages. Create, rename, archive, and delete spaces, and look up the spaceId that doc creation and moves need.

Native session clients use mobile:docSpaces with organizationId and optional projectId, cursor and limit. It returns readable Docs spaces as items and nextCursor. Use mobile:docPages for a space's root pages and children. Limits default to 25 and allow up to 50.

Endpoints

List accessible spaces

Project-restricted credentials can list and view spaces only in their selected projects. Workspace-wide spaces stay outside that boundary, and these credentials cannot create, change, or delete spaces. Listing without a project filter searches only the selected projects, with the same 1,000-row scan limit.

The list contains only spaces the credential can see in the selected workspace. A project filter narrows the list and does not grant access to that project. Archived spaces appear only with includeArchived=true, and only the ones you can administer. The list reads the first 1,000 spaces in the workspace, or in the project when you pass projectId. When there are more, truncated is true; filter by project to see the rest.

Shell
curl "https://projectfeed.app/api/v1/spaces?projectId=prj_abc123" \
  -H "Authorization: Bearer pf_YOUR_API_KEY" \
  -H "X-Project-Feed-Workspace: studio"

Store a space by its id. Names and slugs can change, and neither replaces the ID in API writes.

Response fields

id

Space ID required by doc creation, doc moves, and list filters.

projectId

Owning project ID, or null for a workspace-level space.

name and slug

Display name and URL-safe identifier.

description and icon

Optional presentation metadata; either can be null.

visibility

shared or private.

createdBy

User ID of the space creator.

createdAt and updatedAt

Unix timestamps in milliseconds.

archivedAt

When the space was archived, in Unix milliseconds, or null for an active space.

Who can change a space

  • Workspace members can create spaces. Viewers cannot. A space with a projectId needs access to that project, and a project that is read-only because of the workspace plan does not accept new spaces.
  • Members can rename a workspace space they can see and change its description and icon. For a private workspace space, only its creator can. Project spaces can be changed only by workspace owners and admins.
  • Changing visibility takes a workspace owner or admin, or the creator of a workspace space.
  • Archive, restore, and delete follow the same rule as visibility. Project spaces are limited to owners and admins.

Archive, restore, and delete

Archiving a space also archives every doc in it. The docs are archived in the background, so a list request made right after the archive can still show some of them as active. Restoring a space does not restore its docs. Restore each one with POST /api/v1/docs/:id/restore. Changing an archived space returns 409 until it is restored.

A space can be deleted only when it is archived and holds no docs, archived docs included. Docs inside an archived space are hidden and cannot be deleted, so empty the space while it is still active:

  1. List its docs with GET /api/v1/docs?spaceId=spc_abc123 and again with state=archived. Delete each one with DELETE /api/v1/docs/:id, or move it to another space with POST /api/v1/docs/:id/move.
  2. Archive the space with POST /api/v1/spaces/:id/archive.
  3. Delete the space with DELETE /api/v1/spaces/:id. A successful delete returns 204.

If a space was archived with docs in it, restore the space, delete or move the docs, then archive and delete it.

Access and empty results

  • Workspace spaces follow workspace membership. Private spaces are limited further by their creator and owner or admin access.
  • Project spaces also require access to the owning project. A valid project ID returns an empty spaces array when the caller cannot access that project.
  • Deleted spaces are never returned. Archived spaces are left out unless you pass includeArchived=true.
  • An empty array is an access or filter result, not proof that the workspace has no docs.

Errors

400 Bad Request

Check the body. A name must be 1 to 100 characters. A PATCH needs at least one field to change, and a space cannot move to another project, so projectId is rejected.

403 Forbidden

Check docs:read or docs:write, token audience, workspace policy, and membership. Writes also check your role for that space and your access to its project.

404 Not Found

The space or project is in another workspace, you cannot see it, or the space is archived and you cannot administer it.

409 Conflict

The space is archived and you tried to edit it, or you tried to delete a space that is still active or still holds docs. Follow the delete steps above.

Next steps

Image preview
100%