Replace guidelines
curl --request PUT \
--url https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"guidelines": "## Role\nYou book appointments for Bodywell Clinic.\n\n## Booking\nCheck availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.\nOffer at most three times."
}
'import requests
url = "https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines"
payload = { "guidelines": "## Role
You book appointments for Bodywell Clinic.
## Booking
Check availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.
Offer at most three times." }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
guidelines: '## Role\nYou book appointments for Bodywell Clinic.\n\n## Booking\nCheck availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.\nOffer at most three times.'
})
};
fetch('https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"assistant_id": "3c7e1a52-8d4f-4b9a-a0e6-5f2d9c8b1e74",
"needs_publish": true,
"live_version": {
"version_id": "5e0b9c41-7a2d-4f6e-b8c3-1d9a0e4f7b62",
"version_number": 3,
"name": null,
"published_at": "2026-10-29T14:02:11.000Z",
"activated_at": null
}
}
}{
"success": false,
"error": "Invalid request body",
"details": "Unknown field(s): instructions. Only \"guidelines\" can be set."
}{
"success": false,
"error": "Unauthorized: Invalid credentials"
}{
"message": "Forbidden: Workspace does not belong to your account."
}{
"message": "Assistant not found."
}{
"status": "error",
"message": "Too many requests, please try again later."
}Agents
Replace guidelines
Replace the guidelines on an agent’s draft with new text
PUT
/
api
/
v1
/
assistants
/
{assistantId}
/
guidelines
Replace guidelines
curl --request PUT \
--url https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"guidelines": "## Role\nYou book appointments for Bodywell Clinic.\n\n## Booking\nCheck availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.\nOffer at most three times."
}
'import requests
url = "https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines"
payload = { "guidelines": "## Role
You book appointments for Bodywell Clinic.
## Booking
Check availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.
Offer at most three times." }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
guidelines: '## Role\nYou book appointments for Bodywell Clinic.\n\n## Booking\nCheck availability with {{action.8b2f6d10-4c3e-4a7b-9e15-2d6c0f8a3b91}} before offering a time.\nOffer at most three times.'
})
};
fetch('https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/guidelines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"assistant_id": "3c7e1a52-8d4f-4b9a-a0e6-5f2d9c8b1e74",
"needs_publish": true,
"live_version": {
"version_id": "5e0b9c41-7a2d-4f6e-b8c3-1d9a0e4f7b62",
"version_number": 3,
"name": null,
"published_at": "2026-10-29T14:02:11.000Z",
"activated_at": null
}
}
}{
"success": false,
"error": "Invalid request body",
"details": "Unknown field(s): instructions. Only \"guidelines\" can be set."
}{
"success": false,
"error": "Unauthorized: Invalid credentials"
}{
"message": "Forbidden: Workspace does not belong to your account."
}{
"message": "Assistant not found."
}{
"status": "error",
"message": "Too many requests, please try again later."
}Start from Get guidelines, and send the placeholders back exactly as you received them. A
{{...}} placeholder written with a name instead of its ID, such as {{action.Check availability}}, doesn’t resolve. Change the text around the placeholders and leave each one as it was.- The whole text is replaced. Send everything the agent should keep, not only what changed. An empty string clears the guidelines.
- The last write wins. There is no conflict check, so a replace overwrites whatever was saved before it, including an edit made in Studio.
- It’s recorded. A replace appears in Audit Logs as an update to the agent, with the key’s creator as the Actor.
When the Change Goes Live
A replace saves to the agent’s draft, exactly like typing in the Guidelines editor:- An agent that has never been published runs its draft, so its next conversation uses the new guidelines.
- A published agent keeps using its published guidelines on phone calls, website chats and emails until it is published again, with Publish an agent or Publish in Studio. Until then the agent shows Unpublished edits, and Review Changes lists the new guidelines. Talk and the test Chat use the draft straight away.
needs_publish in the response is true when the agent has any unpublished change, yours or an edit made in Studio, and live_version names the version that is live. See Publishing Your Agent.Authorizations
An API key from Manage → API Keys in Studio. See Authentication.
Path Parameters
The agent's ID. Open the agent in Studio and select Copy ID in its header.
Body
application/json
The whole new guidelines text, as Markdown. It replaces what's there, so send everything the agent should keep. An empty string clears the guidelines. This is the only field accepted; any other field returns a 400.
Was this page helpful?