# update_session (/identify/reference/update-session)



Send `entity_id` once you know whose session it is, such as after sign-in. Send `null` or `""` to clear it. [`list_sessions`](/identify/reference/list-sessions) with `entity_id` then lists that customer's sessions.

## PATCH https://api.finic.ai/v1/identify/sessions/{id}

Sets or clears a session's `entity_id`: your own id for the customer or user account the session belongs to. Send a string to set it, and `null` or `""` to clear it. Only this call sets it: the snippet can't, so a browser can't claim to be someone else's session. Nothing else of the session changes, its [verdict](/identify/verdicts) and `updated_at` included.

Authorization: `Bearer <API key>` (see [Authentication](/authentication)).
- Path parameter `id`: The session's `id`, `ksn_…`.

### Request body (application/json)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entity_id` | string or null |  | Your id for the customer or account, 1 to 128 characters with no control characters. Spaces around it are dropped. `null` or `""` clears it. Without it, nothing changes. |

Example:

```json
{
  "entity_id": "user_123"
}
```

### Responses

- **200**: The session, as changed.

| Field | Type | Always | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The session's id, `ksn_…`. |
| `site_id` | string | yes | The site it belongs to, `kst_…`. |
| `entity_id` | string or null | yes | Your own id for the customer or account the session belongs to, or `null` until you [set one](/identify/reference/update-session). The snippet never sets it. |
| `status` | string | yes | Always `complete`. |
| `actor` | `human`, `ai_agent`, `automation`, `unknown` | yes | What the visitor is taken to be: `human` (the page was used the way a hand uses it), `ai_agent`, `automation`, or `unknown` (nothing for or against yet, as on a page that has only loaded). See [Verdicts](/identify/verdicts). |
| `operator` | string or null | yes | Who runs the agent, such as `OpenAI`, or `null`. For an impersonation, the operator it claims. |
| `product` | string or null | yes | The agent, such as `ChatGPT-User`, or `null`. |
| `category` | `training_crawler`, `search_fetcher`, `user_triggered_agent`, `other_crawler`, `generic_automation`, `null` | yes | What kind of agent it is: `training_crawler`, `search_fetcher`, `user_triggered_agent` (it acts for a person who asked) or `other_crawler`; `generic_automation` for an HTTP library or automation tool; `null` when unknown. |
| `verification` | `signed`, `network_verified`, `claimed`, `impersonated`, `none` | yes | How far the claim to be an agent was checked: `signed`, `network_verified`, `claimed`, `impersonated` or `none`. See [Verification](/identify/verdicts#verification). |
| `confidence` | `high`, `medium`, `low` | yes | How sure the verdict is. `low` is a hint, not a decision. See [Confidence](/identify/verdicts#confidence). |
| `reasons` | array of string | yes | What the verdict rests on, as [reason codes](/identify/verdicts#reason-codes). New codes can be added. |
| `network` | object | yes | Where the address is. |
| `ip` | string | yes | The visitor's address, from the report the verdict rests on: usually the latest. |
| `user_agent` | string | yes | That report's user agent, cut to 400 characters. |
| `page` | string | yes | The page that sent it: its origin and path, without the query. Path segments that look like a token or a name are `*`. |
| `reports` | integer | yes | The number of reports the session has taken. |
| `visitor_id` | string or null | yes | The session's [visitor](/identify/visitors), `kvi_…`: the same id for every session of the same browser. `null` until the browser has been identified, usually within a second of the page loading, and when the tag has `data-visitor="off"`. |
| `visitor` | object or null | yes | The visitor and how this session was matched to it, or `null` with `visitor_id`. |
| `signals` | object |  | With `signals=true`: the snippet's latest report, as `v`, `sv`, `page`, `env`, `input` and `fp`. Its fields are listed under [What the snippet collects](/identify/data#what-the-snippet-collects). |
| `created_at` | string | yes | When the session started. |
| `updated_at` | string | yes | When it last reported. |
| `request_id` | string |  | `req_…`, the same as the `X-Request-Id` header. |
| `network.type` | `data_center`, `operator`, `unknown` | yes | `data_center` for a listed cloud provider's address, `operator` for an address in an agent operator's published ranges, `unknown` otherwise. |
| `network.provider` | string or null | yes | The cloud provider or operator, or `null`. |
| `network.range` | string or null | yes | The published range that holds the address, such as `192.0.2.0/24`, or `null`. |
| `visitor.id` | string | yes | The same as `visitor_id`. |
| `visitor.match` | `stored_id`, `fingerprint`, `new` | yes | How the visitor was recognised: `stored_id` (the id the browser kept), `fingerprint` (its fingerprint and network, with no stored id) or `new` (first seen in this session). See [How a visitor is matched](/identify/visitors#how-a-visitor-is-matched). |
| `visitor.confidence` | `high`, `medium`, `low` | yes | How sure it is that this session is this visitor's and nobody else's. See [Confidence](/identify/visitors#confidence). |
| `visitor.sessions` | integer | yes | The number of sessions the visitor has had. |
| `visitor.first_seen_at` | string | yes | When the visitor was first seen. |

```json
{
  "id": "ksn_01M4Z2K8Q0V7C3N5T9XB6RHDWE",
  "site_id": "kst_01M4Z1X3G5P8D2F6J0YA4SMQNC",
  "entity_id": "user_123",
  "status": "complete",
  "actor": "human",
  "operator": null,
  "product": null,
  "category": null,
  "verification": "none",
  "confidence": "high",
  "reasons": [
    "human_like_input"
  ],
  "network": {
    "type": "unknown",
    "provider": null,
    "range": null
  },
  "ip": "198.51.100.24",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "page": "https://www.example.com/checkout",
  "reports": 4,
  "visitor_id": "kvi_01M4Z2Q7B3X9K5W1E8TN6GHPAD",
  "visitor": {
    "id": "kvi_01M4Z2Q7B3X9K5W1E8TN6GHPAD",
    "match": "stored_id",
    "confidence": "high",
    "sessions": 7,
    "first_seen_at": "2026-11-18T09:41:07.120443Z"
  },
  "created_at": "2026-12-01T17:04:11.482913Z",
  "updated_at": "2026-12-01T17:04:19.905127Z",
  "request_id": "req_01M4Z2R6B3K9T1W5X8NC7DGHJQ"
}
```

- **400**: `invalid_request`: the body isn't a JSON object or has an unknown field; or `entity_id` isn't a string or `null`, is only spaces, is over 128 characters, or has a control character (`param` is `entity_id`).

- **401**: `authentication_error`: the API key is missing, unknown, revoked or expired.

- **404**: `not_found`: no session with this `id` in your organization. Sessions are deleted after 30 days.

- **429**: `rate_limited`: over Identify's [request rate](/identify/reference#limits) for the organization, 50 a second. Retry with backoff.
