Skip to main content

Quickstart

This guide walks through the basic Praeto Dispatcher flow:
  1. Set an API key
  2. Create an endpoint destination
  3. Publish an event
  4. Verify idempotency
  5. Inspect deliveries and attempts
  6. Check usage and metrics

Prerequisites

You need:
  • A Praeto tenant API key
  • A webhook receiver URL such as https://webhook.site/...
  • PowerShell, curl, or any HTTP client

Set your API key

$BaseUrl = "https://api.praeto.dev"
$ApiKey = "praeto_live_YOUR_TENANT_KEY"
For your development Worker, use:
$BaseUrl = "https://api.praeto.dev"

Create an endpoint

$EndpointUrl = "https://webhook.site/YOUR-UUID"

$endpoint = Invoke-RestMethod -Method POST `
  -Uri "$BaseUrl/v1/endpoints" `
  -Headers @{ Authorization = "Bearer $ApiKey" } `
  -ContentType "application/json" `
  -Body (@{
    url = $EndpointUrl
    description = "Production webhook endpoint"
    subscribed_events = @("order.created", "invoice.paid")
  } | ConvertTo-Json -Depth 5)

$endpoint
The create response returns the endpoint signing secret once. Store it immediately.

Publish an event

$event = Invoke-RestMethod -Method POST `
  -Uri "$BaseUrl/v1/events" `
  -Headers @{
    Authorization = "Bearer $ApiKey"
    "Idempotency-Key" = "order-123-created"
  } `
  -ContentType "application/json" `
  -Body (@{
    event_type = "order.created"
    payload = @{
      order_id = "ord_123"
      customer_id = "cus_456"
      total = 149.00
    }
  } | ConvertTo-Json -Depth 5)

$event
curl version:
curl -X POST https://api.praeto.dev/v1/events \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: order-123-created" \
  -H "Content-Type: application/json" \
  -d '{
    "event_type": "order.created",
    "payload": {
      "order_id": "ord_123",
      "customer_id": "cus_456",
      "total": 149.00
    }
  }'

Inspect delivery attempts

$DeliveryId = $event.delivery_ids[0]

Invoke-RestMethod `
  -Uri "$BaseUrl/v1/deliveries/$DeliveryId/attempts" `
  -Headers @{ Authorization = "Bearer $ApiKey" }

Check usage

Invoke-RestMethod `
  -Uri "$BaseUrl/v1/usage/current" `
  -Headers @{ Authorization = "Bearer $ApiKey" }