# HTTP API overview

The API is plain HTTP and JSON. Everything the dashboard and the CLI do goes through it, so anything you can do there you can do with `curl`.

Base URL for this server: `https://fuzzyshare.com`.

## Authentication

Send your access key on every request, reads included:

```sh
curl -H "Authorization: Bearer $FUZZY_KEY" https://fuzzyshare.com/me
```

The only calls that do not need it are marked **public** below. A missing or unknown key returns `401`. Create a key with [`POST /register`](#register).

## Endpoints

| Endpoint | What it does |
|---|---|
| `GET /health` | `{"status":"ok"}` (**public**) |
| `GET /config` | Limits and whether a signup code is needed (**public**) |
| `GET /llms.txt` | A plain-text guide for agents (**public**) |
| `GET /llms-full.txt` | All documentation as one Markdown file (**public**) |
| `POST /register` | Create an account (**public**) |
| `GET /me` | Who the key belongs to, usage and limits |
| `POST /me/key` | Replace the key used for this call |
| `PATCH /me` | Edit your `full_name`, `organization` or `purpose` (the email cannot change) |
| `GET /me/settings`, `PUT /me/settings` | Read or save your preferences: `theme`, `default_ttl`, `default_access` |
| `DELETE /me` | Delete your account (send `{"confirm":"<your email>"}`); see below |
| `GET /me/keys`, `POST /me/keys`, `DELETE /me/keys/{id}` | [Named keys](api-keys.md) |
| `PUT`, `GET`, `DELETE /files/{name}`, `GET /files` | [Files](api-files.md) |
| `POST /files/{name}/share`, `GET /links`, `DELETE /links/{id}` | [Links](api-links.md) |
| `GET /links/{id}/activity` | [Link activity](api-links.md#link-activity) |
| `GET /s/{token}`, `/s/{token}/raw`, `/s/{token}/info` | Read a link (**public**, or unlocked for private links) |
| `POST /mcp` | The [MCP server](mcp-connect.md) |
| `GET /admin/users`, `DELETE /admin/users/{id}`, `POST /admin/users/{id}/reactivate` | Operator only |

## Register

`POST /register` creates an account and its first key.

```sh
curl -X POST https://fuzzyshare.com/register \
  -d '{"full_name":"Ada Lovelace","email":"ada@example.com","organization":"Analytical","purpose":"reports"}'
```

| Field | Notes |
|---|---|
| `full_name` | Required, 2 to 100 characters |
| `email` | Required. One account per email |
| `organization`, `purpose` | Optional |
| `key_name` | Optional name for the first key (default `default`) |
| `signup_code` | Required only if the server sets one (`signup_code_required` in `/config`) |

The response is `201`:

```json
{"key":"fuzzy_...","note":"store this key now: it is shown once and cannot be recovered",
 "user":{"id":"a6bd0bd2c16b0460","full_name":"Ada Lovelace","email":"ada@example.com",
         "organization":"Analytical","purpose":"reports","created_at":"...","last_seen":"...","key_hint":"YJ7I"}}
```

The key is shown once. See [Access keys and identity](concepts-keys.md).

**Servers that confirm email addresses.** When the operator has set up email (`email_confirmation` in `/config`), `POST /register` creates nothing and returns `202` with `{"status":"pending","message":"..."}`. The person gets a link by email. Opening it and pressing **Confirm** creates the account and shows the key once. The answer is the same whether or not the address already has an account. A link works once and expires after 24 hours. The page calls `POST /register/confirm` with `{"token":"..."}`, which returns the `201` above, or `410` if the link is used up or expired. Signing in with GitHub or Google needs no confirmation, since the provider has already verified the address. A second registration with the same email returns `409`; registrations are rate limited per IP (`429`).

## Who am I

```sh
curl -H "Authorization: Bearer $FUZZY_KEY" https://fuzzyshare.com/me
```

```json
{"admin":false,
 "key":{"id":"k_2457f6de2af3","name":"default","fingerprint":"sha256:9f40a72b1a603ba8"},
 "limits":{"max_size":52428800,"quota":1073741824,"default_ttl_seconds":86400,
           "max_ttl_seconds":1209600,"allow_public":true,"access_log":"full"},
 "usage":{"files":0,"bytes":0},
 "user":{"id":"...","full_name":"Ada Lovelace","email":"ada@example.com","...":"..."}}
```

## Replace the key in use

`POST /me/key` gives the same key id and name a new secret. The old secret stops working at once.

```json
{"key":"fuzzy_...","info":{"id":"k_...","name":"default","fingerprint":"sha256:..."},
 "note":"the previous key no longer works","user":{"...":"..."}}
```

## Lifetimes

Pass `ttl` as a query parameter or the `X-Fuzzy-TTL` header: seconds (`3600`) or a number with `s m h d w` (`90m`, `24h`, `7d`, `14d`). See [Files and expiry](concepts-files.md).

## Settings and deleting an account

`PUT /me/settings` takes `{"theme":"dark|light|system","default_ttl":"7d","default_access":"private|public"}`. The theme is `dark` until you choose another. They are saved on the account and the dashboard uses them as the pre-selected values for new uploads. Uploads over the API and the CLI still use the `ttl` and visibility you send (or the server defaults).

`DELETE /me` with `{"confirm":"<your email address>"}` is a soft delete. The account record is kept but deactivated: every access key is refused (`401`), every share link is removed, and the files can no longer be reached and are deleted when they expire. The email address stays reserved. An operator can restore the account with `POST /admin/users/{id}/reactivate`; its links do not come back. `DELETE /admin/users/{id}` still removes a user and everything they own for good.

## Header names

The request headers are `X-Fuzzy-TTL`, `X-Fuzzy-Visibility` and `X-Fuzzy-Passphrase`, and file responses carry `X-Fuzzy-Expires`. Before the rename they were called `X-Siso-*`. Those names are still accepted on requests, and responses send both, so existing clients keep working.

## Cross-origin calls

Requests with a foreign `Origin` header to the MCP endpoint are refused; the API is meant for programs, not for other sites' scripts.
