Registra uma única mudança de conversa para a memória de longo prazo. O escopo do projeto é realizado pelo parâmetro route id path e a organização é derivada desse projeto. O chamador fornece user_id (obrigatório) e um Agent_id opcional para identificar o usuário final.
Respostas
-
Versão de API não permitida ou malformada, uma operação indisponível no contrato publicado selecionado ou uma representação inaceitável (incluindo parâmetros de tipo de mídia não suportados ou SSE excluído). Falhas existentes de autenticação, autorização e limite de taxa têm precedência.
-
Ligar já gravada (replay idempotente de uma idempotency_key fornecida anteriormente)
-
Virar gravado
-
Corpo de solicitação inválido
-
Credenciais ausentes ou inválidas
-
O chamador não tem permissão de gerenciamento de implementação no projeto
-
Erro interno
-
Serviço de memória inacessível
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/projects/{id}/memory/turns' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"agent_id": "string",
"content": "string",
"idempotency_key": "string",
"is_error": true,
"metadata": {},
"model_name": "string",
"role": "string",
"session_id": "string",
"tool_call_id": "string",
"tool_calls": [
{}
],
"tool_name": "string",
"user_id": "string"
}'
{
"agent_id": "string",
"content": "string",
"idempotency_key": "string",
"is_error": true,
"metadata": {},
"model_name": "string",
"role": "string",
"session_id": "string",
"tool_call_id": "string",
"tool_calls": [
{}
],
"tool_name": "string",
"user_id": "string"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
"error": 406,
"errorCode": "UNACCEPTABLE_MEDIA_TYPE",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
"error": 406,
"errorCode": "UNSUPPORTED_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{}
{}
{}
{}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}
{
"code": "string",
"error": "string",
"success": true
}