---
title: "Create or update the state for a connection."
method: POST
path: "/v1/state/create_or_update"
tags: ["state", "internal"]
---

# Create or update the state for a connection.

`POST /v1/state/create_or_update`

## Request body

- ConnectionStateCreateOrUpdate
  - `connectionId` string, uuid, required
  - `connectionState` ConnectionState, required — Contains the state for a connection. The stateType field identifies what type of state it is. Only the field corresponding to that type will be set, the rest will be null. If stateType=not_set, then none of the fields will be set.
    - `connectionId` string, uuid, required
    - `globalState` GlobalState
      - `shared_state` StateBlob
      - `streamStates` StreamState[], required
        - `streamDescriptor` StreamDescriptor, required
          - `name` string, required
          - `namespace` string
        - `streamState` StateBlob
    - `state` StateBlob
    - `stateType` 'global' | 'stream' | 'legacy' | 'not_set', required
    - `streamState` StreamState[]
      - `streamDescriptor` StreamDescriptor, required
        - `name` string, required
        - `namespace` string
      - `streamState` StateBlob

## Response `200`

Successful operation

- ConnectionState — Contains the state for a connection. The stateType field identifies what type of state it is. Only the field corresponding to that type will be set, the rest will be null. If stateType=not_set, then none of the fields will be set.
  - `connectionId` string, uuid, required
  - `globalState` GlobalState
    - `shared_state` StateBlob
    - `streamStates` StreamState[], required
      - `streamDescriptor` StreamDescriptor, required
        - `name` string, required
        - `namespace` string
      - `streamState` StateBlob
  - `state` StateBlob
  - `stateType` 'global' | 'stream' | 'legacy' | 'not_set', required
  - `streamState` StreamState[]
    - `streamDescriptor` StreamDescriptor, required
      - `name` string, required
      - `namespace` string
    - `streamState` StateBlob

## Other responses

- `404` — Object with given id was not found.
- `422` — Input failed validation

---

[API](https://skmtc.net/airbyte/apis/config.md) · [All operations](https://skmtc.net/airbyte/apis/config/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/airbyte/config/revisions/ce48e08e02ec/schema)
