> ## 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.
# Publish intent-rule draft
> Publish an intent-rule draft and assign it to one or more agents.
Publishes one draft Intent Rule and assigns it to one or more agents.
<Info>
This endpoint supports intent rules only. Business Rules are published immediately when created and do not have drafts.
</Info>
## Headers
<ParamField header="Authorization" type="string" required>
Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.
</ParamField>
<ParamField header="Content-Type" type="string" required>
`application/json`
</ParamField>
## Path parameters
<ParamField path="id" type="string" required>
Draft rule ID to publish.
</ParamField>
## Body parameters
<ParamField body="botIds" type="string[]" required>
Agent IDs to assign after publishing. At least one ID is required.
</ParamField>
<ParamField body="draftVersionId" type="string" required>
UUID of the draft version to publish. Get it from [List intent-rule versions](/en/api-reference/list-rule-versions) or a `versionStatus=DRAFT` [Get intent rule](/en/api-reference/get-intent-rule) response.
</ParamField>
## Response
Returns the published Intent Rule.
<RequestExample>
~~~bash cURL theme={null}
curl --request POST \
--url 'https://api-prod.usefini.com/v2/hc-rules/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/publish/public' \
--header 'Authorization: Bearer fini_your_api_key' \
--header 'Content-Type: application/json' \
--data '{
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"draftVersionId": "v3"
}'
~~~
~~~javascript Node.js theme={null}
const response = await fetch('https://api-prod.usefini.com/v2/hc-rules/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/publish/public', {
method: 'POST',
headers: {
Authorization: 'Bearer fini_your_api_key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'botIds': [
'2a1cf0f0-f35d-46ad-8e61-a15c86b2b312'
],
'draftVersionId': 'v3'
}
)
});
const data = await response.json();
~~~
~~~python Python theme={null}
import requests
response = requests.post(
"https://api-prod.usefini.com/v2/hc-rules/4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3/publish/public",
headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
json={
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"draftVersionId": "v3"
},
)
data = response.json()
~~~
</RequestExample>
<ResponseExample>
~~~json 201 Created theme={null}
{
"id": "b8b8d87b-2f0c-47f6-8a8a-546da73e0820",
"name": "Refund escalation",
"description": "Route refund requests to the right workflow.",
"status": "PUBLISHED",
"source": null,
"triggerType": null,
"botIds": [
"2a1cf0f0-f35d-46ad-8e61-a15c86b2b312"
],
"flowConfig": {
"type": "reply",
"message": "Escalate refund requests with order context."
},
"version": 3,
"versionId": "v3",
"createdAt": "2026-07-28T08:55:32.000Z",
"updatedAt": "2026-07-28T09:10:18.000Z"
}
~~~
</ResponseExample>
## Errors
<AccordionGroup>
<Accordion title="400 Bad Request" icon="circle-exclamation">
The body is malformed, the `botIds` array is empty, one or more agent IDs do not belong to your workspace, or the selected draft became stale after another version was published.
</Accordion>
<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 `write` scope required for this route.
</Accordion>
<Accordion title="404 Not Found" icon="ghost">
The draft rule or `draftVersionId` does not exist in your workspace, does not belong to the rule, or is no longer a draft.
</Accordion>
<Accordion title="500 Internal Server Error" icon="triangle-exclamation">
Fini failed while publishing the draft or syncing agent assignments.
</Accordion>
</AccordionGroup>
## Related topics
- [Generate intent-rule draft with AI](/en/api-reference/generate-intent-rule-draft.md)
- [Restore intent-rule version as draft](/en/api-reference/restore-rule-version-as-draft.md)
- [Delete intent-rule draft version](/en/api-reference/delete-rule-draft-version.md)
This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
Intent Rules

