Lium Workspaces API
The Workspaces API from Lium — 11 operation(s) for workspaces.
The Workspaces API from Lium — 11 operation(s) for workspaces.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/lium-io:lium-io-workspaces-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Lium Backend Workspaces API
description: '## 🚀 Lium Backend API
A comprehensive compute platform that enables users to rent GPU resources from a network of providers/nodes.
*Built with FastAPI, PostgreSQL and Redis.*'
contact:
name: Lium
url: https://lium.io/
email: support@lium.io
license:
name: MIT
url: https://opensource.org/licenses/MIT
version: 1.0.0
servers:
- url: /api
description: Production API
tags:
- name: Workspaces
paths:
/workspaces:
get:
tags:
- Workspaces
summary: List my workspaces
description: 'Every workspace the caller belongs to, oldest first, with the caller''s role in each. Every account has at least its own "''s workspace"; a user can belong to any number. With an API key: the one workspace the key acts in.'
operationId: list_workspaces_workspaces_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
items:
$ref: '#/components/schemas/WorkspaceResponse'
type: array
title: Response List Workspaces Workspaces Get
security:
- JwtAccessBearer: []
- APIKeyHeader: []
post:
tags:
- Workspaces
summary: Create a workspace
description: The caller becomes its owner and its billing owner (the balance that pays for it).
operationId: create_workspace_workspaces_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceCreateRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- JwtAccessBearer: []
/workspaces/{workspace_id}:
get:
tags:
- Workspaces
summary: Get a workspace
description: Members only; a workspace the caller does not belong to answers 404 (so does any workspace other than its own for an API key).
operationId: get_workspace_workspaces__workspace_id__get
security:
- JwtAccessBearer: []
- APIKeyHeader: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- Workspaces
summary: Rename a workspace
description: Owners and admins.
operationId: rename_workspace_workspaces__workspace_id__patch
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceUpdateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Workspaces
summary: Delete a workspace
description: 'Owners only. Soft delete: the workspace disappears from every endpoint; its audit log is kept.'
operationId: delete_workspace_workspaces__workspace_id__delete
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Delete Workspace Workspaces Workspace Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/members:
get:
tags:
- Workspaces
summary: List the members
description: Members only. `is_billing_owner` marks whose balance pays. An API key needs the `read` scope.
operationId: list_members_workspaces__workspace_id__members_get
security:
- JwtAccessBearer: []
- APIKeyHeader: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/WorkspaceMemberResponse'
title: Response List Members Workspaces Workspace Id Members Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- Workspaces
summary: Add a member
description: Owners and admins add an existing Lium account by e-mail with a role; admins cannot grant `owner`. 404 when no account has that e-mail, 409 when already a member.
operationId: add_member_workspaces__workspace_id__members_post
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceMemberAddRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceMemberResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/members/{member_user_id}:
patch:
tags:
- Workspaces
summary: Change a member's role
description: 'Owners set any role; admins move members between `admin` and `member` and cannot touch owners. The last owner cannot be demoted (409): promote another member first.'
operationId: change_member_role_workspaces__workspace_id__members__member_user_id__patch
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: member_user_id
in: path
required: true
schema:
type: string
format: uuid
title: Member User Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceMemberRoleRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceMemberResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Workspaces
summary: Remove a member, or leave
description: With the caller's own id this is leaving; otherwise owners and admins remove. An owner can neither leave nor be removed until the owner role is handed to someone else (409), and the billing owner until billing ownership is transferred (409).
operationId: remove_member_workspaces__workspace_id__members__member_user_id__delete
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: member_user_id
in: path
required: true
schema:
type: string
format: uuid
title: Member User Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Remove Member Workspaces Workspace Id Members Member User Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/billing-owner/transfer:
post:
tags:
- Workspaces
summary: Transfer billing ownership
description: Only the current billing owner (not admins, not other owners). Records a pending transfer that the named member, owners and admins included, accepts with `/billing-owner/accept`.
operationId: transfer_billing_owner_workspaces__workspace_id__billing_owner_transfer_post
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BillingOwnerTransferRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Workspaces
summary: Cancel a pending billing-owner transfer
description: Either side (the billing owner or the member asked to take over) can withdraw it.
operationId: cancel_billing_owner_transfer_workspaces__workspace_id__billing_owner_transfer_delete
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/billing-owner/accept:
post:
tags:
- Workspaces
summary: Accept a pending billing-owner transfer
description: 'The member named in the pending transfer takes over: their balance pays from now on.'
operationId: accept_billing_owner_workspaces__workspace_id__billing_owner_accept_post
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/events:
get:
tags:
- Workspaces
summary: Get the workspace's audit log
description: 'Every change to the workspace, newest first: creation, renames, members added / removed / left, role changes, billing-owner transfers and their acceptance or cancellation, deletion. Each entry names the user who made it and the session or API key behind the request. Members only; an API key needs the `read` scope.'
operationId: get_workspace_events_workspaces__workspace_id__events_get
security:
- JwtAccessBearer: []
- APIKeyHeader: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: since
in: query
required: false
schema:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Since
- name: limit
in: query
required: false
schema:
type: integer
maximum: 1000
minimum: 1
default: 200
title: Limit
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/WorkspaceEventResponse'
title: Response Get Workspace Events Workspaces Workspace Id Events Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/invitations:
get:
tags:
- Workspaces
summary: List the pending invitations
description: Owners and admins. Accepted, revoked and expired invitations are not listed.
operationId: list_invitations_workspaces__workspace_id__invitations_get
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/WorkspaceInvitationResponse'
title: Response List Invitations Workspaces Workspace Id Invitations Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- Workspaces
summary: Invite an e-mail address
description: 'Owners and admins invite one address (it need not have a Lium account yet) with a role; admins cannot grant `owner`. The address receives a link that is valid for seven days; a verified session on that address opens it and joins. 422 for anything but one plain address; 409 when the address is already a member or already invited, or the workspace holds 50 open invitations; 30/minute per client. `email_sent` false means the mail did not leave: revoke and invite again.'
operationId: invite_workspaces__workspace_id__invitations_post
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceInvitationCreateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceInvitationResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspaces/{workspace_id}/invitations/{invitation_id}:
delete:
tags:
- Workspaces
summary: Revoke a pending invitation
description: Owners and admins. The link in the e-mail stops working.
operationId: revoke_invitation_workspaces__workspace_id__invitations__invitation_id__delete
security:
- JwtAccessBearer: []
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: invitation_id
in: path
required: true
schema:
type: string
format: uuid
title: Invitation Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Revoke Invitation Workspaces Workspace Id Invitations Invitation Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspace-invitations/{token}:
get:
tags:
- Workspaces
summary: Look at an invitation
description: 'No authentication: the token is the credential for looking, not for joining. Names the workspace, the role, the invited address masked (`d***@example.com`; a forwarded link must not hand the address to a stranger) and whether the invitation is still open, so the page can say what accepting means.'
operationId: preview_invitation_workspace_invitations__token__get
parameters:
- name: token
in: path
required: true
schema:
type: string
title: Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceInvitationPreviewResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/workspace-invitations/{token}/accept:
post:
tags:
- Workspaces
summary: Accept an invitation
description: The signed-in user joins with the invited role. The session's e-mail must be the invited address (403 otherwise) and verified (403 until it is); 410 once expired, 409 when already accepted, revoked, or the user is a member already. A token is accepted once.
operationId: accept_invitation_workspace_invitations__token__accept_post
security:
- JwtAccessBearer: []
parameters:
- name: token
in: path
required: true
schema:
type: string
title: Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/WorkspaceMemberResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ActorMetadata:
properties:
auth:
type: string
title: Auth
api_key_id:
anyOf:
- type: string
- type: 'null'
title: Api Key Id
api_key_name:
anyOf:
- type: string
- type: 'null'
title: Api Key Name
type: object
required:
- auth
title: ActorMetadata
description: 'Who performed the action the event records (DAH-2934).
Event.user_id is the account; with several API keys on one account it cannot say which of them
acted. Stamped on insert from the request''s auth (see models/event.py); absent on events written
by workers and the validator consumer.'
WorkspaceEventResponse:
properties:
id:
type: string
format: uuid
title: Id
created_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Created At
event_type:
anyOf:
- type: string
- type: 'null'
title: Event Type
sub_event_type:
anyOf:
- type: string
- type: 'null'
title: Sub Event Type
workspace_id:
anyOf:
- type: string
- type: 'null'
title: Workspace Id
actor_user_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Actor User Id
description: The signed-in user who made the change.
actor:
anyOf:
- $ref: '#/components/schemas/ActorMetadata'
- type: 'null'
description: Session or API key behind the request.
member_user_id:
anyOf:
- type: string
- type: 'null'
title: Member User Id
from_role:
anyOf:
- type: string
- type: 'null'
title: From Role
to_role:
anyOf:
- type: string
- type: 'null'
title: To Role
from_user_id:
anyOf:
- type: string
- type: 'null'
title: From User Id
to_user_id:
anyOf:
- type: string
- type: 'null'
title: To User Id
old_name:
anyOf:
- type: string
- type: 'null'
title: Old Name
new_name:
anyOf:
- type: string
- type: 'null'
title: New Name
invitation_id:
anyOf:
- type: string
- type: 'null'
title: Invitation Id
pod_id:
anyOf:
- type: string
- type: 'null'
title: Pod Id
pod_name:
anyOf:
- type: string
- type: 'null'
title: Pod Name
from_status:
anyOf:
- type: string
- type: 'null'
title: From Status
to_status:
anyOf:
- type: string
- type: 'null'
title: To Status
reason:
anyOf:
- type: string
- type: 'null'
title: Reason
detail:
anyOf:
- type: string
- type: 'null'
title: Detail
error:
anyOf:
- type: string
- type: 'null'
title: Error
type: object
required:
- id
- created_at
- event_type
title: WorkspaceEventResponse
description: One entry of a workspace's audit log, flattened from the stored Event row — never the raw row.
WorkspaceMemberRoleRequest:
properties:
role:
type: string
enum:
- owner
- admin
- member
title: Role
type: object
required:
- role
title: WorkspaceMemberRoleRequest
WorkspaceInvitationResponse:
properties:
id:
type: string
format: uuid
title: Id
workspace_id:
type: string
format: uuid
title: Workspace Id
email:
type: string
title: Email
role:
$ref: '#/components/schemas/WorkspaceRole'
invited_by_user_id:
type: string
format: uuid
title: Invited By User Id
status:
type: string
enum:
- pending
- accepted
- revoked
- expired
title: Status
expires_at:
type: string
format: date-time
title: Expires At
created_at:
type: string
format: date-time
title: Created At
email_sent:
anyOf:
- type: boolean
- type: 'null'
title: Email Sent
description: 'On creation only: whether the e-mail left. False means revoke and invite again.'
type: object
required:
- id
- workspace_id
- email
- role
- invited_by_user_id
- status
- expires_at
- created_at
title: WorkspaceInvitationResponse
WorkspaceMemberResponse:
properties:
user_id:
type: string
format: uuid
title: User Id
name:
type: string
title: Name
email:
anyOf:
- type: string
- type: 'null'
title: Email
role:
$ref: '#/components/schemas/WorkspaceRole'
is_billing_owner:
type: boolean
title: Is Billing Owner
joined_at:
type: string
format: date-time
title: Joined At
type: object
required:
- user_id
- name
- email
- role
- is_billing_owner
- joined_at
title: WorkspaceMemberResponse
WorkspaceCreateRequest:
properties:
name:
type: string
maxLength: 100
minLength: 1
title: Name
description: Shown to every member; not unique.
type: object
required:
- name
title: WorkspaceCreateRequest
BillingOwnerTransferRequest:
properties:
user_id:
type: string
format: uuid
title: User Id
description: A member of the workspace whose balance will pay for it.
type: object
required:
- user_id
title: BillingOwnerTransferRequest
WorkspaceMemberAddRequest:
properties:
email:
type: string
maxLength: 254
title: Email
description: E-mail of an existing Lium account; the member is added at once, no invitation.
role:
type: string
enum:
- owner
- admin
- member
title: Role
description: Admins may grant `admin` or `member`; owners any role.
default: member
type: object
required:
- email
title: WorkspaceMemberAddRequest
WorkspaceUpdateRequest:
properties:
name:
type: string
maxLength: 100
minLength: 1
title: Name
description: Shown to every member; not unique.
type: object
required:
- name
title: WorkspaceUpdateRequest
WorkspaceRole:
type: string
enum:
- owner
- admin
- member
title: WorkspaceRole
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
WorkspaceInvitationCreateRequest:
properties:
email:
type: string
format: email
title: Email
description: 'Where the invitation is sent: exactly one address, lower-cased; it need not have a Lium account yet. 422 for anything that is not one plain address.'
role:
type: string
enum:
- owner
- admin
- member
title: Role
description: Admins may grant `admin` or `member`; owners any role.
default: member
type: object
required:
- email
title: WorkspaceInvitationCreateRequest
WorkspaceResponse:
properties:
id:
type: string
format: uuid
title: Id
name:
type: string
title: Name
role:
$ref: '#/components/schemas/WorkspaceRole'
description: The caller's role in this workspace.
billing_owner_user_id:
type: string
format: uuid
title: Billing Owner User Id
description: Whose balance pays for the workspace's resources.
pending_billing_owner_user_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Pending Billing Owner User Id
description: A member asked to take over billing who has not accepted yet.
created_at:
type: string
format: date-time
title: Created At
type: object
required:
- id
- name
- role
- billing_owner_user_id
- created_at
title: WorkspaceResponse
WorkspaceInvitationPreviewResponse:
properties:
workspace_name:
type: string
title: Workspace Name
role:
$ref: '#/components/schemas/WorkspaceRole'
email:
type: string
title: Email
description: The invited address, masked (`d***@example.com`); the accepting session must belong to it.
inviter_name:
anyOf:
- type: string
- type: 'null'
title: Inviter Name
status:
type: string
enum:
- pending
- accepted
- revoked
- expired
title: Status
expires_at:
type: string
format: date-time
title: Expires At
type: object
required:
- workspace_name
- role
- email
- inviter_name
- status
- expires_at
title: WorkspaceInvitationPreviewResponse
description: 'What the holder of an invitation link sees before signing in: enough to decide, nothing more.
The link alone does not prove the holder is the invitee (mail gets forwarded), so the address is masked:
the invitee recognises it, a stranger cannot read it off and sign up on it.'
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
securitySchemes:
JwtAccessBearer:
type: http
scheme: bearer
APIKeyHeader:
type: apiKey
in: header
name: X-API-Key