# List deployments whose pack service runs on values that changed

GET

/v1/system/pack-env

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

Across tenants: deployments with a `ready` pack service, whose pack declares an environment, and whose values changed since the revision their service runs (and weren’t held back at this revision, but for one held as `pack-env-update-failed`, listed for an hour after it was first held so it’s tried again, and one held for a cause the platform fixes, `pack-env-secret-unreadable` or `pack-env-secrets-unaudited`, listed every time with its `held`, as the revision doesn’t move when that’s fixed). Read each one’s values with `GET …/deployments/{deploymentId}/pack-env`, give them to the service, and record it with `PUT …/pack-env`, sending back the `appliedRevision` it was listed with. Ids, the image and the revision each runs, never a value. Takes `system:pack-env`.

## Authorizations

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

## Parameters

### Query Parameters

**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 whose pack service runs on declared env values that changed since: ids, the image, and the revision it runs. Never a value. Name the service `packServiceName(tenantId, deploymentId)` (`@kindgi/api`).

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

**appliedRevision**

The revision its service runs: given with its endpoint, or recorded since. Absent: none was. Send it back as `appliedRevision` with `PUT …/pack-env`.

string

**held**

Only when it’s held at its current revision for a cause the platform fixes, not the owner: it’s listed every time, as the revision doesn’t move when that’s fixed. Read its values again when your back-off says. Absent otherwise.

object

**code**

required

string

Allowed values: pack-env-secret-unreadable pack-env-secrets-unaudited

**since**

required

When it was first held.

string format: date-time

**nextCursor**

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

string

**hasMore**

required

boolean

##### Example

```json
{
  "data": [
    {
      "held": {
        "code": "pack-env-secret-unreadable"
      }
    }
  ]
}
```

### 400

A `limit` out of range, or 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:pack-env` (`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"
  }
}
```

### 501

The server doesn’t give a pack service its declared env: its pack services take theirs from how they’re run (`pack-env-unsupported`).

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/v0.1.10/deploy/self-hosted/serve-many-tenants.md)
- [Error code `pack-env-unsupported`](https://docs.kindgi.com/v0.1.10/reference/errors.md#pack-env-unsupported)
- [Error code `system-principal-required`](https://docs.kindgi.com/v0.1.10/reference/errors.md#system-principal-required)
- [Error code `system-scope-missing`](https://docs.kindgi.com/v0.1.10/reference/errors.md#system-scope-missing)
- [Every error code](https://docs.kindgi.com/v0.1.10/reference/errors.md)
