> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefini.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get prompt history

> List saved prompt versions for one agent, newest first.

Returns every saved prompt version for one agent, ordered by `createdAt` descending.

<Note>
  This history is agent-specific. It does not synthesize the workspace template as a history entry, so agents with no saved prompt versions return an empty array rather than a template row.
</Note>

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `read` scope.
</ParamField>

## Path parameters

<ParamField path="id" type="string" required>
  Agent ID whose prompt history you want to read. Use [List agents](/en/api-reference/list-agents) to get the `botId`.
</ParamField>

## Response

Returns a top-level array of merged [`Prompt`](/en/api-reference/prompts#prompt-object) objects, newest first.

## Errors

<AccordionGroup>
  <Accordion title="401 Unauthorized" icon="lock">
    The API key is missing, malformed, revoked, or invalid.
  </Accordion>

  <Accordion title="403 Forbidden" icon="shield-halved">
    The API key does not include the `read` scope required for this route.
  </Accordion>

  <Accordion title="404 Not Found" icon="ghost">
    The agent ID does not exist.
  </Accordion>

  <Accordion title="406 Not Acceptable" icon="circle-question">
    Current controller behavior: if the agent belongs to a different workspace, this route returns `406` with an invalid-agent message rather than `403`.
  </Accordion>

  <Accordion title="500 Internal Server Error" icon="triangle-exclamation">
    Fini failed while loading prompt history from storage.
  </Accordion>
</AccordionGroup>
