> ## Documentation Index
> Fetch the complete documentation index at: https://relay-demo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Send an event and receive it as a webhook on your machine.

**1. Get a test key**

In the dashboard, open **Developers → API keys** and copy the test key. Test keys start with `rk_test_` and never deliver to production endpoints.

```bash theme={null}
export RELAY_API_KEY=rk_test_...
```

**2. Forward webhooks to localhost**

Install the CLI and start forwarding. It prints a signing secret for this session.

```bash theme={null}
npm install -g relay-cli
relay login
relay listen --forward-to localhost:3000/webhooks
```

**3. Receive the webhook**

A minimal Express handler that verifies the signature and logs the event:

```js server.js theme={null}
import express from "express";
import { Relay } from "relay-sdk";

const relay = new Relay(process.env.RELAY_API_KEY);
const app = express();

app.post("/webhooks", express.raw({ type: "application/json" }), (req, res) => {
  const event = relay.webhooks.verify(
    req.body,
    req.header("Relay-Signature"),
    process.env.RELAY_WEBHOOK_SECRET
  );
  console.log(event.type, event.id);
  res.sendStatus(200);
});

app.listen(3000);
```

**4. Send an event**

```bash theme={null}
curl https://api.relay.example/v1/events \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "invoice.paid", "data": {"invoice_id": "inv_123", "amount": 4900}}'
```

Relay answers `202 Accepted` with the event's `id`, and your server logs `invoice.paid evt_...` a moment later.

## Next steps

* Add a real endpoint and subscribe it to event types in [Send events](https://relay-demo.mintlify.site/sending-events.md).
* Read [Verify signatures](https://relay-demo.mintlify.site/webhooks/signatures.md) before you go live.


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