---
title: "Start a global AO Codex account switch"
method: POST
path: "/api/v1/agents/codex/account-switches"
tags: ["agents"]
---

# Start a global AO Codex account switch

`POST /api/v1/agents/codex/account-switches`

## Request body

- StartCodexAccountSwitchRequest
  - `expectedAccountRevision` integer, required
  - `idempotencyKey` string, required
  - `targetAccountId` string, required

## Response `202`

Accepted

- CodexAccountSwitchResponse
  - `canRecover` boolean, required
  - `completedAt` string, date-time, nullable
  - `createdAt` string, date-time, required
  - `credentialsCommittedAt` string, date-time, nullable
  - `failureCode` string
  - `id` string, required
  - `phase` 'requested' | 'stopping_sessions' | 'sessions_stopped' | 'checkpointing_source' | 'activating_target' | 'verifying_target' | 'restarting_sessions' | 'rollback_required' | 'recovery_required' | 'completed' | 'failed', required
  - `sessions` CodexAccountSwitchSessionResponse[], required
    - `errorCode` string
    - `interfaceMode` 'tui' | 'chat', required
    - `restartState` string, required
    - `restartedAt` string, date-time, nullable
    - `sessionId` string, required
    - `stopState` string, required
    - `stoppedAt` string, date-time, nullable
    - `wasRunning` boolean, required
  - `sourceAccountId` string, required
  - `targetAccountId` string, required
  - `updatedAt` string, date-time, required

## Other responses

- `400` — Bad Request
- `409` — Conflict
- `503` — Service Unavailable

## Changes

- **2026-09-03** `d31a2d019c47` — 3 info
  - added the optional property `reporting_owner` to the response with the `400` status
  - added the optional property `reporting_owner` to the response with the `409` status
  - added the optional property `reporting_owner` to the response with the `503` status
- **2026-09-03** `0989da474d24` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/changes/api/v1/agents/codex/account-switches/post.md)

---

[API](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon.md) · [All operations](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/llms.txt) · [OpenAPI document](https://skmtc.dev/composiohq/apis/agent-orchestrator-http-daemon/revisions/460522f9c5fd?raw)
