# Read one workspace

> Returns the workspace without its `api_key`, with its usage figures (`wallet_used`, `free_used`, `own_credits`, `window_resets_at`).

Source: https://docs.spicrawl.com/api-reference/partner/partner-workspace-get

## GET /v1/partner/workspaces/{external_user_id}

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

Returns the workspace without its `api_key`, with its usage figures (`wallet_used`, `free_used`, `own_credits`, `window_resets_at`). `own_credits` is null when the balance cannot be read at that moment. Use `PUT` to read the key.

### Example

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

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `external_user_id` | path | string | yes | The partner's own id for the end user. |

### Responses

#### 200

The workspace.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `workspace_id` | string | yes | The workspace's organization id. |
| `external_user_id` | string | yes |  |
| `display_name` | string \| null | no | The label the partner gave the workspace, or `null`. Set on `PUT` when that call creates the workspace, or with `PATCH`. Optional. The workspace's own key reports it as `organization.name` on `GET /v1/key`, so the end user can read it. |
| `status` | string: `active`, `suspended`, `closed`, `deleted` | yes | `deleted` when the workspace has been soft-deleted by Spicrawl support. A deleted workspace keeps its `external_user_id` but cannot be served; `PUT` on it is `409` and returns no key. |
| `created_at` | string (date-time) | yes |  |
| `free_credits` | integer | yes | The workspace's monthly allowance, in whole credits, as set for the partner. Always 0 while the partner is on a paid plan. |
| `wallet_cap` | integer | no | The most this workspace may draw from the partner's balance in one allowance month, in whole credits. Its own setting when Spicrawl set one, else the partner's default. `null` when it has no cap. Free credits and the workspace's own balance are not counted against it. A request that would need more than the cap left is refused with `402 ERR::LIMIT::QUOTA_EXCEEDED` ("...reached its spending limit for this month..."). A cap change reaches requests within about 5 seconds. |
| `tier` | object | no | The tier the workspace is on, or `null` when it has none. |
| `requests_per_minute` | integer | no | The tier's requests per minute for this user's scrape and browser requests, or `null` when there is no tier. |
| `concurrency` | integer | no | The tier's requests and browser sessions a user may run at once, or `null` when there is no tier. |
| `wallet_cap_source` | string: `tier`, `workspace`, `account_default`, `plan_default`, `none` | no | Where `wallet_cap` comes from. `tier`: the workspace's tier sets it. `workspace`: Spicrawl set it on this workspace while it is on no tier. `account_default`: the partner's default (a tier with no cap falls back to it). `plan_default`: the partner's paid plan sets it (none of the above is set). `none`: no cap, which only happens on the Free plan. |
| `window_resets_at` | string (date-time) | no | When the workspace's current allowance month ends (its monthly anniversary), RFC 3339 UTC. |
| `wallet_used` | integer \| null | no | Whole credits this user has drawn from the partner's balance in its current allowance month (floor). Compare with `wallet_cap`. Null on responses that do not compute it (`PUT`, suspend, reactivate) and when it cannot be read. |
| `wallet_used_source` | string \| null: `live`, `rollup`, `null` | no | `live` when read from the live counter, which is current. `rollup` when read from usage records, which trail by about 60 seconds. Null when `wallet_used` is null. |
| `free_used` | integer \| null | no | Whole free credits this user has used in its current allowance month (floor). Null on responses that do not compute it. |
| `own_credits` | integer \| null | no | Credits the partner gave this user that remain unspent, in whole credits (floor). The single `GET` reads it live; the list reads usage records, so it can trail by about 60 seconds. Null on responses that do not compute it, and when it cannot be read. |

#### 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).

#### 404

No such resource for this key's organization.

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
