# Quickstart

Source: https://solidhooks.com/docs/quickstart

> Create a source, a destination and a connection, then send a test webhook and watch it get delivered.

By the end of this page you will have sent one webhook through SolidHooks and seen it arrive at an endpoint you control.

```text
curl → source (ingest URL) → connection → destination (your endpoint)
```

## Prerequisites

* A SolidHooks account. Sign up at [dash.solidhooks.com](https://dash.solidhooks.com).
* An API key. Create one in the dashboard at [Organization → API Keys](https://dash.solidhooks.com/organization/api-keys). The `sdhk_sk_...` value is shown once, so copy it when it appears.
* An endpoint that can receive an HTTP `POST` and that you can inspect. For a first test, any request-catcher URL you control works. It must be publicly reachable.

Set two variables for the commands below:

```bash
export API=https://api.solidhooks.com
export SDHK_KEY=sdhk_sk_...
```

A new account starts with a project called "Default Project". Requests without an `X-Project-Id` header use it, so you need no other setup. See [Projects](https://solidhooks.com/docs/projects).

### Create a source

A source is the inbound endpoint. Each source gets an ingest URL that your webhook provider posts to.

**API**

```bash
curl -s "$API/v1/sources" \
  -H "authorization: Bearer $SDHK_KEY" \
  -H 'content-type: application/json' \
  -d '{ "name": "Quickstart", "provider": "generic", "verifierConfig": {} }'
```

The response includes the source `id` (`src_...`) and its `ingestUrl`, which looks like `https://sdhk.events/<maskId>`.

**Dashboard**

1. Open **Sources** and click **New Source**.
2. Pick a provider and finish the wizard.
3. Copy the ingest URL from the source page.

An empty `verifierConfig` means the source accepts every request without checking a signature. That suits a first test. Add verification before you point a real provider at it; see [Verification](https://solidhooks.com/docs/verification).

### Create a destination

A destination is where SolidHooks delivers events. Use the URL of your endpoint.

**API**

```bash
curl -s "$API/v1/destinations" \
  -H "authorization: Bearer $SDHK_KEY" \
  -H 'content-type: application/json' \
  -d '{
    "name": "Quickstart endpoint",
    "type": "http",
    "url": "https://your-endpoint.example.com/webhooks",
    "method": "POST"
  }'
```

Note the destination `id` (`dest_...`).

**Dashboard**

1. Open **Destinations** and click **New Destination**.
2. Enter a name and the URL of your endpoint, then click **Create destination**.

### Connect them

A connection routes a source to a destination. Without one, events are stored but not delivered.

**API**

```bash
curl -s "$API/v1/connections" \
  -H "authorization: Bearer $SDHK_KEY" \
  -H 'content-type: application/json' \
  -d '{
    "name": "Quickstart → endpoint",
    "sourceId": "src_...",
    "destinationId": "dest_..."
  }'
```

Leaving out `filterRules.eventTypes` forwards every event.

**Dashboard**

1. Open the source and go to its connections.
2. Click **New Connection**, choose the destination and click **Create connection**.

### Send a test webhook

Post anything to the ingest URL. The body is accepted as sent, with any content type.

```bash
curl -s -X POST "https://sdhk.events/<maskId>" \
  -H 'content-type: application/json' \
  -d '{ "type": "test.ping", "hello": "world" }'
```

A successful request returns:

```json
{"ok":true,"eventId":"evt_..."}
```

Your endpoint should receive the request shortly after.

### Confirm the event and the delivery

```bash
curl -s "$API/v1/events?limit=5" -H "authorization: Bearer $SDHK_KEY"
curl -s "$API/v1/deliveries?limit=5" -H "authorization: Bearer $SDHK_KEY"
```

Both return `{ "items": [...], "nextCursor": ..., "hasMore": ... }`. The event has `status: "received"`, meaning it matched at least one connection. The delivery shows its own `status`, which is `success` once your endpoint answered with a `2xx`.

To narrow the lists, filter events by `sourceId`, `status`, `from` and `to`. Filter deliveries by `eventId`, `sourceId`, `destinationId`, `connectionId`, `status`, `from` and `to`. In the dashboard, the same records are under **Events** and **Deliveries**.

> **Nothing arrived?**
>
> If the delivery is `pending` or `failed`, SolidHooks retries it automatically. See [Retries](https://solidhooks.com/docs/retries). If the event has `status: "unmatched"`, the source has no active connection.

## What you set up

* A **source** that gives your provider an ingest URL.
* A **destination** that points at your endpoint.
* A **connection** that routes every event from the source to the destination.
* One stored **event** and one **delivery** you can inspect through the API.

## Next steps

* [How SolidHooks works](https://solidhooks.com/docs/how-it-works) — the pipeline and how the objects relate
* [Sources](https://solidhooks.com/docs/sources) — providers and verification
* [Destinations](https://solidhooks.com/docs/destinations) — headers, signing and rate limits
* [Connections](https://solidhooks.com/docs/connections) — filter by event type
* [Retries](https://solidhooks.com/docs/retries) — what happens when delivery fails