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

# List Workspaces

GET https://api.rray.app/v1/workspaces

List the workspaces on your account, newest first, as a cursor-paginated page.

Reference: https://docs.rray.app/api/api-reference/workspaces/list

## Authentication

- `Authorization` header (bearer token, required) — A workspace key (`rray_live_…`, bound to one workspace) or the account's platform key. Platform keys name the target workspace with `RRay-Workspace-Id`. See [Credentials](https://docs.rray.app/docs/concepts/authentication).

## Request

### Query parameters

- `status` (string, optional, nullable)
- `name` (string, optional, nullable)
- `limit` (integer, optional, default: 20) — Rows per page (1–100, default 20).
- `cursor` (string, optional, nullable) — Opaque pagination token. Omit for the first page (newest rows first). To page, copy `pagination.next_cursor` (older rows) or `pagination.prev_cursor` (newer rows) from the previous response into this parameter — do not build it yourself: the walk direction and the active filter set are encoded in the token, and reusing a cursor with a different filter set is rejected (`validation.cursor_filters_mismatch`).

## Response

### 200

Successful Response

- `data` (list of WorkspaceResponse, required) — This page of rows, newest first.
- `pagination` (ListMeta, required) — Where you are in the list and how to walk it.
- `object` (string, optional, default: list) — Always `list`.

## Errors

### 400 Bad Request Error

Bad Request

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 401 Unauthorized Error

Unauthorized

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 422 Unprocessable Entity Error

Unprocessable Entity

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Always `validation.request_invalid` for a schema-validation failure.
  - Allowed values: `validation.request_invalid`
- `category` (enum, required) — Always `validation` for a schema-validation failure.
  - Allowed values: `validation`
- `invalid_params` (list of ValidationIssue, required) — The request fields that failed schema validation.
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 429 Too Many Requests Error

Too Many Requests

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 500 Internal Server Error

Internal Server Error

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

## Types

### WorkspaceResponse

One sending workspace: its own message history and its own sending-IP pool.

- `id` (string, required) — Identifier of the workspace. This is the value you send as `RRay-Workspace-Id`.
- `name` (string, required) — Name you gave the workspace.
- `status` (string, required) — Whether the workspace may send.
- `egress_pool` (string, required) — Name of the sending-IP pool this workspace's mail goes out through.
- `customer_id` (string, required) — Account that owns the workspace.
- `created_at` (datetime, required) — When the workspace was created (RFC 3339, UTC).
- `object` ("workspace", optional, default: workspace) — Always `workspace`.
- `monthly_delivery_limit` (integer, optional, nullable) — Ceiling on deliveries this workspace may send per billing period; `null` when it is only bounded by the account's own allowance.

### ListMeta

``total``/``total_capped`` are present on the entry page only (no COUNT is executed while walking cursors).

- `limit` (integer, required) — Rows per page this response used.
- `has_next` (boolean, required) — Older rows exist — request `next_cursor` to continue.
- `has_prev` (boolean, required) — Newer rows exist — request `prev_cursor` to go back.
- `total` (integer, optional, nullable) — Total matching rows, capped at 10 000. Present on the first page only; `null` while paging with a cursor.
- `total_capped` (boolean, optional, default: false) — `true` when the real total exceeds the 10 000 cap (`total` is the cap).
- `next_cursor` (string, optional, nullable) — Pass as `cursor` for the next (older) page; `null` at the end of the list.
- `prev_cursor` (string, optional, nullable) — Pass as `cursor` for the previous (newer) page; `null` at the start of the list.

### ValidationIssue

One failed field — an entry of the ``invalid_params`` array (a request field the caller can fix). Shared by schema-validation failures (pydantic) and field-scoped business rules (e.g. a duplicate recipient), so the two cannot drift in shape.

- `field` (string, required) — Path of the request field that failed, e.g. `to`, `attachments[0]`.
- `message` (string, required) — Human-readable explanation of this field error (safe to surface in a UI).
- `kind` (string, required) — Machine-readable CAUSE token (finer than the error `code`): a pydantic type (`missing`, `string_too_long`, `value_error`) for a schema failure, or a business cause — `duplicate`, `invalid_base64`, `unsupported_scheme`, `missing_host`, `unresolvable_host`, `private_address`, `size_exceeded`, `plan_restricted`. Branch on this, not `message`.

### StateError

One failed resource-state precondition — an entry of the ``state_errors`` array. Unlike ``invalid_params`` it points at a resource/account state (not a request field), e.g. an unverified sender domain or insufficient credits.

- `resource` (string, required) — The resource whose state blocked the request, e.g. `sender_domain`.
- `message` (string, required) — Human-readable explanation of the state problem (safe to surface in a UI).
- `kind` (string, required) — Machine-readable CAUSE token (finer than the error `code`), e.g. `unverified`.
- `resource_id` (string, optional, nullable) — Identifier of that resource, e.g. `example.com`.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": [
    {
      "id": "ws_01KYA3AWSZGCB9YMNKM5AQBA8G",
      "name": "production",
      "status": "active",
      "egress_pool": "default",
      "customer_id": "cus_01KYA3AWSYX8ZWK2CJ4N0JYQ7D",
      "created_at": "2024-01-15T09:30:00Z",
      "object": "workspace",
      "monthly_delivery_limit": 50000
    }
  ],
  "pagination": {
    "limit": 20,
    "has_next": true,
    "has_prev": false,
    "total": 3,
    "total_capped": false,
    "next_cursor": "eyJpZCI6IndzXzAxSlhBM0FXU1pHQ0I5WU1OS001QVFCQThHIiwiZGlyIjoibmV4dCJ9",
    "prev_cursor": null
  },
  "object": "list"
}
```

**SDK Code**

```python
import requests

url = "https://api.rray.app/v1/workspaces"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.rray.app/v1/workspaces';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.rray.app/v1/workspaces"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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.rray.app/v1/workspaces")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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.rray.app/v1/workspaces")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.rray.app/v1/workspaces', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.rray.app/v1/workspaces");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

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

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()
```