OpenAI Data retention API

The Data retention API from OpenAI — 2 operation(s) for data retention.

Operations 4

GET /organization/data_retention Retrieve organization data retention #
POST /organization/data_retention Update organization data retention #
GET /organization/projects/{project_id}/data_retention Retrieve project data retention #
POST /organization/projects/{project_id}/data_retention Update project data retention #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openai:openai-data-retention-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openai-data-retention-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Openai Data retention API
  version: 2.3.0
  contact:
    name: OpenAI Support
    url: https://help.openai.com/
  license:
    name: MIT
    identifier: MIT
  termsOfService: https://openai.com/policies/terms-of-use
  description: 'Operations tagged Data retention across 2 of this provider''s published API definitions: openai-openapi-master-2026-09-23.yml, openai-openapi-master-2026-10-12.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.openai.com/v1
security:
- ApiKeyAuth: []
tags:
- name: Data retention
paths:
  /organization/data_retention:
    get:
      security:
      - AdminApiKeyAuth: []
      summary: Retrieve organization data retention
      description: Retrieves organization data retention controls.
      operationId: retrieve-organization-data-retention
      tags:
      - Data retention
      responses:
        '200':
          description: Organization data retention controls retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDataRetention'
      x-oaiMeta:
        group: administration
        examples:
          request:
            curl: "curl https://api.openai.com/v1/organization/data_retention \\\n  -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n  -H \"Content-Type: application/json\"\n"
          response: "{\n    \"object\": \"organization.data_retention\",\n    \"type\": \"modified_abuse_monitoring\"\n}\n"
    post:
      security:
      - AdminApiKeyAuth: []
      summary: Update organization data retention
      description: Updates organization data retention controls.
      operationId: update-organization-data-retention
      tags:
      - Data retention
      requestBody:
        description: The desired organization data retention setting.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganizationDataRetentionBody'
      responses:
        '200':
          description: Organization data retention controls updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganizationDataRetention'
      x-oaiMeta:
        group: administration
        examples:
          request:
            curl: "curl -X POST https://api.openai.com/v1/organization/data_retention \\\n  -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"retention_type\": \"modified_abuse_monitoring\"\n  }'\n"
          response: "{\n    \"object\": \"organization.data_retention\",\n    \"type\": \"modified_abuse_monitoring\"\n}\n"
    servers:
    - url: https://api.openai.com/v1
  /organization/projects/{project_id}/data_retention:
    get:
      security:
      - AdminApiKeyAuth: []
      summary: Retrieve project data retention
      description: Retrieves project data retention controls.
      operationId: retrieve-project-data-retention
      tags:
      - Data retention
      parameters:
      - name: project_id
        in: path
        description: The ID of the project to inspect.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Project data retention controls retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDataRetention'
      x-oaiMeta:
        group: administration
        examples:
          request:
            curl: "curl https://api.openai.com/v1/organization/projects/proj_abc/data_retention \\\n  -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n  -H \"Content-Type: application/json\"\n"
          response: "{\n    \"object\": \"project.data_retention\",\n    \"type\": \"organization_default\"\n}\n"
    post:
      security:
      - AdminApiKeyAuth: []
      summary: Update project data retention
      description: Updates project data retention controls.
      operationId: update-project-data-retention
      tags:
      - Data retention
      parameters:
      - name: project_id
        in: path
        description: The ID of the project to update.
        required: true
        schema:
          type: string
      requestBody:
        description: The desired project data retention setting.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectDataRetentionBody'
      responses:
        '200':
          description: Project data retention controls updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDataRetention'
      x-oaiMeta:
        group: administration
        examples:
          request:
            curl: "curl -X POST https://api.openai.com/v1/organization/projects/proj_abc/data_retention \\\n  -H \"Authorization: Bearer $OPENAI_ADMIN_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"retention_type\": \"modified_abuse_monitoring\"\n  }'\n"
          response: "{\n    \"object\": \"project.data_retention\",\n    \"type\": \"modified_abuse_monitoring\"\n}\n"
    servers:
    - url: https://api.openai.com/v1
