Zumik
v2 · Native state

Sessions

Create, retrieve, and delete causal state containers for agent workflows. A session holds a default branch and an append-only event history.

A session is a causal state container for an agent workflow, not a cache entry. Creating one mints a default branch you append events to. Sessions are prefixed ses_; their branches are prefixed br_. See sessions and the sessions and branching guide.

All requests require a bearer API key. See authentication.

Create a session

POST /v2/sessions

base_bundle_idsarray

Optional list of bnd_... ids that seed the session's reusable prefix. Each must exist in this project. Defaults to an empty list.

curl https://api.zumik.ai/v2/sessions \
  -H "Authorization: Bearer $ZUMIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "base_bundle_ids": ["bnd_01jy7n5t0x8mbs6y4p1ef7zrhk"] }'
from zumik import Zumik

zk = Zumik()
session = zk.sessions.create(base_bundle_ids=[bundle.id])
branch_id = session.default_branch_id
{
  "id": "ses_01jy7n7w2z9pcu7a5q2gh8askm",
  "object": "session",
  "project_id": "prj_01jy7n0a4c8m2t6v9q3wrxk7bd",
  "default_branch_id": "br_01jy7n7w30ardv8b6r3jk9btln",
  "status": "active",
  "base_bundle_ids": ["bnd_01jy7n5t0x8mbs6y4p1ef7zrhk"],
  "created_at": "2026-06-15T16:06:11Z"
}
idstring

Opaque session id, prefixed ses_.

objectstring

Always session.

project_idstring

The owning project.

default_branch_idstring

The id of the root branch created with the session, prefixed br_. Append events here, or fork from it. See branches.

statusstring

One of active, archived, tombstoned.

base_bundle_idsarray

The base bundles, echoed back.

created_atstring

RFC 3339 creation timestamp.

Retrieve a session

GET /v2/sessions/{session_id}

session_idstringpathrequired

The session id to fetch.

curl https://api.zumik.ai/v2/sessions/ses_01jy7n7w2z9pcu7a5q2gh8askm \
  -H "Authorization: Bearer $ZUMIK_API_KEY"

Returns the same session object as create.

Delete a session

DELETE /v2/sessions/{session_id}

Removes the session record. Its branches and events become unreachable.

session_idstringpathrequired

The session id to delete.

curl -X DELETE https://api.zumik.ai/v2/sessions/ses_01jy7n7w2z9pcu7a5q2gh8askm \
  -H "Authorization: Bearer $ZUMIK_API_KEY"
{
  "id": "ses_01jy7n7w2z9pcu7a5q2gh8askm",
  "object": "session.deleted",
  "deleted": true
}
idstring

The deleted session id.

objectstring

Always session.deleted.

deletedboolean

true when the session was removed.

Errors

StatusCodeWhen
400invalid_request_errorA referenced base bundle does not exist in this project.
401invalid_api_keyMissing or invalid API key.
404invalid_request_errorThe session does not exist in this project.

See the full table on errors.

On this page