---
title: "Get a space's runtime apply state"
method: GET
path: "/v1/spaces/{spaceId}/apply-state"
tags: ["Spaces"]
---

# Get a space's runtime apply state

`GET /v1/spaces/{spaceId}/apply-state`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/apply-state`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Returns whether the space has desired runtime changes pending, applying, live, or failed. This is the space's own serving state, not an operation's: for the progress of a specific apply, poll the operation handle that apply returned.

## Path parameters

- `spaceId` string, required

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `status` 'live' | 'pending' | 'applying' | 'failed', required: `live` when the runtime matches the desired state, `pending` when a change is waiting to be applied, `applying` while an apply is running, `failed` when the last apply failed.
    - `desiredRevision` string, nullable, required: Version the space wants to serve; null when nothing is pending.
    - `appliedRevision` string, nullable, required: Version the runtime is serving now.
    - `lastError` string, nullable, required: Why the last apply failed; null unless `status` is `failed`.
    - `canApplyNow` boolean, required: Whether an apply would do something right now, for gating an Apply control.

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