components:
  schemas:
    UpdateProjectDataRetentionBody:
      type: object
      description: Parameters for updating project data retention controls.
      properties:
        retention_type:
          type: string
          enum:
          - organization_default
          - none
          - zero_data_retention
          - modified_abuse_monitoring
          - enhanced_zero_data_retention
          - enhanced_modified_abuse_monitoring
          description: The desired project data retention type.
      required:
      - retention_type
    ProjectDataRetention:
      type: object
      description: Represents a project's data retention control setting.
      properties:
        object:
          type: string
          enum:
          - project.data_retention
          description: The object type, which is always `project.data_retention`.
          x-stainless-const: true
        type:
          type: string
          enum:
          - organization_default
          - none
          - zero_data_retention
          - modified_abuse_monitoring
          - enhanced_zero_data_retention
          - enhanced_modified_abuse_monitoring
          description: The configured project data retention type.
      required:
      - object
      - type
      x-oaiMeta:
        name: The project data retention object
        example: "{\n    \"object\": \"project.data_retention\",\n    \"type\": \"organization_default\"\n}\n"
    OrganizationDataRetention:
      type: object
      description: Represents the organization's data retention control setting.
      properties:
        object:
          type: string
          enum:
          - organization.data_retention
          description: The object type, which is always `organization.data_retention`.
          x-stainless-const: true
        type:
          type: string
          enum:
          - zero_data_retention
          - modified_abuse_monitoring
          - enhanced_zero_data_retention
          - enhanced_modified_abuse_monitoring
          description: The configured organization data retention type.
      required:
      - object
      - type
      x-oaiMeta:
        name: The organization data retention object
        example: "{\n    \"object\": \"organization.data_retention\",\n    \"type\": \"modified_abuse_monitoring\"\n}\n"
    UpdateOrganizationDataRetentionBody:
      type: object
      description: Parameters for updating organization data retention controls.
      properties:
        retention_type:
          type: string
          enum:
          - zero_data_retention
          - modified_abuse_monitoring
          - enhanced_zero_data_retention
          - enhanced_modified_abuse_monitoring
          description: The desired organization data retention type.
      required:
      - retention_type
    Error:
      type: object
      properties:
        code:
          anyOf:
          - type: string
          - type: 'null'
        message:
          type: string
        param:
          anyOf:
          - type: string
          - type: 'null'
        type:
          type: string
        misalignment:
          $ref: '#/components/schemas/MisalignmentErrorDetailsResource'
      required:
      - type
      - message
      - param
      - code
    _MisalignmentErrorType:
      anyOf:
      - type: string
      - type: string
        enum:
        - potentially_unintended_data_transfer
        - potentially_unintended_data_access
        - potentially_unintended_destructive_activity
        - other
    _MisalignmentSteer:
      properties:
        message:
          type: string
          description: The public continuation instruction.
      type: object
      required:
      - message
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
      - error
    MisalignmentErrorDetailsResource:
      properties:
        review_target:
          anyOf:
          - not:
              pattern: '[^A-Za-z0-9._~:-]'
            type: string
            maxLength: 96
            minLength: 1
            pattern: ^[A-Za-z0-9._~:-]+$
            description: An opaque target for explicitly continuing this review, or null when unavailable.
          - type: 'null'
        error_type:
          $ref: '#/components/schemas/_MisalignmentErrorType'
          description: An optional classification; clients must accept additional values.
        detailed_explanation:
          type: string
          description: The public explanation for this block.
        steer:
          $ref: '#/components/schemas/_MisalignmentSteer'
          description: An optional public continuation instruction.
      type: object
      required: []
    PermissionErrorResponse:
      type: object
      properties:
        error:
          description: Details about the permission error.
          anyOf:
          - $ref: '#/components/schemas/Error'
          - type: string
            description: An explanation of the missing API permissions.
      required:
      - error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
    AdminApiKeyAuth:
      type: http
      scheme: bearer
