> ## 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 draft version
> Fetch one exact stored prompt draft version for review.
Returns one stored prompt lifecycle version for an agent. Use this route to
review the complete prompt arrays and metadata for a draft before publishing
it.
Unlike [Get prompts](/en/api-reference/get-prompts), this route does not merge
the current prompt with the workspace template. It returns the exact stored
version identified by `versionId`.
## 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 that owns the prompt version.
</ParamField>
<ParamField path="versionId" type="string" required>
Prompt lifecycle version ID returned by
[Create prompt draft version](/en/api-reference/create-prompt-draft-version).
</ParamField>
## Response
<ResponseField name="id" type="string">
Prompt lifecycle version ID.
</ResponseField>
<ResponseField name="promptId" type="string">
Prompt record ID this lifecycle version is based on.
</ResponseField>
<ResponseField name="botId" type="string">
Agent ID that owns the version.
</ResponseField>
<ResponseField name="versionNumber" type="number">
Agent-specific lifecycle version number.
</ResponseField>
<ResponseField name="status" type="DRAFT | PUBLISHED | ARCHIVED">
Current lifecycle status.
</ResponseField>
<ResponseField name="parentVersionId" type="string | null">
Published lifecycle version this draft was created from.
</ResponseField>
<ResponseField name="publishedAt" type="datetime | null">
Publication timestamp. Draft versions return `null`.
</ResponseField>
<ResponseField name="hcPlanningPrompt" type="PromptSection[]">
Exact Planning Prompt sections stored on the version.
</ResponseField>
<ResponseField name="hcGuidelinePrompt" type="PromptSection[]">
Exact Main Guidelines sections stored on the version.
</ResponseField>
<ResponseField name="hcChannelPrompt" type="PromptSection[]">
Exact Channel Prompt sections stored on the 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/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/public' \
--header 'Authorization: Bearer fini_your_api_key'
~~~
~~~python Python theme={null}
import requests
agent_id = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3"
version_id = "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e"
response = requests.get(
f"https://api-prod.usefini.com/v2/bots/{agent_id}/hc-prompt/versions/{version_id}/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
prompt_version = response.json()
~~~
~~~javascript Node.js theme={null}
const agentId = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3";
const versionId = "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e";
const response = await fetch(
`https://api-prod.usefini.com/v2/bots/${agentId}/hc-prompt/versions/${versionId}/public`,
{
headers: {
Authorization: "Bearer fini_your_api_key",
},
}
);
const promptVersion = await response.json();
~~~
</RequestExample>
<ResponseExample>
~~~json 200 OK theme={null}
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "6d5ab04e-6d45-45f3-84a1-5822657be9aa",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"versionNumber": 12,
"status": "DRAFT",
"parentVersionId": "f15be201-60d8-4c7d-8b5b-66c2b7a62c34",
"publishedAt": null,
"hcPlanningPrompt": [
{
"id": "planning",
"title": "Planning Prompt",
"content": "Decide whether to search knowledge before answering."
}
],
"hcGuidelinePrompt": [
{
"id": "main-guidelines",
"title": "Main Guidelines",
"content": "Answer with the approved refund policy."
}
],
"hcChannelPrompt": [
{
"id": "widget",
"title": "Widget",
"content": "Keep widget replies concise."
}
]
}
~~~
</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 `read` scope.
</Accordion>
<Accordion title="404 Not Found" icon="ghost">
The version does not exist for this agent.
</Accordion>
<Accordion title="406 Not Acceptable" icon="circle-question">
The agent belongs to a different workspace.
</Accordion>
</AccordionGroup>
## Related topics
- [Publish prompt draft version](/en/api-reference/publish-prompt-draft-version.md)
- [Overview](/en/api-reference/prompts.md)
- [Create prompt draft version](/en/api-reference/create-prompt-draft-version.md)
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
Prompts

