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": "generate",
"name": "Production Server",
"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: 'generate',
name: 'Production Server',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const data = await response.json();
console.log('API Key (save this!):', data.key);
console.log('Webhook Secret:', data.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': 'generate',
'name': 'Production Server',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"API Key (save this!): {data['key']}")
print(f"Webhook Secret: {data['webhook_secret']}")
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "fd5afe2f-1747-4ae2-9f41-9e1b3b4307b5",
"name": "Production Server",
"key_prefix": "mgp_fc05",
"created_at": "2026-02-18T10:40:36.561396+00:00",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "c8e84946-470e-438d-b36d-7aa8cf14b8a1",
"name": "CI Pipeline",
"key_prefix": "mgp_2161",
"created_at": "2026-02-18T10:29:11.887458+00:00",
"webhook_secret": null
}
API Keys & Webhooks
Create API Key
Generate a new API key with optional webhook URL
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": "generate",
"name": "Production Server",
"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: 'generate',
name: 'Production Server',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const data = await response.json();
console.log('API Key (save this!):', data.key);
console.log('Webhook Secret:', data.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': 'generate',
'name': 'Production Server',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"API Key (save this!): {data['key']}")
print(f"Webhook Secret: {data['webhook_secret']}")
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "fd5afe2f-1747-4ae2-9f41-9e1b3b4307b5",
"name": "Production Server",
"key_prefix": "mgp_fc05",
"created_at": "2026-02-18T10:40:36.561396+00:00",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "c8e84946-470e-438d-b36d-7aa8cf14b8a1",
"name": "CI Pipeline",
"key_prefix": "mgp_2161",
"created_at": "2026-02-18T10:29:11.887458+00:00",
"webhook_secret": null
}
Generate a new API key. The full key is only returned once — store it securely. Optionally set a webhook URL at creation time.
Request Body
Descriptive name for the key (e.g., “Production Server”, “CI Pipeline”). Max 64 characters.
Response
The full API key is only returned in this response. Store it immediately — you cannot retrieve it later.
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": "generate",
"name": "Production Server",
"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: 'generate',
name: 'Production Server',
webhook_url: 'https://your-server.com/webhook',
}),
}
);
const data = await response.json();
console.log('API Key (save this!):', data.key);
console.log('Webhook Secret:', data.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': 'generate',
'name': 'Production Server',
'webhook_url': 'https://your-server.com/webhook',
}
)
data = response.json()
print(f"API Key (save this!): {data['key']}")
print(f"Webhook Secret: {data['webhook_secret']}")
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "fd5afe2f-1747-4ae2-9f41-9e1b3b4307b5",
"name": "Production Server",
"key_prefix": "mgp_fc05",
"created_at": "2026-02-18T10:40:36.561396+00:00",
"webhook_secret": "whsec_example0000000000000000000000000000000000000000000000000000000"
}
{
"key": "mgp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"id": "c8e84946-470e-438d-b36d-7aa8cf14b8a1",
"name": "CI Pipeline",
"key_prefix": "mgp_2161",
"created_at": "2026-02-18T10:29:11.887458+00:00",
"webhook_secret": null
}