# Update generation metadata

> Attaches caller-supplied key/value metadata to a generation record for per-run audit attribution (e.g. recording which knowledge-corpus version produced an AI action). 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) lives in its own top-level fields and cannot be written from here.

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Update generation metadata"}
>
</Heading>

<MethodEndpoint
  method={"patch"}
  path={"/api/v1/generations/{generation_id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Attaches caller-supplied key/value metadata to a generation record for per-run audit attribution (e.g. recording which knowledge-corpus version produced an AI action). 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) lives in its own top-level fields and cannot be written from here.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
  {...require("./update-generation.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./update-generation.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./update-generation.StatusCodes.json")}
>
  
</StatusCodes>
