> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praeto.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer onboarding

# Customer onboarding

This guide is the shortest customer-facing setup path for Praeto Dispatcher. It is designed for teams that already have an application that emits events and need reliable webhook delivery to customer endpoints.

## Setup checklist

A customer should be able to complete the first working integration in this order:

1. Receive a tenant API key from Praeto.
2. Create an endpoint destination.
3. Store the returned signing secret.
4. Publish a test event.
5. Verify the webhook signature at the receiving service.
6. Inspect delivery attempts.
7. Replay a delivery if needed.
8. Monitor usage, metrics, and endpoint health.

## Base URL

Use the production API hostname:

```text theme={null}
https://api.praeto.dev
```

## Step 1: Set your API key

```bash theme={null}
export PRAETO_API_KEY="praeto_live_YOUR_KEY"
```

PowerShell:

```powershell theme={null}
$env:PRAETO_API_KEY = "praeto_live_YOUR_KEY"
$BaseUrl = "https://api.praeto.dev"
```

## Step 2: Create your first endpoint

Use a test receiver such as webhook.site for the first setup pass.

```bash theme={null}
curl -X POST https://api.praeto.dev/v1/endpoints \
  -H "Authorization: Bearer $PRAETO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://webhook.site/YOUR-UUID",
    "description": "Production event receiver",
    "subscribed_events": ["order.created", "invoice.paid"]
  }'
```

The response includes `signing_secret`. Store it immediately. It is only returned on create and rotate.

## Step 3: Publish a test event

```bash theme={null}
curl -X POST https://api.praeto.dev/v1/events \
  -H "Authorization: Bearer $PRAETO_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
    }
  }'
```

A successful response returns an `event_id` and one or more `delivery_ids`.

## Step 4: Verify the webhook signature

Praeto sends signed webhook requests with headers such as:

```text theme={null}
praeto-event-id
praeto-delivery-id
praeto-timestamp
praeto-signature
```

Use the raw request body for verification. Do not parse and re-serialize the JSON before calculating the HMAC.

## Step 5: Inspect delivery attempts

```bash theme={null}
curl https://api.praeto.dev/v1/deliveries/DELIVERY_ID/attempts \
  -H "Authorization: Bearer $PRAETO_API_KEY"
```

## Step 6: Replay a delivery

```bash theme={null}
curl -X POST https://api.praeto.dev/v1/deliveries/DELIVERY_ID/replay \
  -H "Authorization: Bearer $PRAETO_API_KEY"
```

## Step 7: Check usage and limits

```bash theme={null}
curl https://api.praeto.dev/v1/usage/current \
  -H "Authorization: Bearer $PRAETO_API_KEY"

curl https://api.praeto.dev/v1/usage/limits \
  -H "Authorization: Bearer $PRAETO_API_KEY"

curl https://api.praeto.dev/v1/safety/limits \
  -H "Authorization: Bearer $PRAETO_API_KEY"
```

## Recommended first production rollout

Start with a narrow event set such as `order.created` or `invoice.paid`. Send those events to one endpoint, verify signature handling, then expand the subscription list once the receiving service has a clean delivery history.

## What to monitor after launch

* Endpoint success rate
* Recent response codes
* Dead-lettered deliveries
* Retry volume
* Monthly delivery attempts
* Payload size
* Rate-limit responses

Praeto Dispatcher is designed so customer support can answer “what happened to this webhook?” without digging through application logs.
