# Webhooks from your code (/docs/automations/webhook/api)

Authenticated with `?privateKey=YOUR_KEY` (see [Authentication](/docs/authentication)).

<Endpoints ops={["POST /admin/automations", "GET /admin/automations", "PATCH /admin/automations/{id}", "POST /v3/webhooks/test"]} />

<ApiPlayground
  method="post"
  path="/admin/automations"
  tool="create_automation"
  args={`{
  "name": "Docs example: trigger-webhook",
  "isActive": true,
  "website": "64b7f0a1c2d3e4f5a6b7c8d9",
  "when": "new-lead-is-identified",
  "then": "trigger-webhook",
  "interval": "immediately",
  "actions": {
    "sentToWebhook": {
      "url": "https://webhook.site/your-unique-id",
      "whenToPush": "every-time"
    }
  }
}`}
/>

## Use case: Check your endpoint first [#use-case-check-your-endpoint-first]

`POST /v3/webhooks/test` with `webhook` set to your URL sends a sample lead and returns the status your endpoint answered.
