curl --request PUT \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/deployment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"versionNumber": 4,
"weight": 90
},
{
"versionNumber": 5,
"weight": 10
}
],
"expectedEntries": [
{
"versionNumber": 4,
"weight": 100
}
]
}
'{
"success": true,
"message": "success",
"data": {
"agentId": "fc6f158b-24c2-45a6-957b-c57c0a8979b5",
"entries": [
{
"versionNumber": 4,
"weight": 100
}
],
"updatedAt": "2026-10-28T09:15:00.000Z",
"servingVersionNumber": 4,
"weightsEnforced": true,
"environmentRevisionId": "1c5a7e93-4d2f-4b6a-9e8c-3f1d5b7a9c02"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}Agent Versions & Drafts
Set Agent Deployment
Starts, changes, finishes or stops an A/B test on prod (agents with deployments on). Send one version at weight 100, or two versions with weights from 1 to 99 that add up to 100. A change that switches which version has the larger share also needs agents:deploy. Send expectedEntries (what you last saw) to be refused with 409 if someone changed the deployment since.
PUT
/
v2
/
voice-agents
/
{voiceAgentId}
/
deployment
curl --request PUT \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/deployment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"versionNumber": 4,
"weight": 90
},
{
"versionNumber": 5,
"weight": 10
}
],
"expectedEntries": [
{
"versionNumber": 4,
"weight": 100
}
]
}
'{
"success": true,
"message": "success",
"data": {
"agentId": "fc6f158b-24c2-45a6-957b-c57c0a8979b5",
"entries": [
{
"versionNumber": 4,
"weight": 100
}
],
"updatedAt": "2026-10-28T09:15:00.000Z",
"servingVersionNumber": 4,
"weightsEnforced": true,
"environmentRevisionId": "1c5a7e93-4d2f-4b6a-9e8c-3f1d5b7a9c02"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}{
"code": 8409,
"message": "Your draft changed in another tab or through your API key. Reload it and try again.",
"messageKey": "DraftStaleRevision",
"params": {
"reason": "STALE_REVISION",
"revision": "e2f7a9c3-6b1d-4e5f-a8c2-7d3b9f0e1a56"
}
}Authorizations
Headers
Optional, up to 255 characters. Retry with the same key after a network error and you get the first answer back instead of the change being made twice (kept 10 minutes). Same key with a different body: 422 IdempotencyKeyReused. While the first request still runs: 409 IdempotencyKeyInProgress.
Maximum string length:
255Example:
"0b6f3c1e-retry-1"
Path Parameters
Body
application/json
Was this page helpful?