List workspaces
Fetch a list of all Lovable workspaces accessible to your account. Results are sorted from oldest to newest and can be loaded in batches.
Teams on a Business plan or higher who need to display or manage Lovable workspaces inside an internal tool or dashboard.
Do this, in order
- 1
Create an API key in your Lovable account settings with the workspaces:read or workspaces:write permission.
The workspaces endpoint rejects any request that lacks the proper workspace read permissions.
- 2
Send a GET request to https://api.lovable.dev/v1/workspaces including your key in the Lovable-API-Key header or as Authorization: Bearer <key>.
This authenticates your request against the Lovable API.
- 3
Check the response data array for your workspace records and store pagination.next_cursor.
Each response delivers a page of workspaces, and the cursor lets you fetch the next page if more exist.
- 4
If pagination.has_more is true, pass the next_cursor value into the cursor query parameter on your next request.
This loads the next batch of workspaces without missing or duplicating records.
Paste this into your project
Build a component that connects to the Lovable API at GET https://api.lovable.dev/v1/workspaces. Provide a settings input for the Lovable API key, send it in the Authorization header as a Bearer token, and display the list of workspaces in a clean table showing their ID, name, and project count. If pagination.has_more is true, render a 'Load More' button that uses pagination.next_cursor to fetch the next batch.
Words decoded
- Cursor pagination
- A way to load large lists page by page using a bookmark code returned by the previous request.
- Scope
- A specific permission attached to an API key defining what actions it is allowed to take.
- Eventually consistent
- Data that updates in the background and might take a brief moment to show recent changes, like newly created projects.
Where people get stuck
- Using an API key created for a single workspace will return only that single workspace instead of all account workspaces.
- The project count field (num_projects) updates in the background and may not immediately reflect freshly created or deleted projects.
- This endpoint requires a Business plan or higher; requests from lower plans will fail with a 402 payment required error.
- Keys without the workspaces:read scope will fail with a 403 insufficient scope error.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.