Skip to main content
PATCH
/
api
/
agents
/
{agentId}
/
unassign
curl -X PATCH "https://api.zudu.ai/api/agents/agent_1234567890abcdef/unassign" \
  -H "X-API-KEY: sk_Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234Yz" \
  -H "X-API-SECRET: s3cr3t_Xyz789Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234" \
{
  "message": "Post-call webhook unassigned successfully",
  "status": "success",
  "error": null,
  "data": {
    "agent_id": "agent_1234567890abcdef",
    "agent_name": "Customer Support Agent",
    "unassigned_webhook_id": "webhook_abc123def456",
    "unassigned_webhook_name": "Call Analytics Webhook",
    "removed_tools_count": 1,
    "post_call_webhook_id": null
  }
Unassign any post-call webhook from an agent. This is a simple endpoint that only requires the agent ID - it will remove any webhook currently assigned to the agent.
curl -X PATCH "https://api.zudu.ai/api/agents/agent_1234567890abcdef/unassign" \
  -H "X-API-KEY: sk_Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234Yz" \
  -H "X-API-SECRET: s3cr3t_Xyz789Abc123Def456Ghi789Jkl012Mno345Pqr678Stu901Vwx234" \
{
  "message": "Post-call webhook unassigned successfully",
  "status": "success",
  "error": null,
  "data": {
    "agent_id": "agent_1234567890abcdef",
    "agent_name": "Customer Support Agent",
    "unassigned_webhook_id": "webhook_abc123def456",
    "unassigned_webhook_name": "Call Analytics Webhook",
    "removed_tools_count": 1,
    "post_call_webhook_id": null
  }

Path Parameters

agentId
string
required
The ID of the agent to unassign the webhook from (format: agent_...)Example: agent_1234567890abcdefNote: The agent_ prefix is optional - it will be added automatically if not provided

Headers

X-API-KEY
string
required
Your API key (format: sk_...)
X-API-SECRET
string
required
Your API secret (format: s3cr3t_...)

Response Fields

agent_id
string
The agent ID the webhook was unassigned from
agent_name
string
The name of the agent
unassigned_webhook_id
string
The webhook ID that was unassigned (or null if no webhook was assigned)
unassigned_webhook_name
string
The name of the webhook that was unassigned (or null if no webhook was assigned)
removed_tools_count
integer
Number of webhook tools removed from the agent’s tools list
post_call_webhook_id
string
Always null after successful unassignment

Error Responses

error
string
Unauthorized - Missing or invalid API key/secret
error
string
Not Found - Agent does not exist
{
  "message": "Agent not found",
  "status": "error",
  "error": "Agent not found in organization"
}
error
string
Internal Server Error - Failed to unassign webhook
{
  "message": "Failed to unassign webhook",
  "status": "error",
  "error": "Database connection failed"
}

Notes

  • This endpoint only requires the agent ID - no webhook ID needed
  • If the agent doesn’t have a webhook assigned, the endpoint will still return success with unassigned_webhook_id: null
  • The webhook assignment is cleared from the agent’s post_call_webhook_id field
  • Corresponding webhook tools are also removed from the agent’s tools array
  • Use this endpoint when you want to remove any webhook from an agent without needing to know the specific webhook ID
  • For removing a specific webhook by ID, use DELETE /api/agents/{agentId}/tools/post-call-webhook/{webhookId}