> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://onepin.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://onepin.ai/docs/_mcp/server.

# List Workspaces

GET https://api.onepin.ai/api/v1/workspaces

List all workspaces the current user is a member of.

Returns workspaces where the caller has any role (admin, editor, or
viewer), including workspaces they own and workspaces they joined via
invite. Results are paginated; omits soft-deleted workspaces and the
internal system workspace.

Reference: https://onepin.ai/docs/reference/api-reference/workspaces/list-workspaces-api-v-1-workspaces-get

## Authentication

- `Authorization` header (bearer token, required) — Clerk JWT token

## Servers

- `https://api.onepin.ai` (prod, default)
- `https://dev-api.onepin.ai` (dev)

## Request

### Query parameters

- `offset` (integer, optional, default: 0)
- `limit` (integer, optional, default: 20)

## Response

### 200

Successful Response

- `data` (list of WorkspaceOut, required)
- `meta` (Meta, required)
- `pagination` (PaginationMeta, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### WorkspaceOut

- `id` (string, required) — Unique workspace identifier. Pass as `X-Workspace-Id` header to scope resource requests.
- `name` (string, required) — Human-readable workspace name.
- `slug` (string, required) — URL-safe workspace identifier (lowercase kebab-case).
- `color_idx` (integer, required) — Index into the workspace color palette.
- `created_at` (datetime, required) — When the workspace was created (UTC).
- `updated_at` (datetime, required) — When the workspace was last modified (UTC).
- `routing_price_sensitivity` (double, required) — Voice-selection price/quality balance (0.0 = pure quality, 1.0 = pure price, 0.5 = balanced).
- `routing_llm_fit` (boolean, required) — Whether automatic voice selection also weighs content fit.
- `created_by` (string, optional, nullable) — User ID of the workspace owner. Null for an enterprise org workspace, which is owned by its organization (see organization_id) rather than a user.
- `organization_id` (string, optional, nullable) — Owning organization when this is an enterprise org workspace, else null.

### Meta

- `request_id` (string, required)
- `timestamp` (datetime, required)

### PaginationMeta

- `limit` (integer, required)
- `next` (string, optional, nullable)
- `prev` (string, optional, nullable)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "slug": "string",
      "color_idx": 1,
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "routing_price_sensitivity": 1.1,
      "routing_llm_fit": true,
      "created_by": "string",
      "organization_id": "string"
    }
  ],
  "meta": {
    "request_id": "string",
    "timestamp": "2024-01-15T09:30:00Z"
  },
  "pagination": {
    "limit": 1,
    "next": "string",
    "prev": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.onepin.ai/api/v1/workspaces"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.onepin.ai/api/v1/workspaces';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.onepin.ai/api/v1/workspaces"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.onepin.ai/api/v1/workspaces")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.onepin.ai/api/v1/workspaces")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.onepin.ai/api/v1/workspaces', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.onepin.ai/api/v1/workspaces");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.onepin.ai/api/v1/workspaces")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```