Set or update the webhook URL for an existing API key. When a webhook URL is set, Magpipe sends a POST request to that URL whenever a call completes. A signing secret is auto-generated on first use.
See Webhooks for payload format and signature verification.
Request Body
The UUID of the API key to update.
The HTTPS URL to receive webhook events. Must be a valid HTTP or HTTPS URL. Set to null or empty string to disable and clear the signing secret.
Response
Whether the update was successful.
The updated webhook URL, or null if cleared.
The signing secret for HMAC verification. Format: whsec_.... null if webhook was cleared.
curl -X POST https://api.magpipe.ai/functions/v1/manage-api-keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "update",
"key_id": "b007638d-9550-4cc4-b35f-d11632d77d08",
"webhook_url": "https://your-server.com/webhook"
}'
Success Response
Cleared Webhook
Validation Error
{
"success" : true ,
"webhook_url" : "https://your-server.com/webhook" ,
"webhook_secret" : "whsec_example0000000000000000000000000000000000000000000000000000000"
}