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

## Changes

- **2026-06-29** `047f9b2e19c3` — 1 info
  - the endpoint scheme security `bearerAuth AND lockToken` was added to the API
- **2026-04-22** `7623fe906e93` — 2 info
  - the `grantVersion` request property default value `1` was added
  - request property `grantVersion` list-of-types was widened by adding types `integer` to media type `application/json`
- **2026-04-15** `c9f9f7d113fd` — 1 breaking
  - the `grantVersion` request property type changed from `integer` to `string`, and format from `int32` to no format

[Change history](https://skmtc.dev/defra/apis/grants-ui-backend-api/changes/state/post.md)

---

[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)
