Skip to main content
Webhook Security
  • Save the returned secret securely
  • Use it to verify webhook signatures
  • The secret is only shown once at creation
  • Rotate the secret if compromised
Start with job.completed and job.failed for essential notifications.
POST
/
v1
/
webhooks
/
endpoints
Create a webhook endpoint
curl --request POST \
  --url https://api.peepal.dev/v1/webhooks/endpoints \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "url": "<string>",
  "events": [
    "job.created"
  ]
}
'
{
  "id": "<string>",
  "url": "<string>",
  "events": [
    "job.created"
  ],
  "enabled": true,
  "description": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "secret": "<string>"
}
Create a webhook endpoint to receive real-time notifications about job events. The endpoint URL will receive POST requests with event payloads.

Event Types

  • job.created - Job was created
  • job.started - Job processing started
  • job.progress - Job progress updated
  • job.completed - Job finished successfully
  • job.failed - Job failed with error
  • job.canceled - Job was canceled
curl -X POST "https://api.peepal.dev/v1/webhooks/endpoints" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "url": "https://your-app.com/webhooks/peepal",
    "events": ["job.completed", "job.failed"],
    "enabled": true,
    "description": "Production webhook endpoint"
  }'
{
  "id": "wh_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "url": "https://your-app.com/webhooks/peepal",
  "events": ["job.completed", "job.failed"],
  "enabled": true,
  "description": "Production webhook endpoint",
  "created_at": "2025-12-31T10:00:00Z",
  "secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}

Authorizations

x-api-key
string
header
required

Body

application/json
url
string<uri>
required
events
enum<string>[]
required
Minimum array length: 1
Available options:
job.created,
job.started,
job.progress,
job.completed,
job.failed,
job.canceled
enabled
boolean
default:true
description
string

Response

Webhook endpoint created

id
string
required
url
string<uri>
required
events
enum<string>[]
required
Available options:
job.created,
job.started,
job.progress,
job.completed,
job.failed,
job.canceled
enabled
boolean
required
description
string | null
required
created_at
string<date-time>
required
secret
string
required