x-refined-from:
- openai-openapi-master-2026-09-23.yml
- openai-openapi-master-2026-10-12.yml
x-oaiMeta:
  groups:
  - id: audio
    title: Audio
    description: 'Learn how to turn audio into text or text into audio.


      Related guide: [Speech to text](/docs/guides/speech-to-text)

      '
    sections:
    - type: endpoint
      key: createSpeech
      path: createSpeech
    - type: endpoint
      key: createTranscription
      path: createTranscription
    - type: endpoint
      key: createTranslation
      path: createTranslation
  - id: chat
    title: Chat
    description: 'Given a list of messages comprising a conversation, the model will return a response.


      Related guide: [Chat Completions](/docs/guides/text-generation)

      '
    sections:
    - type: endpoint
      key: createChatCompletion
      path: create
    - type: object
      key: CreateChatCompletionResponse
      path: object
    - type: object
      key: CreateChatCompletionStreamResponse
      path: streaming
  - id: embeddings
    title: Embeddings
    description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.


      Related guide: [Embeddings](/docs/guides/embeddings)

      '
    sections:
    - type: endpoint
      key: createEmbedding
      path: create
    - type: object
      key: Embedding
      path: object
  - id: fine-tuning
    title: Fine-tuning
    description: 'Manage fine-tuning jobs to tailor a model to your specific training data.


      Related guide: [Fine-tune models](/docs/guides/fine-tuning)

      '
    sections:
    - type: endpoint
      key: createFineTuningJob
      path: create
    - type: endpoint
      key: listPaginatedFineTuningJobs
      path: list
    - type: endpoint
      key: listFineTuningEvents
      path: list-events
    - type: endpoint
      key: retrieveFineTuningJob
      path: retrieve
    - type: endpoint
      key: cancelFineTuningJob
      path: cancel
    - type: object
      key: FineTuningJob
      path: object
    - type: object
      key: FineTuningJobEvent
      path: event-object
  - id: files
    title: Files
    description: 'Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning).

      '
    sections:
    - type: endpoint
      key: createFile
      path: create
    - type: endpoint
      key: listFiles
      path: list
    - type: endpoint
      key: retrieveFile
      path: retrieve
    - type: endpoint
      key: deleteFile
      path: delete
    - type: endpoint
      key: downloadFile
      path: retrieve-contents
    - type: object
      key: OpenAIFile
      path: object
  - id: images
    title: Images
    description: 'Given a prompt and/or an input image, the model will generate a new image.


      Related guide: [Image generation](/docs/guides/images)

      '
    sections:
    - type: endpoint
      key: createImage
      path: create
    - type: endpoint
      key: createImageEdit
      path: createEdit
    - type: endpoint
      key: createImageVariation
      path: createVariation
    - type: object
      key: Image
      path: object
  - id: models
    title: Models
    description: 'List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them.

      '
    sections:
    - type: endpoint
      key: listModels
      path: list
    - type: endpoint
      key: retrieveModel
      path: retrieve
    - type: endpoint
      key: deleteModel
      path: delete
    - type: object
      key: Model
      path: object
  - id: moderations
    title: Moderations
    description: 'Given a input text, outputs if the model classifies it as violating OpenAI''s content policy.


      Related guide: [Moderations](/docs/guides/moderation)

      '
    sections:
    - type: endpoint
      key: createModeration
      path: create
    - type: object
      key: CreateModerationResponse
      path: object
  - id: assistants
    title: Assistants
    beta: true
    description: 'Build assistants that can call models and use tools to perform tasks.


      [Get started with the Assistants API](/docs/assistants)

      '
    sections:
    - type: endpoint
      key: createAssistant
      path: createAssistant
    - type: endpoint
      key: createAssistantFile
      path: createAssistantFile
    - type: endpoint
      key: listAssistants
      path: listAssistants
    - type: endpoint
      key: listAssistantFiles
      path: listAssistantFiles
    - type: endpoint
      key: getAssistant
      path: getAssistant
    - type: endpoint
      key: getAssistantFile
      path: getAssistantFile
    - type: endpoint
      key: modifyAssistant
      path: modifyAssistant
    - type: endpoint
      key: deleteAssistant
      path: deleteAssistant
    - type: endpoint
      key: deleteAssistantFile
      path: deleteAssistantFile
    - type: object
      key: AssistantObject
      path: object
    - type: object
      key: AssistantFileObject
      path: file-object
  - id: threads
    title: Threads
    beta: true
    description: 'Create threads that assistants can interact with.


      Related guide: [Assistants](/docs/assistants/overview)

      '
    sections:
    - type: endpoint
      key: createThread
      path: createThread
    - type: endpoint
      key: getThread
      path: getThread
    - type: endpoint
      key: modifyThread
      path: modifyThread
    - type: endpoint
      key: deleteThread
      path: deleteThread
    - type: object
      key: ThreadObject
      path: object
  - id: messages
    title: Messages
    beta: true
    description: 'Create messages within threads


      Related guide: [Assistants](/docs/assistants/overview)

      '
    sections:
    - type: endpoint
      key: createMessage
      path: createMessage
    - type: endpoint
      key: listMessages
      path: listMessages
    - type: endpoint
      key: listMessageFiles
      path: listMessageFiles
    - type: endpoint
      key: getMessage
      path: getMessage
    - type: endpoint
      key: getMessageFile
      path: getMessageFile
    - type: endpoint
      key: modifyMessage
      path: modifyMessage
    - type: object
      key: MessageObject
      path: object
    - type: object
      key: MessageFileObject
      path: file-object
  - id: runs
    title: Runs
    beta: true
    description: 'Represents an execution run on a thread.


      Related guide: [Assistants](/docs/assistants/overview)

      '
    sections:
    - type: endpoint
      key: createRun
      path: createRun
    - type: endpoint
      key: createThreadAndRun
      path: createThreadAndRun
    - type: endpoint
      key: listRuns
      path: listRuns
    - type: endpoint
      key: listRunSteps
      path: listRunSteps
    - type: endpoint
      key: getRun
      path: getRun
    - type: endpoint
      key: getRunStep
      path: getRunStep
    - type: endpoint
      key: modifyRun
      path: modifyRun
    - type: endpoint
      key: submitToolOuputsToRun
      path: submitToolOutputs
    - type: endpoint
      key: cancelRun
      path: cancelRun
    - type: object
      key: RunObject
      path: object
    - type: object
      key: RunStepObject
      path: step-object
  - id: completions
    title: Completions
    legacy: true
    description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings).

      '
    sections:
    - type: endpoint
      key: createCompletion
      path: create
    - type: object
      key: CreateCompletionResponse
      path: object