# Where the deployment's license key stands

GET

/v1/license

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

Whose key, which use, until when and how many days are left, and from 30 days before it expires how to get the next one, as the runtime’s startup banner says it. Never the key itself. `mode: development` when the runtime runs with `KINDGI_DEV` and needs no key. The license is the deployment’s: its own token (`KINDGI_API_TOKEN`), or a system key holding `system:license` (the renewal job’s), reads all of it, `renew` with where the deployment keeps its key included. Where the deployment serves exactly one tenant, that tenant’s admins read the countdown only (`mode`, `standing`, `expiresAt`, `startsUntil`, `daysLeft`, `renewBy`): never whose key it is or where it’s kept. Anyone else is refused. A deployment that doesn’t report it answers 404.

## Authorizations

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

## Responses

### 200

The license status.

application/json

object

**mode**

required

`development`: no key needed (`KINDGI_DEV`); the key’s fields are absent, and `preview` may be present.

string

Allowed values: development licensed

**name**

Whose key: the name the banner prints.

string

**use**

string

Allowed values: production non-production

**expiresAt**

string format: date-time

**startsUntil**

Until when the runtime starts with this key: `expiresAt` plus the 14-day grace.

string format: date-time

**daysLeft**

Whole days until it expires; negative once it has.

integer

**standing**

`expiring`: 30 days or fewer left. `grace`: expired, and the runtime still starts with it (for 14 days). `expired`: past the grace too: this server runs on, but won’t start with it again.

string

Allowed values: valid expiring grace expired

**renewBy**

Which way to the next key applies: `command`, a key this deployment renews itself (`kindgi license renew`); `contact`, a key Kindgi issued (write to Kindgi).

string

Allowed values: command contact

**renew**

How to get the next key, as the banner says it, with where the deployment keeps its key and renewer. Present from 30 days before the key expires, and only to the deployment’s own token.

string

**preview**

This build’s own expiry, before Kindgi 1.0: a preview release stops starting 90 days after it was released, in every mode, unless a production key exempts it. Absent when nothing expires: a 1.0 or later release, a build from source, or a production key.

object

**version**

required

This build’s release, `0.1.8`.

string

**releasedAt**

required

string format: date-time

**expiresAt**

required

From then on, it no longer starts: `releasedAt` plus 90 days.

string format: date-time

**daysLeft**

required

Whole days until then; negative once it has passed.

integer

**standing**

required

`expiring`: 30 days or fewer left. `expired`: past it: this server runs on, but won’t start again; run a newer release.

string

Allowed values: valid expiring expired

##### Example

```json
{
  "mode": "development",
  "use": "production",
  "standing": "valid",
  "renewBy": "command",
  "preview": {
    "standing": "valid"
  }
}
```

### 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"
  }
}
```

### 403

Not the deployment’s own token, a system key holding `system:license`, or an admin of the one tenant it serves (`license-operator-only`).

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"
  }
}
```

## See also

- [Licensing](https://docs.kindgi.com/v0.1.9/concepts/licensing.md)
- [Run with authorization](https://docs.kindgi.com/v0.1.9/deploy/authorization.md)
- [Operate a self-hosted runtime](https://docs.kindgi.com/v0.1.9/deploy/self-hosted/operate.md)
- [Error code `license-operator-only`](https://docs.kindgi.com/v0.1.9/reference/errors.md#license-operator-only)
- [Every error code](https://docs.kindgi.com/v0.1.9/reference/errors.md)
