> ## 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 metadata for an agent's saved prompt versions, newest first.
Returns metadata for every saved prompt version for one agent, ordered by `createdAt` descending. The response does not include prompt section arrays.
<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. Pass a returned `id` to [Get prompt version](/en/api-reference/get-prompt-version) to fetch that version's full merged prompt object.
</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 prompt-version metadata objects, newest first.
<ResponseField name="[].id" type="string">
Prompt version ID. Pass this value as `promptId` to [Get prompt version](/en/api-reference/get-prompt-version).
</ResponseField>
<ResponseField name="[].botId" type="string">
Agent ID the saved version belongs to.
</ResponseField>
<ResponseField name="[].createdAt" type="string">
ISO 8601 timestamp for when the prompt version was created.
</ResponseField>
<ResponseField name="[].createdBy" type="string">
Creator identifier recorded for the saved version.
</ResponseField>
<RequestExample>
~~~bash cURL theme={null}
curl --request GET \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/history/public' \
--header 'Authorization: Bearer fini_your_api_key'
~~~
~~~javascript Node.js theme={null}
const response = await fetch('https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/history/public', {
method: 'GET',
headers: {
Authorization: 'Bearer fini_your_api_key'
}
});
const data = await response.json();
~~~
~~~python Python theme={null}
import requests
response = requests.get(
"https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/history/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
data = response.json()
~~~
</RequestExample>
<ResponseExample>
~~~json 200 OK theme={null}
[
{
"id": "a8b2a418-6f33-4f40-9d1e-4b581fd34d5e",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"createdAt": "2026-07-21T06:12:31.456Z",
"createdBy": "3d2abf0c-d80f-42cf-96e9-a2e26f18f0e8"
}
]
~~~
</ResponseExample>
## 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>
## Related topics
- [Get prompt version](/en/api-reference/get-prompt-version.md)
- [Overview](/en/api-reference/prompts.md)
- [Get article history version](/en/api-reference/get-article-history-version.md)
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
Prompts

