# List the partner's workspaces

> Pages the workspaces this partner provisioned. Items carry no `api_key`.

Source: https://docs.spicrawl.com/api-reference/partner/partner-workspaces-list

## GET /v1/partner/workspaces

Operation ID: `partnerWorkspacesList`. API key scope: `partner`.

Pages the workspaces this partner provisioned. Items carry no `api_key`. Each item has its usage figures
(see `PartnerWorkspace`). `sort=external_user_id` (the default) pages by keyset: `next_after` is present
when the page is full; pass it as `after`. `sort=wallet_used` orders by the balance spend this window,
largest first, and pages by `offset`: `next_offset` is present when the page is full. The `wallet_used`
sort is on usage records, which trail the live figure by about 60 seconds. It is computed over all of the
partner's workspaces, not only the page, so it is slower than the default sort, and noticeably slower for a
very large account.

`q` matches a workspace whose `external_user_id` starts with it (case-sensitive) or whose `display_name`
starts with it (case-insensitive). It is up to 100 characters with no control characters. There are no
wildcards: `%`, `_` and `*` match themselves. Other characters match display names only.

### Example

```bash
curl "https://api.spicrawl.com/v1/partner/workspaces" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY"
```

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer; default `50` | no | Page size, 1 to 200. |
| `after` | query | string | no | The `next_after` of the previous page. Only with `sort=external_user_id`. |
| `q` | query | string | no | A prefix of `external_user_id` (case-sensitive) or of `display_name` (case-insensitive). Matches all when absent. Up to 100 characters, no control characters. |
| `sort` | query | string: `external_user_id`, `wallet_used`; default `"external_user_id"` | no | `external_user_id` (default) or `wallet_used` (descending by this window's balance spend). |
| `offset` | query | integer; default `0` | no | Rows to skip. Only with `sort=wallet_used`; `next_offset` of the previous page. |

### Responses

#### 200

One page of workspaces.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `workspaces` | array of object (`PartnerWorkspace`) | yes |  |
| `next_after` | string | no | Present when the page is full and `sort` is `external_user_id`. Pass it as `after` to read on. |
| `next_offset` | integer | no | Present when the page is full and `sort` is `wallet_used`. Pass it as `offset` to read on. |

#### 400

The request is invalid. Not retryable; fix the request using `code` and `diagnostics.hint`.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
