Skip to content
Primary navigation

Update organization data retention

client.admin.organization.dataRetention.update(DataRetentionUpdateParams { retention_type } body, RequestOptionsoptions?): OrganizationDataRetention { object, type }
POST/organization/data_retention

Updates organization data retention controls.

ParametersExpand Collapse
body: DataRetentionUpdateParams { retention_type }
retention_type: "zero_data_retention" | "modified_abuse_monitoring" | "enhanced_zero_data_retention" | "enhanced_modified_abuse_monitoring"

The desired organization data retention type.

One of the following:
"zero_data_retention"
"modified_abuse_monitoring"
"enhanced_zero_data_retention"
"enhanced_modified_abuse_monitoring"
ReturnsExpand Collapse
OrganizationDataRetention { object, type }

Represents the organization’s data retention control setting.

object: "organization.data_retention"

The object type, which is always organization.data_retention.

type: "zero_data_retention" | "modified_abuse_monitoring" | "enhanced_zero_data_retention" | "enhanced_modified_abuse_monitoring"

The configured organization data retention type.

One of the following:
"zero_data_retention"
"modified_abuse_monitoring"
"enhanced_zero_data_retention"
"enhanced_modified_abuse_monitoring"

Update organization data retention

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const organizationDataRetention = await client.admin.organization.dataRetention.update({
  retention_type: 'zero_data_retention',
});

console.log(organizationDataRetention.object);
{
    "object": "organization.data_retention",
    "type": "modified_abuse_monitoring"
}
Returns Examples
{
    "object": "organization.data_retention",
    "type": "modified_abuse_monitoring"
}