Skip to main content
POST
/
manage-api-keys
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": true,
  "webhook_url": "https://your-server.com/webhook",
  "webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
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

action
string
required
Must be update.
key_id
string
required
The UUID of the API key to update.
webhook_url
string
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

success
boolean
Whether the update was successful.
webhook_url
string
The updated webhook URL, or null if cleared.
webhook_secret
string
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": true,
  "webhook_url": "https://your-server.com/webhook",
  "webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}