# Record a conversation turn **POST /api/v1/projects/{id}/memory/turns** Records a single conversation turn to long-term memory. The project scope is carried by the route id path parameter and the org is derived from that project. The caller supplies user_id (required) and an optional agent_id to identify the end user. ## Servers - https://agentengine.mongodb.com: https://agentengine.mongodb.com () ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **id** (string) Project ID ### Body: application/json (object) Turn to record - **agent_id** (string) - **content** (string) - **idempotency_key** (string) - **is_error** (boolean) - **metadata** (object) - **model_name** (string) - **role** (string) - **session_id** (string) - **tool_call_id** (string) - **tool_calls** (array[object]) - **tool_name** (string) - **user_id** (string) ## Responses ### 406 Unsupported or malformed API version, an operation unavailable in the selected published contract, or an unacceptable representation (including unsupported media-type parameters or excluded SSE). Existing authentication, authorization, and rate-limit failures take precedence. #### Body: application/json (object) - **badRequestDetail** (object) Optional validation details defined by the standard error schema; API negotiation errors do not emit this field. - **detail** (string) Human-readable error details. - **error** (integer) HTTP status code. - **errorCode** (string) Machine-readable error code. - **parameters** (array[string]) Request parameter names associated with the error; omitted when none apply. - **reason** (string) HTTP status reason phrase. ### 200 Turn already recorded (idempotent replay of a previously-supplied idempotency_key) #### Body: application/json (object) object ### 201 Turn recorded #### Body: application/json (object) object ### 400 Invalid request body #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 401 Missing or invalid credentials #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 403 Caller lacks deployment-management permission on the project #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 500 Internal error #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) ### 502 Memory service unreachable #### Body: application/json (object) - **code** (string) - **error** (string) - **success** (boolean) [Powered by Bump.sh](https://bump.sh)