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": "generate",
    "name": "Production Server",
    "webhook_url": "https://your-server.com/webhook"
  }'
{
  "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"
}
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

action
string
required
Must be generate.
name
string
required
Descriptive name for the key (e.g., “Production Server”, “CI Pipeline”). Max 64 characters.
webhook_url
string
Optional HTTPS URL to receive webhook events. A signing secret is auto-generated when set.

Response

key
string
The full API key. Only shown once. Format: mgp_ followed by 40 hex characters.
id
string
UUID of the created key. Use this for update/revoke operations.
name
string
The key name.
key_prefix
string
First 8 characters of the key for identification.
created_at
string
ISO 8601 creation timestamp.
webhook_secret
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"
  }'
{
  "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"
}