---
title: "Update connection variables"
method: PATCH
path: "/connection/{id}/variables"
tags: ["Connections"]
---

# Update connection variables

`PATCH /connection/{id}/variables`

## Request

- Base URL: `https://api.elaichi.ai`
- URL: `https://api.elaichi.ai/connection/{id}/variables`
- Auth: HTTP bearer

Updates a connection's context variables. Merge patch over top-level keys, same `can_manage` bar as the read: `set` replaces the keys it names, `unset` deletes the keys it names, and everything else in the account context — the keys this API may not read, the OAuth token blob first among them — is left where it is, so a patch cannot destroy what it cannot see. Secret keys cannot be set or unset here. Answers `200` with the same list envelope the GET returns, reflecting the new state.

## Path parameters

- `id` string, required

## Query parameters

- `limit` integer
- `cursor` string

## Headers

- `X-Organization-Id` string

## Request body

- object
  - `set` object: Top-level keys to replace, real JSON shapes as values.
  - `unset` string[]: Top-level keys to delete.

## Response `200`

OK

- object
  - `result` object[], required
    - `name` string, required: Top-level context key; rows sort and page over it.
    - `value` unknown, required
    - `is_secret` boolean, required: Whether Elaichi stores this value as a secret; the value itself is returned as `null`.
    - `has_secrets` boolean, required: A leaf at or under this key was withheld — true for a secret key itself, and for a public object one of whose leaves was stripped.
  - `next_cursor` string, nullable, required
  - `prev_cursor` string, nullable, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `429`: Rate limited

---

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