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

# Instantly Webhook

> Log email sequence events from Instantly.ai on contact timelines.

## Endpoint

Your webhook URL is shown in **Settings → Integrations → Webhooks → Instantly**. It looks like:

```
POST https://api.yourdomain.com/inbound/instantly/<your-workspace-id>
```

Copy it directly from the UI — your workspace ID is already embedded.

## Auth

Set `INSTANTLY_WEBHOOK_SECRET` in `nous.env`. Nous validates the `x-nous-signature` header on every inbound request.

## Setup in Instantly

1. In Instantly, go to **Settings → Integrations → Webhooks**.
2. Click **Add Webhook** and paste your URL from Nous.
3. Select the events you want (see table below).

## Supported events

| Instantly event  | Activity logged  | Creates contact? |
| ---------------- | ---------------- | ---------------- |
| `reply_received` | `email_received` | Yes              |
| `email_replied`  | `email_received` | Yes              |
| `email_sent`     | `email_sent`     | No               |
| `email_opened`   | `email_opened`   | No               |
| `email_bounced`  | `email_bounced`  | No               |
| `unsubscribed`   | `email_bounced`  | No               |

Replies create a new contact if one doesn't exist yet — a reply to a cold email is a strong intent signal. All other events are update-only.

## Payload

Nous reads these fields from the Instantly payload:

```json theme={null}
{
  "event_type": "reply_received",
  "lead_email": "prospect@company.com",
  "lead_first_name": "Jane",
  "lead_last_name": "Smith",
  "campaign_id": "camp_123",
  "campaign_name": "Q2 Outreach",
  "preview_text": "Thanks for reaching out...",
  "message_id": "msg_abc123"
}
```

## Deduplication

Events are deduplicated by `message_id`. If Instantly retries a delivery, the duplicate is silently dropped.
