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"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'update',
key_id: 'b007638d-9550-4cc4-b35f-d11632d77d08',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const { webhook_secret } = await response.json();
console.log('Save this secret:', webhook_secret);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'action': 'update',
'key_id': 'b007638d-9550-4cc4-b35f-d11632d77d08',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"Signing secret: {data['webhook_secret']}")
{
"success": true,
"webhook_url": "https://your-server.com/webhook",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"success": true,
"webhook_url": null,
"webhook_secret": null
}
{
"error": "Invalid webhook URL. Must be a valid HTTP/HTTPS URL."
}
API Keys & Webhooks
Set Webhook URL
Set or update the webhook URL on an API key
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"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'update',
key_id: 'b007638d-9550-4cc4-b35f-d11632d77d08',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const { webhook_secret } = await response.json();
console.log('Save this secret:', webhook_secret);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'action': 'update',
'key_id': 'b007638d-9550-4cc4-b35f-d11632d77d08',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"Signing secret: {data['webhook_secret']}")
{
"success": true,
"webhook_url": "https://your-server.com/webhook",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"success": true,
"webhook_url": null,
"webhook_secret": null
}
{
"error": "Invalid webhook URL. Must be a valid HTTP/HTTPS URL."
}
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 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
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"
}'
const response = await fetch(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
action: 'update',
key_id: 'b007638d-9550-4cc4-b35f-d11632d77d08',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const { webhook_secret } = await response.json();
console.log('Save this secret:', webhook_secret);
import requests
response = requests.post(
'https://api.magpipe.ai/functions/v1/manage-api-keys',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
json={
'action': 'update',
'key_id': 'b007638d-9550-4cc4-b35f-d11632d77d08',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"Signing secret: {data['webhook_secret']}")
{
"success": true,
"webhook_url": "https://your-server.com/webhook",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"success": true,
"webhook_url": null,
"webhook_secret": null
}
{
"error": "Invalid webhook URL. Must be a valid HTTP/HTTPS URL."
}