Skip to content
Console
Menu

Getting Started

Authentication

KV Store

Archive an agent session

Archives a session: the session and its event log stay readable, but no new turn may start and the session's captured credential handles are…

Archives a session: the session and its event log stay readable, but no new turn may start and the session's captured credential handles are revoked. An idle or failed session archives at once; a running turn is refused with INVALID_STATE (interrupt it first). Repeating the call with the same Idempotency-Key returns the same session.

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:archive
  • Scope agents:sessions
  • Effect write — a successful call changes state.
  • Collection agent_sessions

#Request

FieldTypeWhat it is
namestringThe name of the session to archive. Required.

#Response

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/agent_sessions/{agent_session}.
uidstringases_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
agentstringThe Agent the session talks to. Required.
agent_versionstringThe AgentVersion the session pinned; the Agent's current version when unset at create.
end_userstringThe Sylphx Auth end user the session belongs to, set from the caller's end-user session; empty for a session a secret key started. An end user reads and changes only their own sessions. Output only.
titlestringA short title; set by the caller or summarised by the runtime.
stateSessionStateThe session's state. Output only. One of idle, running, awaiting_approval, awaiting_client, failed, archived.
turn_countint64The number of turns started, from 0. Output only.
last_event_sequenceint64The sequence of the newest event, from 0. Output only.
create_timetimestampWhen the session was created. Output only.
update_timetimestampWhen the last event was appended. Output only.
usageSessionUsageWhat the session has used so far. Output only.
environment_leasestringThe Sylphx Sandboxes lease attached to the session, while it has one. Output only.
environmentEnvironmentSpecThe immutable effective environment for this session. RunAgent resolves it from the pinned AgentVersion's frozen default and selected request overrides. For CreateAgentSession, omission inherits the pinned default; an explicit environment replaces it.
credentialsmap<string, CredentialBinding>Session-scoped credential bindings, keyed by the tool or MCP credential name. Values are references or opaque handles, never secret values.
profilesProfileMount[]Granted platform Profiles to mount when the session starts, each by resource name and mode. The runtime never puts profile values in events.
verifiesstring[]The maker sessions this session verifies, as its :run named them; empty for any other session. Output only.
archive_timetimestampWhen the session was archived; unset while it is not archived. Output only.
organization_contextstructThe pinned organization layer: its sha256 digest, instructions and skill names and descriptions. Skill bodies are never returned. Output only.
organization_layerOrganizationLayerThe organization layer the caller binds at assignment, read from its own versioned store. Admission pins it for the session's life: its instructions and skill index are injected at every activation, and a skill body is read from the pin only when the agent loads it. Never returned; organization_context shows the pin.

#ResourceMeta

FieldTypeWhat it is
generationint64Increases by one on every change to spec. Output only.
etagstringStrong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only.
create_timetimestampWhen the Resource was created. Output only.
update_timetimestampWhen the Resource last changed. Output only.
delete_timetimestampSet while the Resource is being deleted. Output only.
labelsmap<string, string>Caller-writable, indexed labels (AIP-122 label rules).
annotationsmap<string, string>Caller-writable, unindexed annotations.
display_namestringCaller-writable human-readable name.
creatorstringThe principal that created the Resource. Output only.

#SessionUsage

FieldTypeWhat it is
active_turn_durationdurationTime turns were active. Output only.
gateway_callsint64Tool calls made through the gateway. Output only.
spend_microsint64Spend so far in micro-USD, models and tools together. Output only.

#EnvironmentSpec

FieldTypeWhat it is
shapestringA Sylphx Sandboxes shape; empty gives sessions no environment.
idle_standbydurationPut the environment in standby after this long idle, 1m to 24h; default 10m.
templatestringThe Sandboxes image: template:<name> or an artifact image by digest, passed unchanged to the lease's image field.
repoRepositorySpecThe repository to prepare inside the fresh lease, if any.
egressLeaseNetworkThe lease's outbound policy, using the Sandboxes network contract.
budgetLeaseBudgetThe lease's CPU and cost ceiling, separate from model and tool spend.
ttldurationThe lease's maximum wall time, passed to Sandboxes as ttl. The lease is released when the session ends even if this bound has not been reached.

#CredentialBinding

FieldTypeWhat it is
secretstringA Kernel Secret of this environment, by name. One of the source group.
connectionstringA Kernel Connection (a third-party OAuth installation), by name. One of the source group.
end_user_providerstringThe end user's own grant in Sylphx Auth's agent token vault, by provider id; the session's end user must hold it. One of the source group.
placementstringHow the value is sent: bearer (default), header:<Name> or query:<name>.
handlestringAn opaque credential handle issued for this session, resolved only at egress. This is never a credential value. Never returned again. One of the source group.

#ProfileMount

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/profiles/{profile}. Required.
modestringread_only (default) or write_back. Only a write_back grant saves changes at session end while its lease still answers; empty is read_only.

#OrganizationLayer

FieldTypeWhat it is
instructionsstringAlways loaded organization instructions, at most 256 KiB.
skillsOrganizationSkill[]Up to 256 skills with unique names; the layer is at most 1 MiB in total.

#RepositorySpec

FieldTypeWhat it is
uristringThe repository URI. Access uses the session's bound credential handles. Required.
revisionstringThe commit or ref to check out; empty uses the repository's default branch.

#LeaseNetwork

FieldTypeWhat it is
egressEgressPolicyDefault ALLOW. One of allow, deny, allowlist.
allowed_domainsstring[]Hosts reachable when egress is ALLOWLIST: exact names or one leading *. wildcard label, for example api.openai.com, *.github.com.
allowed_cidrsstring[]Public CIDRs reachable when egress is ALLOWLIST.
blocked_cidrsstring[]The ranges blocked under every policy. Output only.

#LeaseBudget

FieldTypeWhat it is
max_cpu_secondsint64End CPU_BUDGET after this many vCPU-seconds of guest CPU time.
max_cost_microsint64End COST_BUDGET once the shape's list price times wall seconds reaches this many millionths of a US dollar.

#OrganizationSkill

FieldTypeWhat it is
namestringThe model-facing name, [a-z0-9][a-z0-9_-]{0,62}. Required.
descriptionstringDiscovery description, nonempty and at most 4 KiB. Required.
bodystringInstructions loaded by organization.skill.get, nonempty and at most 256 KiB. Required.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/agent_sessions/agent-session:archive" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'