Skip to content

Delete a thread, and erase it​

DELETE
/api/threads/{threadId}

Deletes the caller's thread and every thread made from it by an edit, transitively (an edit is a branch of the conversation that the list does not show, so deleting only the visible one would leave copies the person can no longer see or erase), and erases them (ADR 0043):

  • the log, the outbox, the agent binding, the watches and the timers are deleted, in one transaction;
  • the share goes with the row: every link to the thread, a signed-in reader's and a public one, is a 404 from that moment, and a stream open on it, the owner's or a reader's, ends (the client reconnects and is told the thread is not found);
  • the files of the thread and of its edits are erased from the artifact store right after, or within a sweep of the orchestrator's workers when the store is down (the answer does not wait for a sweep: the log is gone, and so is anything that referred to a file);
  • forks are kept: a fork is a conversation of its own (forkedFrom has no threadId any more) and, when it was nested under the deleted thread, takes its place in the caller's list, in the section (pinned, archived) and the order it had.

A thread that works is refused, 409 thread_active: it is queued, working or verifying, or an agent its job asked is still running (the same goes for an edit of it). Deleting would cascade the unsent request to stop the agent away, and the agent would go on working, perhaps pushing to a repository. Stop it (cancelThread), wait for a terminal state on the stream (stopping is a request, not a state: the thread ends when the agent reports it), and delete it. A blocked thread, which waits for the person, can be deleted.

Needs thread.delete and the thread to be the caller's, not thread.write. A deployment can withhold it (a legal hold, for instance); the people of such a role are erased by the operator. What stays out of reach, and is not promised away: the A2A agent's own store of its context, the model provider that saw the conversation, backups until they expire and, in a build that hosts an agent in-process, the agent's journal rows for the context. A second DELETE is a 404.

Authorizations​

bearerToken

A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.

Type
HTTP (bearer)
or
dpopToken

A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".

Type
HTTP (DPoP)
or
proxyIdentity

Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.

Type
API Key (header: X-Auth-Request-Email)

Responses​

The thread, and its edits, are deleted: their log is gone, their links are 404, their files are erased or on their way

Samples​

Powered by VitePress OpenAPI