---
title: "Create or update application state"
method: POST
path: "/state"
tags: ["State"]
---

# Create or update application state

`POST /state`

## Request body

- StateSaveRequest
  - `sbi` string, required
  - `grantCode` string, required
  - `grantVersion` union, required
    - string
    - integer
  - `state` StateObject, required — Arbitrary state object stored by the service

## Response `200`

State updated

- StateSaveResponse
  - `success` boolean, required
  - `created` boolean — Present and true when a new state record was created
  - `updated` boolean — Present and true when an existing state record was updated

## Other responses

- `201` — State created
- `400` — Validation error
- `500` — Failed to persist state

---

[API](https://skmtc.dev/defra/apis/grants-ui-backend-api.md) · [All operations](https://skmtc.dev/defra/apis/grants-ui-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/defra/grants-ui-backend-api/revisions/09665d03cacb/schema)
