Linea Docs

Workspaces

Create and manage workspaces and their members.

Workspaces

Workspaces are the top-level billing and membership boundary. Every other resource belongs to a workspace.

Endpoints

POST /v1/workspaces

Create a workspace. The caller becomes the owner.

Body

{ "name": "Acme Corp", "slug": "acme" }

Response 201: workspace object


GET /v1/workspaces

List all workspaces the current user belongs to.

Response 200: array of workspace objects


GET /v1/workspaces/:id

Get a single workspace. Requires membership.

Response 200: workspace object


PATCH /v1/workspaces/:id

Update workspace name or slug. Requires admin+.

Body: any subset of { name, slug }

Response 200: updated workspace


DELETE /v1/workspaces/:id

Delete a workspace and all its contents. Requires owner.

Response 204


Members

GET /v1/workspaces/:id/members

List all workspace members with their roles.

Response 200

[{ "userId": "...", "role": "admin", "joinedAt": "..." }]

PATCH /v1/workspaces/:id/members/:userId

Change a member's role. Requires admin+. Cannot demote an owner.

Body { "role": "editor" }

Response 200


DELETE /v1/workspaces/:id/members/:userId

Remove a member. Requires admin+.

Response 204


Invites

POST /v1/workspaces/:id/invites

Invite a user by email. Requires admin+.

Body

{ "email": "user@example.com", "role": "editor" }

Response 201: invite object with token


GET /v1/workspaces/:id/invites

List pending invites. Requires admin+.

Response 200: array of invite objects


DELETE /v1/workspaces/:id/invites/:inviteId

Revoke an invite. Requires admin+.

Response 204


Workspace Object

{
  "id": "uuid",
  "name": "Acme Corp",
  "slug": "acme",
  "plan": "free",
  "createdAt": "2025-01-01T00:00:00Z"
}

Roles

RoleCapabilities
viewerRead-only access to all resources
editorCreate / update / delete workflows, spaces
adminManage members, invites, API keys
ownerFull control including workspace deletion