---
title: Update an OpenAI Codex integration account
description: Update an OpenAI Codex integration account. Only the fields provided are changed.
breadcrumbs: Docs > API > Update an OpenAI Codex integration account
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Update an OpenAI Codex integration account

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                                         |
| ----------------- | ---------------------------------------------------------------------------------------------------- |
| app.datadoghq.com | PATCH https://api.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id}     |
| us3.datadoghq.com | PATCH https://api.us3.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id} |
| us5.datadoghq.com | PATCH https://api.us5.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id} |
| app.datadoghq.eu  | PATCH https://api.datadoghq.eu/api/v2/integration-interfaces/openai-codex/accounts/{account_id}      |
| ap1.datadoghq.com | PATCH https://api.ap1.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id} |
| ap2.datadoghq.com | PATCH https://api.ap2.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id} |
| uk1.datadoghq.com | PATCH https://api.uk1.datadoghq.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id} |
| app.ddog-gov.com  | PATCH https://api.ddog-gov.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id}      |
| us2.ddog-gov.com  | PATCH https://api.us2.ddog-gov.com/api/v2/integration-interfaces/openai-codex/accounts/{account_id}  |

### Overview

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

This endpoint requires the `manage_integrations` permission.

### Arguments

#### Path Parameters

| Field                   | Type   | Description                                   |
| ----------------------- | ------ | --------------------------------------------- |
| account_id [*required*] | string | Unique identifier of the integration account. |

### Request

#### Body Data (required)

{% tabs %}
{% tab label="Model" %}
| Parent field              | Field                     | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------- | ------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                           | data [*required*]         | object  | Data envelope for updating an OpenAI Codex integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| data                      | attributes [*required*]   | object  | 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.                                                                                                                                                                                                                                                  |
| attributes                | authentication            | <oneOf> | Authentication for updating the OpenAI Codex integration account. Exactly one method is set.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| authentication            | <auth_type=bearer_token>  | object  | 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>  | auth_type [*required*]    | enum    | The authentication method type. Allowed enum values: `bearer_token`. Default: `bearer_token`.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <auth_type=bearer_token>  | token                     | string  | Secret token used to authenticate with OpenAI Codex.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                | dataflows                 | object  | 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. |
| dataflows                 | openai-codex-dora         | object  | A daily per-engineer engagement signal that [AI Impact](https://docs.datadoghq.com/delivery_performance/ai_impact.md) uses to attribute AI-assisted pull requests.                                                                                                                                                                                                                                                                                                                                                                        |
| openai-codex-dora         | enabled                   | boolean | Whether Datadog collects this data. Defaults to `true`. Set to `false` to stop collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| dataflows                 | openai-codex-turn-metrics | object  | 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.                                               |
| openai-codex-turn-metrics | enabled                   | boolean | Whether Datadog collects this data. Defaults to `false`. Set to `true` to start collection.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| attributes                | name                      | string  | Human-readable name of the OpenAI Codex integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| attributes                | settings                  | object  | Settings for updating the OpenAI Codex integration account. Only the fields provided are changed.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| settings                  | codex_workspace_id        | string  | ID of the Codex workspace to collect data from.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| data                      | id [*required*]           | string  | Unique identifier of the OpenAI Codex integration account to update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| data                      | type [*required*]         | enum    | The type of the integration account resource. Always `integration-account`. Allowed enum values: `integration-account`. Default: `integration-account`.                                                                                                                                                                                                                                                                                                                                                                                   |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token",
        "token": "your-token"
      },
      "dataflows": {
        "openai-codex-dora": {
          "enabled": true
        },
        "openai-codex-turn-metrics": {
          "enabled": true
        }
      },
      "name": "openai-codex-acme",
      "settings": {
        "codex_workspace_id": "your-workspace-id"
      }
    },
    "id": "7d2f9c4e-3a1b-4c8e-9f6d-2b5a8e1c0d47",
    "type": "integration-account"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Response payload for a single OpenAI Codex integration account.

