Create a session
A session runs one agent version and keeps the event log every other session route reads. The response carries the session’s first token, which is shown once.
POST
/v1/sessionsAuthorization
AuthorizationBearer token · headerrequiredHeader parameters
Idempotency-KeystringRetry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Kikuvi-Workspacestring<uuid>Workspace to create in. Required for a user caller; implied by the key for an API key caller.
Request body
requiredapplication/jsonagent_idstring<uuid>requireddisplay_namestringHuman label for the session. Omitted reads as empty.
max length 200
metadataobjectLabels for the session, fixed at creation and inherited by every
session it spawns. Each usage row the session produces carries a copy,
so usage can be filtered and grouped by them. At most 50 keys, each 1
to 64 lowercase letters, digits, or underscores and not starting with
`subako_`; each value a string of at most 500 characters. Usage keeps
them after the session is deleted, so put opaque identifiers here,
never personal or secret information.
vault_idsstring<uuid>[]Vaults this session may draw tool-source credentials from; each must
be a live vault in the session's workspace.
max items 10
Responses
200Replayed receipt. The token secret is never replayed. If the first response was lost, mint a replacement with a new key. The original token remains valid until expiry.
agent_idstring<uuid>requiredagent_version_idstring<uuid>requiredcreated_atstring<date-time>requireddisplay_namestringrequiredidstring<uuid>requiredmetadataobjectrequiredsession_token_expires_atstring<date-time>requiredsession_token_idstring<uuid>requiredstatusSessionStatusBodyrequiredWhether a run is under way. Input is accepted either way: it starts a run
when the session is `idle` and steers the live one when it is `active`.
Allowed:
idleactiveworkspace_idstring<uuid>required201Created. The session token is shown once.
agent_idstring<uuid>requiredagent_version_idstring<uuid>requiredcreated_atstring<date-time>requireddisplay_namestringrequiredidstring<uuid>requiredmetadataobjectrequiredsession_tokenstringrequiredShown once. Store it now; it cannot be retrieved again.
session_token_expires_atstring<date-time>requiredstatusSessionStatusBodyrequiredWhether a run is under way. Input is accepted either way: it starts a run
when the session is `idle` and steers the live one when it is `active`.
Allowed:
idleactiveworkspace_idstring<uuid>required400Malformed body, a display_name over 200 characters, more than 10 vault_ids, metadata outside its bounds or under a reserved key, an agent with no live version, a vault outside the workspace, a malformed workspace header, or a user caller with no workspace header.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired401Missing, malformed, or invalid bearer token.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired403Caller lacks session.create, or an API key's Kikuvi-Workspace header names another workspace.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired404No such workspace, agent, or vault -- or the caller cannot see it.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired409Idempotency-Key was already used for a different request. The same vault named twice.
errorErrorDetailrequiredWhat went wrong: a `code` to branch on and a `message` to show. The
message is written for a person and may change; the code will not.
Show propertiesHide properties
codeErrorCoderequiredThe machine-readable half of an error response, and the field a client
branches on. Closed: every error carries exactly one of these.
Allowed:
unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternalmessagestringrequired