Skip to main content
PUT
Replace a key's value
Takes a managing key (oc_key_...) or a signed-in session. See Custom connections for how a key is sent. Sets a new value on a key, as a new version. Agents use it on their next request. Never answers with the value. Audited as rotate.
Availability: OneCLI Cloud and self-hosted.

Authorizations

Authorization
string
header
required

A managing key (oc_key_...), an older API key (oc_...), or a signed-in session.

Headers

if-match
string
required

Required. The item's version as you read it. Missing answers 428; a newer one answers 409, and nothing changes.

Pattern: ^"?\d{1,9}"?$

Path Parameters

id
string
required

The item's id.

Required string length: 1 - 64

Body

application/json
value
string
required

The key's new value. Stored encrypted. No answer ever carries it back.

Required string length: 1 - 10000

Response

The item, at its new version. Never the value.

allowPlainHttp
boolean
required

The gateway may send this item over plain http://. Off unless a person turns it on.

createdAt
string
required

ISO 8601.

deletedAt
string | null
required

ISO 8601. When it was deleted. null: a live item. A deleted item is listed only with deleted=true.

enabled
boolean
required

Off: the gateway does not use the item for any agent, whatever its permissions say. Requests to its hosts go out with no credential.

hosts
string[]
required

The hosts the gateway uses this item for.

id
string
required
kind
enum<string>
required
Available options:
app,
api_key,
llm_key
lastUsedAt
string | null
required

ISO 8601. When the gateway last used it for a request, to the hour. null: never used.

name
string
required
permissionSummary
object
required
purgeAt
string | null
required

ISO 8601. When a deleted item is destroyed for good, unless restored first. null: a live item.

rotatedAt
string
required

ISO 8601. When the value was last set: made, given a new value, or refreshed by the gateway.

service
string | null
required

The app or LLM provider, for example github or anthropic. null for a plain API key.

state
enum<string>
required

ready, reauth_required (the app must be signed in again) or disconnected.

Available options:
ready,
reauth_required,
disconnected
vaultId
string
required
version
integer
required

A key's current version, for If-Match on a change. 0 for an app, which has no versions.

addedBy
object | null
required

Who added the key. null: an app, not known, or that person is no longer in the organization.

sentAs
string | null
required

How the gateway sends a key, the value as dots: a header, a query parameter or a path. Built from the stored config, never from the value. null: an app, or not known.