# Clay from your code (/docs/automations/clay/api)

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

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

<ApiPlayground
  method="post"
  path="/admin/automations"
  tool="create_automation"
  args={`{
  "name": "Docs example: send-to-clay",
  "isActive": true,
  "website": "64b7f0a1c2d3e4f5a6b7c8d9",
  "when": "new-lead-is-identified",
  "then": "send-to-clay",
  "interval": "immediately",
  "actions": {
    "sendToClay": {
      "url": "https://api.clay.com/v3/sources/webhook/your-table-id",
      "whenToPush": "every-time"
    }
  }
}`}
/>

## Use case: Only leads Clay can work with [#use-case-only-leads-clay-can-work-with]

Set `whenToPush` to `only-with-suggested-contacts` so only leads with a person to enrich are sent.
