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_fc059e03d5c97cbf328b4a1412c226625e9ae512",
"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_2161ad7e5372924dc39e3cfd3d284d01819411ad",
"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_fc059e03d5c97cbf328b4a1412c226625e9ae512",
"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_2161ad7e5372924dc39e3cfd3d284d01819411ad",
"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
string
required
Must be
generate.string
required
Descriptive name for the key (e.g., “Production Server”, “CI Pipeline”). Max 64 characters.
string
Optional HTTPS URL to receive webhook events. A signing secret is auto-generated when set.
Response
string
The full API key. Only shown once. Format:
mgp_ followed by 40 hex characters.string
UUID of the created key. Use this for update/revoke operations.
string
The key name.
string
First 8 characters of the key for identification.
string
ISO 8601 creation timestamp.
string
Signing secret for HMAC verification, or
null if no webhook URL was set.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_fc059e03d5c97cbf328b4a1412c226625e9ae512",
"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_2161ad7e5372924dc39e3cfd3d284d01819411ad",
"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
}
⌘I