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

# Quickstart

> Make your first Darwin API call in five minutes: create a key, check it with GET /me, read the leads your chat captured, and get a signed webhook when a meeting is booked. curl, TypeScript and Python.

From a new key to your first webhook in four steps. You need a Darwin workspace on any plan, Free included, and to be its owner or admin.

**1. Create a key**

In Darwin, open **Integrations → API** and select **Create key**. Name it after where it will run, choose **Read only** for now, and copy it: Darwin shows it once.

```bash theme={null}
export DARWIN_API_KEY="dk_live_..."
```

Keys, prefixes and every scope: [Authentication](https://docs.meetdarwin.ai/api-reference/authentication.md).

**2. Check the key**

`GET /me` needs no scope and says which workspace and scopes the key has.

```bash curl theme={null}
curl https://api.meetdarwin.ai/v1/me \
  -H "Authorization: Bearer $DARWIN_API_KEY"
```

```ts TypeScript theme={null}
import { Darwin } from "@meetdarwin/api"; // npm install @meetdarwin/api

const darwin = new Darwin(); // reads DARWIN_API_KEY
console.log(await darwin.me());
```

```python Python theme={null}
import os, requests

res = requests.get(
    "https://api.meetdarwin.ai/v1/me",
    headers={"Authorization": f"Bearer {os.environ['DARWIN_API_KEY']}"},
)
print(res.status_code, res.json())
```

**It worked if** you get `200` with `"object": "api_key_identity"`, the key's `scopes` and your `workspace`.

**3. Read the leads your chat captured**

List conversations where the visitor left their details. Names and emails need `contacts:read`, which **Read only** includes.

```bash curl theme={null}
curl "https://api.meetdarwin.ai/v1/conversations?has_lead=true&limit=5" \
  -H "Authorization: Bearer $DARWIN_API_KEY"
```

```ts TypeScript theme={null}
for await (const conversation of darwin.conversations.list({ has_lead: true })) {
  console.log(conversation.lead.email, conversation.outcome, conversation.page_path);
}
```

Lists share one shape, `{ "object": "list", "data", "has_more", "next_cursor" }`. See [Pagination](https://docs.meetdarwin.ai/api-reference/pagination.md).

**4. Get a webhook when a meeting is booked**

Create a key with `webhooks:write` (or use **Full access**), then point Darwin at an HTTPS address of yours:

```bash curl theme={null}
curl https://api.meetdarwin.ai/v1/webhook_endpoints \
  -H "Authorization: Bearer $DARWIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/webhooks/darwin", "events": ["meeting.booked", "lead.captured"] }'
```

```ts TypeScript theme={null}
const endpoint = await darwin.webhookEndpoints.create({
  url: "https://example.com/webhooks/darwin",
  events: ["meeting.booked", "lead.captured"],
});
console.log(endpoint.secret); // whsec_… shown only now; store it
```

Store the `secret` from the response, [verify every delivery](https://docs.meetdarwin.ai/api-reference/webhooks/verify.md) with it, and send a test with `POST /v1/webhook_endpoints/{id}/test`. **It worked if** the test response shows your endpoint answered `2xx`.

## Next

> **[REST API](https://docs.meetdarwin.ai/api-reference/introduction.md)**
>
> Base URL, requests, request ids and versioning.

> **[Webhooks](https://docs.meetdarwin.ai/api-reference/webhooks.md)**
>
> Events, payloads, signatures and retries.

> **[TypeScript SDK](https://docs.meetdarwin.ai/sdks/typescript.md)**
>
> Typed calls with retries and pagination built in.

> **[Guides](https://docs.meetdarwin.ai/api-reference/recipes.md)**
>
> Slack alerts, CRM sync, a nightly warehouse export and more.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.