---
title: "Update an OpenAI Codex integration account"
method: PATCH
path: "/api/v2/integration-interfaces/openai-codex/accounts/{account_id}"
tags: ["OpenAI Codex Integration"]
---

# Update an OpenAI Codex integration account

`PATCH /api/v2/integration-interfaces/openai-codex/accounts/{account_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`

Update an OpenAI Codex integration account. Only the fields provided are changed.

## Path parameters

- `account_id` string, required

## Request body

- OpenAICodexIntegrationAccountUpdateRequest: Request payload to update an OpenAI Codex integration account.
  - `data` OpenAICodexIntegrationAccountUpdateData, required: Data envelope for updating an OpenAI Codex integration account.
    - `attributes` OpenAICodexIntegrationAccountUpdateAttributes, required: Writable attributes used to update an OpenAI Codex integration account. Every field is optional. Only the provided fields are changed. When `dataflows` is provided, only the dataflow IDs in the request are modified. Dataflows omitted from the map keep their current configuration.
      - `authentication` OpenAICodexIntegrationAccountAuthenticationUpdate: Bearer token authentication. Use a workspace-scoped OpenAI Admin key with the `codex.enterprise.analytics.read` scope. Only the provided fields are changed. To keep the stored token, omit `token`.
        - `auth_type` 'bearer_token', required: The authentication method type.
        - `token` string: Secret token used to authenticate with OpenAI Codex.
      - `dataflows` OpenAICodexIntegrationDataflowsRequest: Data Datadog collects from OpenAI Codex, keyed by dataflow ID. Datadog always collects daily Codex analytics metrics. Each dataflow in this object adds another type of collection. Set `enabled` to start or stop a dataflow. The default for each dataflow applies when the account is created. On update, omitted fields keep their current values. Every dataflow requires an OpenAI enterprise subscription with Codex enabled. If you enable a dataflow without this subscription, Datadog stores the setting but collects no data.
        - `openai-codex-dora` OpenAICodexDoraIntegrationDataflowRequest: A daily per-engineer engagement signal that [AI Impact](https://docs.datadoghq.com/delivery_performance/ai_impact/) uses to attribute AI-assisted pull requests.
          - `enabled` boolean: Whether Datadog collects this data. Defaults to `true`. Set to `false` to stop collection.
        - `openai-codex-turn-metrics` OpenAICodexTurnMetricsIntegrationDataflowRequest: Hourly turn-level metrics from the OpenAI Compliance Logs Platform, including turn and session identity, Work Insights classification, token usage, credits, estimated cost, duration, and activity for skills, plugins, and artifacts. Turn cost is a provider estimate and can differ from invoiced charges. Requires the `chatgpt.enterprise.compliance_logs_platform.workspace_analytics.read` scope on the key in `authentication`. Without this scope, the dataflow collects no data.
          - `enabled` boolean: Whether Datadog collects this data. Defaults to `false`. Set to `true` to start collection.
      - `name` string: Human-readable name of the OpenAI Codex integration account.
      - `settings` OpenAICodexIntegrationAccountSettingsUpdate: Settings for updating the OpenAI Codex integration account. Only the fields provided are changed.
        - `codex_workspace_id` string: ID of the Codex workspace to collect data from.
    - `id` string, required: Unique identifier of the OpenAI Codex integration account to update.
    - `type` 'integration-account', required: The type of the integration account resource. Always `integration-account`.

## Response `200`

OK

- OpenAICodexIntegrationAccountResponse: Response payload for a single OpenAI Codex integration account.
  - `data` OpenAICodexIntegrationAccountResponseData, required: Data envelope of an OpenAI Codex integration account, including server-assigned identity.
    - `attributes` OpenAICodexIntegrationAccountResponseAttributes, required: Attributes of an OpenAI Codex integration account returned in responses.
      - `authentication` OpenAICodexIntegrationAccountAuthenticationResponse: The bearer token authentication method configured on the account.
        - `auth_type` 'bearer_token', required: The authentication method type.
      - `dataflows` OpenAICodexIntegrationDataflowsResponse: Data Datadog collects from OpenAI Codex, keyed by dataflow ID.
        - `openai-codex-dora` OpenAICodexDoraIntegrationDataflowResponse: A daily per-engineer engagement signal that [AI Impact](https://docs.datadoghq.com/delivery_performance/ai_impact/) uses to attribute AI-assisted pull requests.
          - `enabled` boolean: Whether Datadog collects this data.
          - `status` IntegrationAccountDataflowStatus: Read-only collection status of a dataflow.
            - `health` 'DATAFLOW_HEALTH_OK' | 'DATAFLOW_HEALTH_BROKEN' | 'DATAFLOW_HEALTH_UNKNOWN': Collection health of a single dataflow.
            - `message` string: Human-readable detail, populated when the dataflow is not healthy.
            - `updated_at` string, date-time: Time the status was last computed.
        - `openai-codex-metrics` OpenAICodexMetricsIntegrationDataflowResponse: Daily Codex analytics metrics under the `openai.codex.*` namespace: usage totals, token counts by model, thread and turn counts by client, lines of code attributable to Codex, and code reviews. This dataflow is always on and cannot be turned off, so it appears only in responses.
          - `enabled` boolean: Whether Datadog collects this data. Always `true`, because this collection cannot be turned off.
          - `status` IntegrationAccountDataflowStatus: Read-only collection status of a dataflow.
            - `health` 'DATAFLOW_HEALTH_OK' | 'DATAFLOW_HEALTH_BROKEN' | 'DATAFLOW_HEALTH_UNKNOWN': Collection health of a single dataflow.
            - `message` string: Human-readable detail, populated when the dataflow is not healthy.
            - `updated_at` string, date-time: Time the status was last computed.
        - `openai-codex-turn-metrics` OpenAICodexTurnMetricsIntegrationDataflowResponse: Hourly turn-level metrics from the OpenAI Compliance Logs Platform, including turn and session identity, Work Insights classification, token usage, credits, estimated cost, duration, and activity for skills, plugins, and artifacts. Turn cost is a provider estimate and can differ from invoiced charges. Requires the `chatgpt.enterprise.compliance_logs_platform.workspace_analytics.read` scope on the key in `authentication`. Without this scope, the dataflow collects no data.
          - `enabled` boolean: Whether Datadog collects this data.
          - `status` IntegrationAccountDataflowStatus: Read-only collection status of a dataflow.
            - `health` 'DATAFLOW_HEALTH_OK' | 'DATAFLOW_HEALTH_BROKEN' | 'DATAFLOW_HEALTH_UNKNOWN': Collection health of a single dataflow.
            - `message` string: Human-readable detail, populated when the dataflow is not healthy.
            - `updated_at` string, date-time: Time the status was last computed.
      - `name` string, required: Human-readable name of the OpenAI Codex integration account.
      - `settings` OpenAICodexIntegrationAccountSettingsResponse, required: Settings configured on the OpenAI Codex integration account.
        - `codex_workspace_id` string, required: ID of the Codex workspace to collect data from.
    - `id` string, required: Server-generated unique identifier of the OpenAI Codex integration account.
    - `type` 'integration-account', required: The type of the integration account resource. Always `integration-account`.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `422`: The server cannot process the request because it contains invalid data.
- `429`: Too many requests

## Changes

- **2026-11-20** `3b1c63e31740`: 4 warning
  - the optional response header `X-RateLimit-Limit` removed for the status `429`
  - the optional response header `X-RateLimit-Period` removed for the status `429`
  - the optional response header `X-RateLimit-Remaining` removed for the status `429`
  - the optional response header `X-RateLimit-Reset` removed for the status `429`
- **2026-11-19** `79e94dd00e64`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/changes/api/v2/integration-interfaces/openai-codex/accounts/:account_id/patch.md)

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/4ba32926196d?raw)
