Generations
Update generation metadata
Attaches caller-supplied key/value metadata to a generation record for per-run audit attribution (e.g. the ticket or case an AI action belongs to). The provided keys are shallow-merged over the existing metadata, so repeated patches accumulate. The bag is caller-owned and no key is reserved: server-owned state (usage attribution, the served agent version, the route's record, the extraction summary, what knowledge retrieval served) lives in its own top-level fields and cannot be written from here.
patch/v1/projects/{project_id}/generations/{generation_id}
Request
- Base URL: https://api.naturali.ai
- URL: https://api.naturali.ai/v1/projects/{project_id}/generations/{generation_id}
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://api.naturali.ai/authorize, token URL https://api.naturali.ai/token, scopes: mcp:access)
Path parameters
generation_idstring required
Public ID of the generation
Request body
Example request
{
"metadata": {
"author": "John",
"revision": 2
}
}Response
Updated generation
Example response
{
"id": "gen_V1StGXR8Z5jdHi6B",
"started_by_principal_type": "user",
"started_by_principal_id": "user_V1StGXR8Z5jdHi6B",
"status": "failed",
"stop_reason": "error",
"error": {
"code": "AI_PROVIDER_ERROR",
"message": "Provider returned 402: insufficient credits"
},
"tool_surface": {
"tools": 61,
"bytes": 152161,
"estimated_tokens": 45148
},
"retrieval": [
{
"source_type": "document",
"document_id": "doc_V1StGXR8Z5jdHi6B",
"document_version": 3,
"chunk_id": "dchunk_V1StGXR8Z5jdHi6B",
"page": 2,
"similarity_score": 0.82
}
],
"idempotency_key": "discord-1287654321098765432",
"metadata": {
"author": "John",
"revision": 2
},
"content_redacted_by_principal_type": "user",
"content_redacted_by_principal_id": "user_V1StGXR8Z5jdHi6B"
}Changes
No recorded changes to this operation across all 1 revision of this API.