Naar hoofdinhoud gaan

Deze browser wordt niet meer ondersteund.

Upgrade naar Microsoft Edge om te profiteren van de nieuwste functies, beveiligingsupdates en technische ondersteuning.

Microsoft Edge downloaden Meer informatie over Internet Explorer en Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Conversations

Delete a conversation

DELETE /openai/v1/conversations/{conversation_id}

Removes the specified conversation resource from the current project.

Padparameters

conversation_id string vereist

The id of the conversation to delete.

Koptekstparameters

x-ms-user-identity string

Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the agents/endpoints/UserIdentityImpersonation/action RBAC permission.

Antwoorden

The request has succeeded.

Hoofdtekst

Content-Type: application/json
object enum vereist
conversation.deleted
deleted boolean vereist
id string vereist

Client error

Hoofdtekst

Content-Type: application/json
error OpenAI.Error vereist
code string | null vereist
message string vereist
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Een van de volgende:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string vereist

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Hoofdtekst

Content-Type: application/json
error OpenAI.Error vereist
code string | null vereist
message string vereist
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Een van de volgende:
string
enum
potentially_unintended_data_transferpotentially_unintended_data_accesspotentially_unintended_destructive_activityother
detailed_explanation string

The public explanation for this block.

steer OpenAI._MisalignmentSteer
message string vereist

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Aanvraag

curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \
  -H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from "openai";
const client = new OpenAI();

const deleted = await client.conversations.delete("conv_123");
console.log(deleted);
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
conversation_deleted_resource = client.conversations.delete(
    "conv_123",
)
print(conversation_deleted_resource.id)
using System;
using OpenAI.Conversations;

OpenAIConversationClient client = new(
    apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
);

DeletedConversation deleted = client.DeleteConversation("conv_123");
Console.WriteLine(deleted.Id);
import OpenAI from 'openai';

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

const conversationDeletedResource = await client.conversations.delete('conv_123');

console.log(conversationDeletedResource.id);
package main

import (
    "context"
    "fmt"

    "github.com/openai/openai-go"
    "github.com/openai/openai-go/option"
)

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", conversationDeletedResource.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.conversations.ConversationDeleteParams;
import com.openai.models.conversations.ConversationDeletedResource;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        ConversationDeletedResource conversationDeletedResource = client.conversations().delete("conv_123");
    }
}
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

conversation_deleted_resource = openai.conversations.delete("conv_123")

puts(conversation_deleted_resource)

Respons

{
  "id": "conv_123",
  "object": "conversation.deleted",
  "deleted": true
}
nl-nl
Uw privacykeuzes
  • AI-disclaimer
  • Vorige versies
  • Blog
  • Bijdragen
  • Privacy
  • Privacy van gezondheidsdata
  • Gebruiksvoorwaarden
  • Handelsmerken
  • © Microsoft 2026