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

# Authentication

> API keys: how to make one, what it runs as, and when it stops working.

> [!NOTE]
>
> Source: `app/src/lib/api/keys.ts` (the check), `app/src/lib/db/public-api.ts`
> (the lookup), and the `api_keys` table (`packages/db/migrations/0001_baseline.sql`,
> `0024_public_api.sql`).

## Making a key

In IntroLink, **Settings, API, Create key**. Name it after the system that will
use it ("HubSpot workflow"), so you know what a revoke stops. Only workspace
owners and admins make and revoke keys.

The API and webhooks come with the **Individual**, **Team** and **Business**
plans (`app/src/lib/billing/limits.ts`). On the Free trial, every request
answers `403` `plan_required`.

> [!WARNING]
>
> **The key is shown once.** IntroLink stores only its SHA-256. If you lose it,
> revoke it and make another.

## Sending it

```http theme={null}
GET /v1/people?q=heads%20of%20finance
Authorization: Bearer il_live_8f3a…
```

A key is `il_live_` followed by 32 characters. Keep it on your server: it reads
your network as you.

## What a key runs as

The person who created it. Every request reads exactly what that person reads
in IntroLink, through the same visibility rules, minus anyone they keep private
([overview](https://docs.introlink.ai/public-api/overview.md#what-a-key-sees)).

## When it stops

Checked on every request, nothing cached:

| Condition | Answer |
| - | - |
| no `Authorization` header | `401` `unauthorized` |
| unknown or revoked key | `401` `invalid_key` |
| the creator left the workspace, or was deleted | `401` `invalid_key` |
| the workspace is on the Free trial | `403` `plan_required` |

A revoke in Settings takes effect on the very next request.

An `invalid_key` or `plan_required` answer links back to this page, in
`error.docs`.

## What's stored

| Column | Holds |
| - | - |
| `org_id` | the workspace the key belongs to |
| `created_by` | who the key runs as |
| `name` | your label |
| `key_prefix` | the first 11 characters, `il_live_8f…`, so Settings can show it |
| `key_hash` | SHA-256 of the key, unique |
| `last_used_at` | the last answered request |
| `usage_month`, `usage_count` | requests answered this month ("3,140 requests this month") |
| `revoked`, `revoked_at` | revocation |


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