# Get service state

`GET https://api.instacloud.com/projects/{projectId}/services/{serviceId}/state`

**Token scope:** `account` · `org` · `project` — read-only tokens allowed.

A compute service's desired (developer intent) vs. live runtime state.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | `string` | yes |  |
| `serviceId` | path | `string` | yes |  |

## Response 200

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `desiredState` | `string` | no | running\|stopped\|suspended |
| `state` | `string` | no | running\|suspended\|stopped\|none\|unknown |
| `lastFailure` | `object` | no | the newest deploy attempt's failure; omitted when the newest attempt succeeded |
| `lastFailure.kind` | `"deploy" \| "build"` | yes | build: no image was produced; deploy: the image was built (or given) but did not go live |
| `lastFailure.at` | `string` | yes |  |
| `lastFailure.reason` | `string` | yes | tenant-safe: the same message the failing deploy or build already reported |
| `lastFailure.buildId` | `string` | no | when the attempt was a build: `insta build logs <buildId> --source <buildSource>` |
| `lastFailure.buildSource` | `"github" \| "archive"` | no |  |

## Response 400

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |

## Response 404

Default Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | `string` | yes |  |
