> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update session label and metadata

> Change an Agent Vault session's label and metadata with the Node.js SDK.

`client.agentVault().sessions.update()` adds, changes, or removes a session's label or metadata, for example to record what the agent is working on. You can change them after the session expires or is revoked, unless someone deleted the session's owner or the user that the session was created on behalf of.

## Parameters

**sessionId** `string` *required*

The ID of the session.

**options** `object` *required*

**properties**

**label** `string | null`

The new label, or `null` to remove the label (up to 128 characters, without line breaks, tabs, or invisible characters; leave it out to keep the current label).

**metadata** `object`

The new [metadata](https://infisical.com/docs/documentation/platform/agent-vault/sessions#label-a-session-and-add-metadata), which replaces all of it, or `{}` to remove it (up to 20 keys, each key up to 255 characters and each value 1 to 1020, without line breaks, tabs, or invisible characters, and no `=` in a key; leave it out to keep the current metadata).

## Returns

**session** `AgentVaultSession`

The updated session.

```typescript Basic theme={"dark"}
const session = await client.agentVault().sessions.update("<session-id>", {
  label: "support ticket triage", // Optional
  metadata: { ticket: "OPS-142" } // Optional
});
```

```typescript Remove the label theme={"dark"}
const session = await client.agentVault().sessions.update("<session-id>", {
  label: null
});
```

```json Response theme={"dark"}
{
  "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "label": "support ticket triage",
  "actor": {
    "type": "machineIdentity",
    "id": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
    "name": "deploy-bot"
  },
  "onBehalfOf": null,
  "status": "active",
  "expiresAt": "2026-12-02T13:00:00.000Z",
  "revokedAt": null,
  "createdAt": "2026-12-02T12:00:00.000Z",
  "accessBundle": {
    "id": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
    "name": "release"
  },
  "services": [],
  "metadata": { "ticket": "OPS-142" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.