curl --request POST \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/publish/public' \
--header 'Authorization: Bearer fini_your_api_key'
import requests
agent_id = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3"
version_id = "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e"
response = requests.post(
f"https://api-prod.usefini.com/v2/bots/{agent_id}/hc-prompt/versions/{version_id}/publish/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
published_version = response.json()
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}/publish/public`,
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
},
}
);
const publishedVersion = await response.json();
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "a6d8c1df-df4c-4307-8c0f-41f7ac0c2ca7",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"versionNumber": 12,
"status": "PUBLISHED",
"publishedAt": "2026-08-01T09:14:00.000Z"
}
Prompts
Publish prompt draft version
Publish one reviewed prompt draft version.
POST
/
v2
/
bots
/
{id}
/
hc-prompt
/
versions
/
{versionId}
/
publish
/
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/publish/public' \
--header 'Authorization: Bearer fini_your_api_key'
import requests
agent_id = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3"
version_id = "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e"
response = requests.post(
f"https://api-prod.usefini.com/v2/bots/{agent_id}/hc-prompt/versions/{version_id}/publish/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
published_version = response.json()
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}/publish/public`,
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
},
}
);
const publishedVersion = await response.json();
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "a6d8c1df-df4c-4307-8c0f-41f7ac0c2ca7",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"versionNumber": 12,
"status": "PUBLISHED",
"publishedAt": "2026-08-01T09:14:00.000Z"
}
Publishes one exact prompt draft version and makes its three prompt arrays the
agent’s active configuration.
Before calling this route, fetch the version with
Get prompt draft version, compare
it with Get prompts, and obtain explicit
confirmation for that agent and version.
Publishing changes live agent behavior. A draft becomes stale when the
published prompt changes after the draft was created. Fini rejects stale
drafts instead of overwriting the newer configuration.
Headers
string
required
Bearer token containing your Fini workspace API key. Format:
Bearer fini_...
The key needs write scope.Path parameters
string
required
Agent ID that owns the draft.
string
required
Exact reviewed draft version ID to publish.
Response
Returns the published lifecycle version.string
Published lifecycle version ID. This matches
versionId.string
New active prompt record ID created from the draft.
string
Agent ID that now uses the published prompt.
number
Published lifecycle version number.
string
Returns
PUBLISHED.datetime
Publication timestamp.
curl --request POST \
--url 'https://api-prod.usefini.com/v2/bots/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/hc-prompt/versions/9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e/publish/public' \
--header 'Authorization: Bearer fini_your_api_key'
import requests
agent_id = "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3"
version_id = "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e"
response = requests.post(
f"https://api-prod.usefini.com/v2/bots/{agent_id}/hc-prompt/versions/{version_id}/publish/public",
headers={"Authorization": "Bearer fini_your_api_key"},
)
published_version = response.json()
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}/publish/public`,
{
method: "POST",
headers: {
Authorization: "Bearer fini_your_api_key",
},
}
);
const publishedVersion = await response.json();
{
"id": "9c59b2df-5d5f-4c9e-a070-9ac3c2b1b24e",
"promptId": "a6d8c1df-df4c-4307-8c0f-41f7ac0c2ca7",
"botId": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3",
"versionNumber": 12,
"status": "PUBLISHED",
"publishedAt": "2026-08-01T09:14:00.000Z"
}
Errors
400 Bad Request
400 Bad Request
The draft is stale because a different prompt version became published
after this draft was created.
401 Unauthorized
401 Unauthorized
The API key is missing, malformed, revoked, or invalid.
403 Forbidden
403 Forbidden
The API key does not include
write scope.404 Not Found
404 Not Found
The version does not exist for this agent or is not a draft.
406 Not Acceptable
406 Not Acceptable
The agent belongs to a different workspace.
Was this page helpful?

