> ## 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.

# PowerShell Full Flow

> End-to-end PowerShell example for Praeto Dispatcher.

# PowerShell Full Flow

```powershell theme={null}
$BaseUrl = "https://api.praeto.dev"
$ApiKey = "praeto_live_YOUR_TENANT_KEY"
$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 = "PowerShell quickstart endpoint"
    subscribed_events = @("test.event")
  } | ConvertTo-Json -Depth 5)

$event = Invoke-RestMethod -Method POST `
  -Uri "$BaseUrl/v1/events" `
  -Headers @{
    Authorization = "Bearer $ApiKey"
    "Idempotency-Key" = "ps-demo-$([guid]::NewGuid().ToString())"
  } `
  -ContentType "application/json" `
  -Body (@{
    event_type = "test.event"
    payload = @{
      message = "hello from PowerShell"
      created_at = (Get-Date).ToString("o")
    }
  } | ConvertTo-Json -Depth 5)

$event
```
