Zu Hauptinhalt wechseln

Dieser Browser wird nicht mehr unterstützt.

Führen Sie ein Upgrade auf Microsoft Edge durch, um die neuesten Features, Sicherheitsupdates und den technischen Support zu nutzen.

Microsoft Edge herunterladen Weitere Informationen zu Internet Explorer und Microsoft Edge
microsoft-foundry.rest.security.o-auth2-auth

Conversations

Update a conversation

POST /openai/v1/conversations/{conversation_id}

Modifies the specified conversation's properties.

Pfadparameter

conversation_id string Erforderlich

The id of the conversation to update.

Headerparameter

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.

Anforderungstext

Content-Type: application/json
metadata OpenAI.Metadata | null Erforderlich

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

[key: string] string

Antworten

The request has succeeded.

Text

Content-Type: application/json
id string Erforderlich

The unique ID of the conversation.

object enum Erforderlich

The object type, which is always conversation.

conversation
metadata OpenAI.Metadata Erforderlich

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

[key: string] string
created_at integer Erforderlich

The time at which the conversation was created, measured in seconds since the Unix epoch.

Client error

Text

Content-Type: application/json
error OpenAI.Error Erforderlich
code string | null Erforderlich
message string Erforderlich
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Eines der folgenden Elemente:
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 Erforderlich

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Server error

Text

Content-Type: application/json
error OpenAI.Error Erforderlich
code string | null Erforderlich
message string Erforderlich
param string | null
type string
misalignment OpenAI.MisalignmentErrorDetailsResource
review_target string | null
error_type string | enum
Eines der folgenden Elemente:
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 Erforderlich

The public continuation instruction.

details OpenAI.Error[]
additionalInfo object
debugInfo object

Anfordern

curl https://api.openai.com/v1/conversations/conv_123 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "metadata": {"topic": "project-x"}
  }'
import OpenAI from "openai";
const client = new OpenAI();

const updated = await client.conversations.update(
  "conv_123",
  { metadata: { topic: "project-x" } }
);
console.log(updated);
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 = client.conversations.update(
    conversation_id="conv_123",
    metadata={
        "foo": "string"
    },
)
print(conversation.id)
using System;
using System.Collections.Generic;
using OpenAI.Conversations;

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

Conversation updated = client.UpdateConversation(
    conversationId: "conv_123",
    new UpdateConversationOptions
    {
        Metadata = new Dictionary<string, string>
        {
            { "topic", "project-x" }
        }
    }
);
Console.WriteLine(updated.Id);
import OpenAI from 'openai';

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

const conversation = await client.conversations.update('conv_123', { metadata: { foo: 'string' } });

console.log(conversation.id);
package main

import (
    "context"
    "fmt"

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

func main() {
    client := openai.NewClient(
        option.WithAPIKey("My API Key"),
    )
    conversation, err := client.Conversations.Update(
        context.TODO(),
        "conv_123",
        conversations.ConversationUpdateParams{
            Metadata: shared.Metadata{
                "foo": "string",
            },
        },
    )
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v
", conversation.ID)
}
package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.core.JsonValue;
import com.openai.models.conversations.Conversation;
import com.openai.models.conversations.ConversationUpdateParams;

public final class Main {
    private Main() {}

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

        ConversationUpdateParams params = ConversationUpdateParams.builder()
            .conversationId("conv_123")
            .metadata(ConversationUpdateParams.Metadata.builder()
                .putAdditionalProperty("foo", JsonValue.from("string"))
                .build())
            .build();
        Conversation conversation = client.conversations().update(params);
    }
}
require "openai"

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

conversation = openai.conversations.update("conv_123", metadata: {foo: "string"})

puts(conversation)

Antwort

{
  "id": "conv_123",
  "object": "conversation",
  "created_at": 1741900000,
  "metadata": {"topic": "project-x"}
}
de-de
Ihre Datenschutzoptionen
  • KI-Haftungsausschluss
  • Frühere Versionen
  • Blog
  • Mitwirken
  • Datenschutz
  • Consumer Health Privacy
  • Nutzungsbedingungen
  • Impressum
  • Marken
  • © Microsoft 2026