---
title: "Log out one retained Codex account"
method: POST
path: "/api/v1/agents/codex/accounts/{accountId}/logout"
tags: ["agents"]
---

# Log out one retained Codex account

`POST /api/v1/agents/codex/accounts/{accountId}/logout`

## Path parameters

- `accountId` string, required — AO Codex account identifier.

## Response `200`

OK

- CodexAccountsResponse
  - `accountRevision` integer, required
  - `accounts` CodexAccountResponse[], required
    - `accountEmail` string, nullable
    - `active` boolean, required
    - `authMethod` 'chatgpt' | 'api_key' | 'other' | 'unknown', required
    - `authentication` CodexAuthenticationResponse, required
      - `attemptedAt` string, date-time, nullable, required
      - `checkedAt` string, date-time, nullable, required
      - `freshness` 'fresh' | 'stale' | 'checking', required
      - `reason` string, required
      - `reasonCode` string, required
      - `state` 'authorized' | 'unauthorized' | 'unknown' | 'not_applicable', required
    - `capacity` CodexAccountCapacityResponse, required
      - `additionalBuckets` CodexCapacityBucketResponse[], required
        - `displayName` string, nullable
        - `primary` CodexCapacityWindowResponse
          - `resetsAt` string, date-time, nullable
          - `usedPercent` number, double, required
          - `windowDurationMinutes` integer, nullable
        - `reached` 'not_reached' | 'reached' | 'unknown', required
        - `secondary` CodexCapacityWindowResponse
          - `resetsAt` string, date-time, nullable
          - `usedPercent` number, double, required
          - `windowDurationMinutes` integer, nullable
      - `attemptedAt` string, date-time, nullable
      - `checkedAt` string, date-time, nullable
      - `freshness` 'fresh' | 'stale' | 'checking', required
      - `observedAt` string, date-time, nullable
      - `overall` CodexCapacityBucketResponse
        - `displayName` string, nullable
        - `primary` CodexCapacityWindowResponse
          - `resetsAt` string, date-time, nullable
          - `usedPercent` number, double, required
          - `windowDurationMinutes` integer, nullable
        - `reached` 'not_reached' | 'reached' | 'unknown', required
        - `secondary` CodexCapacityWindowResponse
          - `resetsAt` string, date-time, nullable
          - `usedPercent` number, double, required
          - `windowDurationMinutes` integer, nullable
      - `plan` string, nullable
      - `reason` string, required
      - `reasonCode` string, required
      - `remainingPercent` number, nullable
      - `resetCredits` CodexResetCreditsSummaryResponse
        - `availableCount` integer, required
        - `nearestExpiresAt` string, date-time, nullable
      - `resetsAt` string, date-time, nullable
      - `state` 'available' | 'near_limit' | 'exhausted' | 'unknown' | 'unsupported', required
      - `usedPercent` number, nullable
    - `createdAt` string, date-time, required
    - `id` string, required
    - `label` string, required
    - `reason` string, required
    - `reasonCode` string, required
    - `status` 'valid' | 'signed_out' | 'broken', required
    - `usageSummary` CodexAccountUsageSummaryResponse
      - `currentStreakDays` integer, nullable
      - `latestDayStartDate` string, nullable
      - `latestDayTokens` integer, nullable
      - `lifetimeTokens` integer, nullable
      - `longestRunningTurnSeconds` integer, nullable
      - `longestStreakDays` integer, nullable
      - `observedAt` string, date-time, required
      - `peakDailyTokens` integer, nullable
  - `activeAccountId` string
  - `activeLogin` CodexActiveLoginResponse
    - `accountId` string
    - `expiresAt` string, date-time, required
    - `operationId` string, required
    - `reason` string, required
    - `reasonCode` string, required
    - `shellTerminal` CodexAccountLoginTerminalResponse, required
      - `createdAt` string, date-time, required
      - `handleId` string, required
      - `title` string, required
    - `status` 'pending' | 'verifying' | 'unauthorized' | 'retryable' | 'completed' | 'cancelled' | 'failed' | 'expired', required
  - `capabilities` CodexAccountCapabilitiesResponse, required
    - `globalSwitch` CodexCapabilityObservationResponse, required
      - `reason` string, required
      - `reasonCode` string, required
      - `state` 'supported' | 'unsupported' | 'unknown', required
    - `nativeLogin` CodexCapabilityObservationResponse, required
      - `reason` string, required
      - `reasonCode` string, required
      - `state` 'supported' | 'unsupported' | 'unknown', required
    - `resetCreditConsume` CodexCapabilityObservationResponse, required
      - `reason` string, required
      - `reasonCode` string, required
      - `state` 'supported' | 'unsupported' | 'unknown', required
  - `currentSwitch` CodexAccountSwitchResponse
    - `completedAt` string, date-time, nullable
    - `createdAt` string, date-time, required
    - `credentialsCommittedAt` string, date-time, nullable
    - `failureCode` string
    - `id` string, required
    - `phase` 'requested' | 'checkpointing_source' | 'activating_target' | 'recovery_required' | 'completed' | 'failed', required
    - `sourceAccountId` string
    - `sourceKind` 'managed' | 'device' | 'none', required
    - `targetAccountId` string, required
    - `updatedAt` string, date-time, required
  - `deviceReconciliation` CodexDeviceReconciliationResponse, required
    - `activeAccountVerified` boolean, required
    - `attemptedAt` string, date-time, nullable
    - `nextRetryAt` string, date-time, nullable
    - `reasonCode` string, required
    - `retryable` boolean, required
    - `status` 'not_checked' | 'checking' | 'verified' | 'temporarily_unavailable' | 'blocked', required
    - `verifiedAt` string, date-time, nullable

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `409` — Conflict
- `503` — Service Unavailable

## Changes

- **2026-09-15** `7f5cb1f3ca16` — 3 breaking, 2 warning, 8 info
  - the response property `currentSwitch/sourceAccountId` became optional for the status `200`
  - removed the required property `currentSwitch/canRecover` from the response with the `200` status
  - removed the required property `currentSwitch/sessions` from the response with the `200` status
  - removed the optional property `unmanagedGlobalAccount` from the response with the `200` status
  - …9 more
- **2026-09-03** `d31a2d019c47` — 4 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 `404` 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/accounts/:accountId/logout/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/1e9e4bbb67f1?raw)
