curl --request POST \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public' \
--header 'Authorization: Bearer fini_your_api_key'
const response = await fetch('https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public', {
method: 'POST',
headers: { Authorization: 'Bearer fini_your_api_key' }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
response.raise_for_status()
data = response.json()
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "6d5ab04e-6d45-45f3-84a1-5822657be9aa",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"companyId": "11111111-1111-4111-8111-111111111111",
"versionNumber": 12,
"status": "DRAFT",
"parentVersionId": "f15be201-60d8-4c7d-8b5b-66c2b7a62c34",
"createdBy": null,
"publishedAt": null,
"isDeleted": false,
"deletedAt": null,
"deletedBy": null,
"createdAt": "2026-10-29T12:00:00.000Z",
"updatedAt": "2026-10-29T12:00:00.000Z",
"hcPlanningPrompt": [
{
"id": "planning",
"name": "Planning Prompt",
"description": "Planning Prompt instructions.",
"enabled": true,
"subsections": [
{
"id": "planning-instructions",
"name": "Instructions",
"prompt": "Search knowledge before answering policy questions.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcGuidelinePrompt": [
{
"id": "main-guidelines",
"name": "Main Guidelines",
"description": "Main Guidelines instructions.",
"enabled": true,
"subsections": [
{
"id": "main-guidelines-instructions",
"name": "Instructions",
"prompt": "Use approved policy.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcChannelPrompt": [
{
"id": "widget",
"name": "Widget",
"description": "Widget instructions.",
"enabled": true,
"subsections": [
{
"id": "widget-instructions",
"name": "Instructions",
"prompt": "Keep replies concise.",
"useDefault": false,
"enabled": true
}
]
}
]
}
Prompts
Restore prompt version as draft
Copy a stored prompt lifecycle version into a new draft without changing the live prompt.
POST
/
v2
/
bots
/
{id}
/
hc-prompt
/
versions
/
{versionId}
/
restore-as-draft
/
public
curl --request POST \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public' \
--header 'Authorization: Bearer fini_your_api_key'
const response = await fetch('https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public', {
method: 'POST',
headers: { Authorization: 'Bearer fini_your_api_key' }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
response.raise_for_status()
data = response.json()
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "6d5ab04e-6d45-45f3-84a1-5822657be9aa",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"companyId": "11111111-1111-4111-8111-111111111111",
"versionNumber": 12,
"status": "DRAFT",
"parentVersionId": "f15be201-60d8-4c7d-8b5b-66c2b7a62c34",
"createdBy": null,
"publishedAt": null,
"isDeleted": false,
"deletedAt": null,
"deletedBy": null,
"createdAt": "2026-10-29T12:00:00.000Z",
"updatedAt": "2026-10-29T12:00:00.000Z",
"hcPlanningPrompt": [
{
"id": "planning",
"name": "Planning Prompt",
"description": "Planning Prompt instructions.",
"enabled": true,
"subsections": [
{
"id": "planning-instructions",
"name": "Instructions",
"prompt": "Search knowledge before answering policy questions.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcGuidelinePrompt": [
{
"id": "main-guidelines",
"name": "Main Guidelines",
"description": "Main Guidelines instructions.",
"enabled": true,
"subsections": [
{
"id": "main-guidelines-instructions",
"name": "Instructions",
"prompt": "Use approved policy.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcChannelPrompt": [
{
"id": "widget",
"name": "Widget",
"description": "Widget instructions.",
"enabled": true,
"subsections": [
{
"id": "widget-instructions",
"name": "Instructions",
"prompt": "Keep replies concise.",
"useDefault": false,
"enabled": true
}
]
}
]
}
Copies all three prompt arrays from the selected version into a new draft. The source and live prompt stay unchanged. No request body is required.
The new draft’s parent is the current published version, not necessarily the source being restored. Review and test the returned draft before publishing it through the prompt publication workflow.
Headers
string
required
Bearer token containing your Fini workspace API key. Format:
Bearer fini_... The key needs write scope.Path parameters
string
required
Agent UUID.
string
required
Source prompt lifecycle version UUID belonging to this agent.
Response
string
New draft version ID.
string
DRAFT.
string | null
Current published lifecycle version when the draft was created.
PromptSection[]
Stored planning sections copied from the source.
PromptSection[]
Stored main-guideline sections copied from the source.
PromptSection[]
Stored channel sections copied from the source.
curl --request POST \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public' \
--header 'Authorization: Bearer fini_your_api_key'
const response = await fetch('https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public', {
method: 'POST',
headers: { Authorization: 'Bearer fini_your_api_key' }
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const data = await response.json();
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/restore-as-draft/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
response.raise_for_status()
data = response.json()
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "6d5ab04e-6d45-45f3-84a1-5822657be9aa",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"companyId": "11111111-1111-4111-8111-111111111111",
"versionNumber": 12,
"status": "DRAFT",
"parentVersionId": "f15be201-60d8-4c7d-8b5b-66c2b7a62c34",
"createdBy": null,
"publishedAt": null,
"isDeleted": false,
"deletedAt": null,
"deletedBy": null,
"createdAt": "2026-10-29T12:00:00.000Z",
"updatedAt": "2026-10-29T12:00:00.000Z",
"hcPlanningPrompt": [
{
"id": "planning",
"name": "Planning Prompt",
"description": "Planning Prompt instructions.",
"enabled": true,
"subsections": [
{
"id": "planning-instructions",
"name": "Instructions",
"prompt": "Search knowledge before answering policy questions.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcGuidelinePrompt": [
{
"id": "main-guidelines",
"name": "Main Guidelines",
"description": "Main Guidelines instructions.",
"enabled": true,
"subsections": [
{
"id": "main-guidelines-instructions",
"name": "Instructions",
"prompt": "Use approved policy.",
"useDefault": false,
"enabled": true
}
]
}
],
"hcChannelPrompt": [
{
"id": "widget",
"name": "Widget",
"description": "Widget instructions.",
"enabled": true,
"subsections": [
{
"id": "widget-instructions",
"name": "Instructions",
"prompt": "Keep replies concise.",
"useDefault": false,
"enabled": true
}
]
}
]
}
Errors
400 for malformed UUIDs; 404 when the source version is not found for this agent. The agent must belong to the key’s workspace. All requests can return 401 for an invalid or revoked key, or 403 when the required scope is missing.Was this page helpful?

