> ## 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.

# Restore prompt version as draft

> Copy a stored prompt lifecycle version into a new draft without changing the live prompt.

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

**Authorization** `string` *required*

Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.

## Path parameters

**id** `string` *required*

Agent UUID.

**versionId** `string` *required*

Source prompt lifecycle version UUID belonging to this agent.

## Response

**id** `string`

New draft version ID.

**status** `string`

DRAFT.

**parentVersionId** `string | null`

Current published lifecycle version when the draft was created.

**hcPlanningPrompt** `PromptSection[]`

Stored planning sections copied from the source.

**hcGuidelinePrompt** `PromptSection[]`

Stored main-guideline sections copied from the source.

**hcChannelPrompt** `PromptSection[]`

Stored channel sections copied from the source.

```bash cURL theme={null}
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'
```

```javascript Node.js theme={null}
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();
```

```python Python theme={null}
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()
```

```json 201 Created theme={null}
{
  "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.


## Related topics

- [API overview](https://docs.usefini.com/en/api-reference/overview.md)
- [Restore intent-rule version as draft](https://docs.usefini.com/en/api-reference/restore-rule-version-as-draft.md)
- [Publish prompt draft version](https://docs.usefini.com/en/api-reference/publish-prompt-draft-version.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.