# Fetch the caller's workspace

GET

/v1/tenant

```sh
curl --request GET \
  --url https://example.com/v1/tenant \
  --header 'Authorization: Bearer <token>'
```

Returns the workspace the bearer token authenticates as. There is no `/v1/tenants` collection — workspaces are the sovereignty boundary, not a listable resource under a workspace. A runtime that gates production adds `productionAllowed` (and `productionNext` while it’s `false`), one that sets limits adds the workspace’s `limits`, one that counts files adds `storage` (what they take, to compare with `limits.storageMiB`), and a deployment that publishes where its calls come from adds `egress`.

## Authorizations

- **[bearerAuth](https://docs.kindgi.com/v0.8.1/reference/api.md#bearerauth)**

## Responses

### 200

Workspace.

application/json

object

**id**

required

string format: uuid

**name**

required

string

**slug**

required

string

**createdAt**

required

string format: date-time

**updatedAt**

required

string format: date-time

**productionAllowed**

Whether the workspace may put projects in production. Absent from a runtime that doesn’t gate production.

boolean

**productionNext**

Where to go to be allowed to put projects in production, for example a billing page. Only while `productionAllowed` is `false`, and only when the runtime names one.

string

**state**

On a runtime serving many tenants: `closing` (readable and exportable for its window, nothing changes) or `suspended` (the same, until restored). `closing` wins. Absent: active.

string

Allowed values: active suspended closing

**limits**

The workspace’s limits that are set. A limit that isn’t set is absent, and isn’t enforced.

object

**apiRequestsPerMinute**

API requests a minute. Past it: 429 `rate-limit-exceeded`.

integer

\>= 1

**webhookReceivesPerMinute**

Webhook deliveries received a minute, across the workspace’s triggers. Past it: 429.

integer

\>= 1

**runsAtOnce**

Runs executing at once. Past it, a new run waits as `pending`.

integer

\>= 1

**runsPending**

Runs waiting as `pending`. Past it, a new run is refused with 429.

integer

\>= 1

**toolCallsInFlight**

Tool calls in flight to the workspace’s pack services. Past it, a call waits for a slot.

integer

\>= 1

**approvalsPending**

Approvals waiting for a decision. Past it, the step that asks fails, naming the limit.

integer

\>= 1

**projectsInProduction**

Projects in production at once. Past it, putting another project in production is refused with 403 `production-limit-reached`. Lowering it takes no project out of production.

integer

\>= 1

**storageMiB**

MiB of files the workspace may keep: its uploads, its runs’ files and its tools’ files, with the uploads under way. Past it, an upload is refused with 403 `storage-limit-reached`, and a tool’s file isn’t stored. Lowering it deletes no file.

integer

\>= 1

**flowsInProduction**

Flows in production, each counted once however many of the workspace’s projects in production run it. There’s a margin: a write that would take the count past the most, the larger of 1.2 times this (rounded down) and one more than it, is refused with 403 `plan-limit-reached` (`scope: tenant`), and a write’s answer warns from this number on (`planWarning`). Lowering it takes nothing out of production.

integer

\>= 1

**agentsInProduction**

Agents in production, counted as `flowsInProduction` is, with the same margin and the same refusal.

integer

\>= 1

**storage**

What the workspace’s files take now. Only from a runtime that counts them. Compare it with `limits.storageMiB`, in MiB of 1,048,576 bytes.

object

**usedBytes**

required

The bytes its uploads, its runs’ files and its tools’ files take, with the uploads under way. It can be over a limit lowered below it.

integer

**egress**

The IP addresses this deployment’s calls to other sites come from, for a site that admits only known addresses. They’re the same for every workspace on the deployment, so admitting them admits every workspace’s calls: a site still checks its own credentials. They say where calls come from, not where they go. Absent when the deployment publishes none. An empty list: none of that kind.

object

**server**

required

Where the server’s own calls come from, such as its calls to MCP servers and model providers, and its webhook deliveries.

Array\<string>

**deployments**

required

Where calls made by the code deployed to it come from.

Array\<string>

##### Example

```json
{
  "state": "active"
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 404

The workspace id on the token does not resolve to a stored row.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 429

`rate-limit-exceeded` with `details.limit: "api-requests"`, on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; `Retry-After` says when to send it again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

### 503

The database was too busy to answer in time (`database-busy`), or the authorization store couldn’t be reached (`authz-backend-unavailable`); `Retry-After` (whole seconds) says when to try again.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

#### Headers

**Retry-After**

integer

\>= 1

Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.

## See also

- [`PATCH /v1/tenant`: Rename the caller's workspace](https://docs.kindgi.com/v0.8.1/reference/api/operations/tenantupdate.md)
- [Publish the addresses your calls come from](https://docs.kindgi.com/v0.8.1/deploy/self-hosted/egress-addresses.md)
- [Serve many tenants](https://docs.kindgi.com/v0.8.1/deploy/self-hosted/serve-many-tenants.md)
- [Organize work by org and project](https://docs.kindgi.com/v0.8.1/guides/projects/organize-by-org-and-project.md)
- [Error code `authz-backend-unavailable`](https://docs.kindgi.com/v0.8.1/reference/errors.md#authz-backend-unavailable)
- [Error code `database-busy`](https://docs.kindgi.com/v0.8.1/reference/errors.md#database-busy)
- [Error code `rate-limit-exceeded`](https://docs.kindgi.com/v0.8.1/reference/errors.md#rate-limit-exceeded)
- [Every error code](https://docs.kindgi.com/v0.8.1/reference/errors.md)