| Parent field              | Field                           | Type      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                           | data [*required*]               | object    | Data envelope of an OpenAI Codex integration account, including server-assigned identity.                                                                                                                                                                                                                                                                                                                                                                                                   |
| data                      | attributes [*required*]         | object    | Attributes of an OpenAI Codex integration account returned in responses.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| attributes                | authentication                  | <oneOf>   | Authentication configured on the OpenAI Codex integration account.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| authentication            | <auth_type=bearer_token>        | object    | The bearer token authentication method configured on the account.                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <auth_type=bearer_token>  | auth_type [*required*]          | enum      | The authentication method type. Allowed enum values: `bearer_token`. Default: `bearer_token`.                                                                                                                                                                                                                                                                                                                                                                                               |
| attributes                | dataflows                       | object    | Data Datadog collects from OpenAI Codex, keyed by dataflow ID.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| dataflows                 | openai-codex-dora               | object    | A daily per-engineer engagement signal that [AI Impact](https://docs.datadoghq.com/delivery_performance/ai_impact.md) uses to attribute AI-assisted pull requests.                                                                                                                                                                                                                                                                                                                          |
| openai-codex-dora         | enabled                         | boolean   | Whether Datadog collects this data.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| openai-codex-dora         | status                          | object    | Read-only collection status of a dataflow. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| status                    | health                          | enum      | Collection health of a single dataflow. Allowed enum values: `DATAFLOW_HEALTH_OK`, `DATAFLOW_HEALTH_BROKEN`, `DATAFLOW_HEALTH_UNKNOWN`.                                                                                                                                                                                                                                                                                                                                                     |
| status                    | message                         | string    | Human-readable detail, populated when the dataflow is not healthy.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status                    | updated_at                      | date-time | Time the status was last computed.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| dataflows                 | openai-codex-metrics            | object    | 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.                                                                                                                                                                                                     |
| openai-codex-metrics      | enabled                         | boolean   | Whether Datadog collects this data. Always `true`, because this collection cannot be turned off. Read-only.                                                                                                                                                                                                                                                                                                                                                                                 |
| openai-codex-metrics      | status                          | object    | Read-only collection status of a dataflow. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| status                    | health                          | enum      | Collection health of a single dataflow. Allowed enum values: `DATAFLOW_HEALTH_OK`, `DATAFLOW_HEALTH_BROKEN`, `DATAFLOW_HEALTH_UNKNOWN`.                                                                                                                                                                                                                                                                                                                                                     |
| status                    | message                         | string    | Human-readable detail, populated when the dataflow is not healthy.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status                    | updated_at                      | date-time | Time the status was last computed.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| dataflows                 | openai-codex-turn-metrics       | object    | 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. |
| openai-codex-turn-metrics | enabled                         | boolean   | Whether Datadog collects this data.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| openai-codex-turn-metrics | status                          | object    | Read-only collection status of a dataflow. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| status                    | health                          | enum      | Collection health of a single dataflow. Allowed enum values: `DATAFLOW_HEALTH_OK`, `DATAFLOW_HEALTH_BROKEN`, `DATAFLOW_HEALTH_UNKNOWN`.                                                                                                                                                                                                                                                                                                                                                     |
| status                    | message                         | string    | Human-readable detail, populated when the dataflow is not healthy.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| status                    | updated_at                      | date-time | Time the status was last computed.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| attributes                | name [*required*]               | string    | Human-readable name of the OpenAI Codex integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                | settings [*required*]           | object    | Settings configured on the OpenAI Codex integration account.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| settings                  | codex_workspace_id [*required*] | string    | ID of the Codex workspace to collect data from.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| data                      | id [*required*]                 | string    | Server-generated unique identifier of the OpenAI Codex integration account. Read-only.                                                                                                                                                                                                                                                                                                                                                                                                      |
| data                      | type [*required*]               | enum      | The type of the integration account resource. Always `integration-account`. Allowed enum values: `integration-account`. Default: `integration-account`.                                                                                                                                                                                                                                                                                                                                     |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token"
      },
      "dataflows": {
        "openai-codex-dora": {
          "enabled": true,
          "status": {
            "health": "DATAFLOW_HEALTH_OK",
            "message": "",
            "updated_at": "2026-06-25T08:30:50Z"
          }
        },
        "openai-codex-metrics": {
          "enabled": true,
          "status": {
            "health": "DATAFLOW_HEALTH_OK",
            "message": "",
            "updated_at": "2026-06-25T08:30:50Z"
          }
        },
        "openai-codex-turn-metrics": {
          "enabled": true,
          "status": {
            "health": "DATAFLOW_HEALTH_OK",
            "message": "",
            "updated_at": "2026-06-25T08:30:50Z"
          }
        }
      },
      "name": "openai-codex-acme",
      "settings": {
        "codex_workspace_id": "your-workspace-id"
      }
    },
    "id": "7d2f9c4e-3a1b-4c8e-9f6d-2b5a8e1c0d47",
    "type": "integration-account"
  }
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="404" %}
Not Found

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="422" %}
The server cannot process the request because it contains invalid data.

{% tabs %}
{% tab label="Model" %}
API error response.

| Parent field | Field               | Type     | Description                                                                     |
| ------------ | ------------------- | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | code                | string   | An application-specific error code.                                             |
| errors       | detail              | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                | object   | Non-standard meta-information about the error                                   |
| errors       | source              | object   | References to the source of the error.                                          |
| source       | header              | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter           | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer             | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status              | string   | Status code of the response.                                                    |
| errors       | title               | string   | Short human-readable summary of the error.                                      |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    {
      "code": "invalid_request",
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Path parameters
export account_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/integration-interfaces/openai-codex/accounts/${account_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "bearer_token",
        "token": "your-token"
      },
      "dataflows": {
        "openai-codex-dora": {
          "enabled": true
        },
        "openai-codex-turn-metrics": {
          "enabled": true
        }
      },
      "name": "openai-codex-acme",
      "settings": {
        "codex_workspace_id": "your-workspace-id"
      }
    },
    "id": "7d2f9c4e-3a1b-4c8e-9f6d-2b5a8e1c0d47",
    "type": "integration-account"
  }
}
EOF
```
{% /tab %}
{% /tabs %}
