Configure Webhook

Programmatically set the same webhook URL that appears in the dashboard Configure Webhook popup on the API Keys page. Authenticate with the API key itself — no owner login required. Ideal when a third party stores the key and registers its callback in one step.

Related: receiving webhooks

After the URL is set, Aksita POSTs human-agent replies to it. See Human Agent Webhook.

Typical integration flow

  1. User creates an API key in the Aksita dashboard (API Keys tab).
  2. User pastes that key into your product.
  3. Your backend calls PUT /api/webhook with X-API-Key and your HTTPS callback URL.
  4. Done — human-agent replies for conversations using that key are sent to your webhook.

Endpoint

PUT https://api.aksita.ai/api/webhook
No owner session cookie. Auth is the X-API-Key header only. Does not consume credits.

Headers & body

FieldTypeRequiredDescription
X-API-KeyheaderYesThe API key whose webhook you want to configure
webhook_urlstringYes*Must start with https://. Send empty string "" to disable the webhook.
webhook_secretstringNoOptional HMAC secret. Empty string clears the secret. Verified via X-Webhook-Signature on delivery.

* Field should be present; empty value disables webhook (same as clearing the URL in the dashboard).

Request example

curl -X PUT https://api.aksita.ai/api/webhook \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "webhook_url": "https://your-domain.com/aksita/webhook",
    "webhook_secret": "optional-hmac-secret"
  }'

Success response

200 OK
{
  "status": true,
  "data": {
    "api_key_id": "019d5da6-....",
    "api_key_name": "Fonnte",
    "agent_id": "019d5da6-....",
    "webhook_url": "https://your-domain.com/aksita/webhook",
    "webhook_secret_configured": true
  },
  "detail": "Webhook configured successfully"
}

The secret value is never returned — only whether it is configured.

Error responses

401

Missing or invalid X-API-Key

400

webhook_url must use HTTPS (http:// is rejected)

403

Agent is inactive

Disable webhook: Send "webhook_url": "" (and optionally "webhook_secret": "") with the same PUT.