# List deployments that need a pack service, or should lose theirs

GET

/v1/system/deployments

```sh
curl --request GET \
  --url 'https://example.com/v1/system/deployments?endpoint=missing&limit=25' \
  --header 'Authorization: Bearer <token>'
```

Across tenants, oldest `activatedAt` first. `endpoint=missing`: deployments that need a pack service. Each is routed (the newest deployment with routes for some tool version or pack check), has no endpoint or a cleared one, and nothing about it is closing or suspended. `endpoint=retire`: deployments with an endpoint whose pack service should go, each with its `reason`. Name each service `packServiceName(tenantId, deploymentId)` (`@kindgi/api`). Takes `system:deployments`. Each entry carries the tenant’s id and nothing else of it.

## Authorizations

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

## Parameters

### Query Parameters

**endpoint**

required

string

Allowed values: missing retire

`missing`: deployments that need a pack service. `retire`: deployments whose pack service should go.

**cursor**

string

Where the previous page ended: its `nextCursor`, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise `400 bad-input`, and the list starts again without it. Absent → first page.

**limit**

integer

default: 25 >= 1 <= 100

1..100. Default 25.

## Responses

### 200

One page of deployments.

application/json

object

**data**

required

Array\<object>

A deployment as whatever runs its pack service needs it: ids and the image, nothing of the tenant beyond its id. Name the service `packServiceName(tenantId, deploymentId)` (`@kindgi/api`). In the `retire` list, `reason` says why the service should go.

object

**tenantId**

required

string format: uuid

**deploymentId**

required

string

\>= 1 characters

**packId**

required

The pack it deploys (the image index’s `packId`).

string

\>= 1 characters

**projectId**

The deployment’s project, as a call routes in it: the one it named, else the tenant’s Default. Absent only when the tenant has no Default project.

string

**imageRef**

required

Digest-pinned, as registered: the pack service is created from exactly this.

string

**imageDigest**

required

string

/^sha256:\[0-9a-f]{64}$/

**artifactVersion**

required

string

**activatedAt**

required

string format: date-time

**reason**

In the `retire` list only. `superseded`: newer deployments ship every tool version and check it does, so no new call reaches it. A tool call a step made on it still goes back to it when the step runs again, and fails closed (`pack-endpoint-cleared`) once its endpoint is cleared. `tenant-closing`, `tenant-suspended`: every deployment of the tenant, routed or not. `project-suspended`, `pack-suspended`: every deployment of the project, or this one.

string

Allowed values: superseded tenant-closing tenant-suspended project-suspended pack-suspended

**nextCursor**

Opaque cursor for the next page. Absent when `hasMore: false`.

string

**hasMore**

required

boolean

##### Example

```json
{
  "data": [
    {
      "reason": "superseded"
    }
  ]
}
```

### 400

`endpoint` missing or neither `missing` nor `retire`; a `limit` out of range; a cursor refused.

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

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

A tenant’s key or session (`system-principal-required`), or a system key without `system:deployments` (`system-scope-missing`).

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

- [Serve many tenants](https://docs.kindgi.com/deploy/self-hosted/serve-many-tenants.md)
- [Kindgi 0.1.9](https://docs.kindgi.com/releases/0.1.9.md)
- [Error code `system-principal-required`](https://docs.kindgi.com/reference/errors.md#system-principal-required)
- [Error code `system-scope-missing`](https://docs.kindgi.com/reference/errors.md#system-scope-missing)
- [Every error code](https://docs.kindgi.com/reference/errors.md)
