Write a local mirror's messages — the copy of a conversation that ran on the person's own computer [write]

Changed on

Only for a session created with local_mirror, and only by its owner using a personal API key (a workspace key is 403). Body {messages: [{id, role: user|agent, created_at, parts}] (up to 200), title?, status?: running|idle, recorded_state?: unknown|working|completed|failed|cancelled}. recorded_state is the owner's latest native protocol observation, stored on the mirror and exposed as local_mirror.recorded_state in Task detail; it does not attest process liveness or task success. Missing state on a message write is unknown. Each message is upserted by its id, so a growing agent turn is sent again whole; values shaped like a secret are masked before storing. Limits: 512 KiB per message (413 message_too_large naming it), 4 MiB per body (413), 20,000 messages per session (422 mirror_quota_exceeded). A session that is not a mirror answers 409 not_a_mirror_session, an archived one 410. Nothing runs and nothing is billed.

put/sessions/{id}/mirror

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/sessions/{id}/mirror
  • Auth
    HTTP bearer

Path parameters

idstring required

The session id

Request body

titlestring
status'running' | 'idle'
recorded_state'unknown' | 'working' | 'completed' | 'failed' | 'cancelled'

Response

Stored

storedinteger
syncedAtstring date-time

Changes