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

# API Reference

## The Aria Links API

Aria Links has a public API for automations and integrations. This page documents the authentication scheme and every endpoint the Zapier integration calls, with request and response shapes.

Base URL: `https://rqesrbingluxyludjtrh.supabase.co/functions/v1/al-api`

## Authentication

Every request carries an API key as a Bearer token:

```
Authorization: Bearer alk_<64 hex characters>
```

* Keys are scoped to one account: a key only ever sees its owner's links. Reading another account's link returns `404`.
* Only the key's SHA-256 hash is stored server-side; the full key is shown once when it is created.
* Missing, invalid or revoked key returns `401 {"error":"invalid_api_key"}`.
* Errors are JSON: `{"error":"<code>"}` — 400 for a bad request body (for example `placement_name_required`, `destination_url_invalid`, `webhook_url_invalid`, `person_label_required`), 401 for a bad key, 404 for anything that is not yours or does not exist (for example `link_not_found`, `webhook_not_found`).

## Verified clicks only

Every count and list in this API follows one rule: a click counts as real only when it passed verification. Bots, scanners and still-pending clicks are reported separately as `filtered_clicks`, never merged into `real_clicks`, and they never fire a webhook.

## Trigger: New Verified Click (REST hook)

### Subscribe

**POST /webhooks** — subscribe a hook URL.

Request body:

```json theme={null}
{"url": "https://hooks.zapier.com/..."}
```

The URL must be https. Response `201`:

```json theme={null}
{"id": "...", "url": "...", "secret": "...", "active": true, "created_at": "..."}
```

The `secret` is shown once and signs every delivery (see below).

### Unsubscribe

**DELETE /webhooks/:id** — response `{"deleted": true}`. An unknown id, or one that belongs to another account, returns `404 {"error":"webhook_not_found"}`.

### Sample data

**GET /clicks?limit=50** — recent verified clicks across the account's links, newest first, as a bare JSON array (used for sample data and dedupe; `id` is the dedupe key). `limit` caps at 200.

Each item:

```json theme={null}
{
  "id": "a93bf2c2-9eb6-40da-92b6-c7103bdd0456",
  "event": "click.verified",
  "click_id": "a93bf2c2-9eb6-40da-92b6-c7103bdd0456",
  "code": "3N9cRr5",
  "placement_name": "Facebook Profile",
  "clicked_at": "2026-11-16T16:38:17.122292+00:00",
  "verified_at": "2026-11-16T16:39:02.410000+00:00",
  "country": "US",
  "client_ip": "203.0.113.10",
  "person_label": null
}
```

`person_label` is null in this list; it is resolved when a webhook fires.

### Delivery

Within about a minute of a click passing verification, the hook receives:

```http theme={null}
POST <hook url>
Content-Type: application/json
X-AriaLinks-Event: click.verified
X-AriaLinks-Signature: sha256=<hmac hex>
```

```json theme={null}
{
  "event": "click.verified",
  "id": "8bb690d1-0000-4000-8000-000000000000",
  "click_id": "8bb690d1-0000-4000-8000-000000000000",
  "code": "3N9cRr5",
  "placement_name": "Facebook Profile",
  "clicked_at": "2026-11-16T16:38:17.122292+00:00",
  "verified_at": "2026-11-16T16:39:02.410000+00:00",
  "country": "US",
  "person_label": null
}
```

Only verified real clicks fire — bots, scanners and still-pending clicks never do. Delivery is at-least-once; use `click_id` as the idempotency key. The signature is `sha256=` plus the hex HMAC-SHA256 of the exact raw request body, keyed with the webhook `secret`.

## Action: Create Link

**POST /links**

Request body:

```json theme={null}
{"placement_name": "Facebook Profile", "destination_url": "https://example.com/page"}
```

The destination must be a valid http or https URL (a bare domain gets `https://` prepended). Response `201`:

```json theme={null}
{
  "id": "...",
  "code": "3N9cRr5",
  "folder_id": null,
  "archived": false,
  "short_url": "https://justaskaria.com/l/3N9cRr5",
  "placement_name": "Facebook Profile",
  "destination_url": "https://example.com/page",
  "created_at": "...",
  "real_clicks": 0,
  "filtered_clicks": 0,
  "total_clicks": 0
}
```

## Action: Create Recipient Link

**POST /links/:code/recipient-links** — mint a per-person URL for one named person.

Request body:

```json theme={null}
{"person_label": "Jane at Jane's Bakery"}
```

Response `201`:

```json theme={null}
{"slug": "...", "url": "...", "code": "3N9cRr5", "person_label": "Jane at Jane's Bakery", "created_at": "..."}
```

The `url` is the full per-person URL on the API host: `https://rqesrbingluxyludjtrh.supabase.co/functions/v1/al-api/r/<slug>`. Taps on it are logged against that name and redirected through the normal short link, so verified counting works exactly as usual; the verified-click payload then carries that `person_label`.

## Search: Find Link

**GET /links/:code?array=1** — one link wrapped in a one-element array (Zapier searches require an array):

```json theme={null}
[{
  "id": "...",
  "code": "3N9cRr5",
  "folder_id": null,
  "archived": false,
  "short_url": "https://justaskaria.com/l/3N9cRr5",
  "placement_name": "Facebook Profile",
  "destination_url": "https://example.com/page",
  "created_at": "...",
  "real_clicks": 12,
  "filtered_clicks": 3,
  "total_clicks": 15
}]
```

`real_clicks` counts verified clicks only; `filtered_clicks` (bots, scanners, pending) is reported separately, never merged in. An unknown code, or a code owned by another account, returns `404 {"error":"link_not_found"}`.


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