Skip to main content
PUT
/
agents
/
{agentId}
/
state
JavaScript
import Nuntly from '@nuntly/sdk';

const client = new Nuntly({
  apiKey: process.env['NUNTLY_API_KEY'], // This is the default and can be omitted
});

const agentState = await client.agents.state.upsert('x', { state: { foo: 'bar' } });

console.log(agentState.id);
{
  "data": {
    "id": "<string>",
    "createdAt": "<string>",
    "agentId": "<string>",
    "inboxId": "<string>",
    "threadId": "<string>",
    "state": {},
    "summary": "<string>",
    "updatedAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers Authorization: Bearer <API_KEY>

Path Parameters

agentId
string
required

The external agent identifier.

Minimum string length: 1

Body

application/json

Agent state with optional inbox or thread scope.

state
object
required

The agent state key-value data.

inboxId
string

The inbox id to scope the state to.

threadId
string

The thread id to scope the state to.

summary
string | null

A human-readable conversation summary.

Response

Successful response.

data
object
required