end_session
Signal that this agent session is complete. Flips the underlying AiConversation agentStatus to ENDED so the human-side Settings → Agents UI shows the session as terminated. Optional reason string (1-500 chars) is captured for audit. Idempotent: calling again returns the existing terminal status without changing it. Honest agents call this when they've finished their assigned work or are about to disconnect; humans can also revoke the PAT, which is more forceful but achieves the same lifecycle outcome. Any task leases this session still holds are handed back, so the tasks become available to other agents immediately rather than after the lease expires.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Optional short rationale for ending. 1-500 chars. |