# yeet.md API

Two endpoints. Plain JSON over HTTPS. No keys, no accounts.

## Publish a snapshot

POST your Markdown to `/api/share`. Get back the snapshot id, public URL, and a delete token. Save the delete token somewhere safe if you ever want to unpublish — it is the only way.

```
POST https://yeet.md/api/share
Content-Type: application/json

{"content": "# Hello\n\nFrom curl."}
```

Response:

```json
{
  "id": "abc123",
  "url": "https://yeet.md/s/abc123",
  "deleteToken": "long-opaque-string"
}
```

### Curl examples

Inline string:

```bash
curl -X POST https://yeet.md/api/share \
  -H "Content-Type: application/json" \
  -d '{"content":"# Hello\n\nFrom curl."}'
```

From a file (needs [jq](https://jqlang.github.io/jq/) for safe JSON encoding):

```bash
jq -Rs '{content: .}' < notes.md \
  | curl -X POST https://yeet.md/api/share \
      -H "Content-Type: application/json" -d @-
```

Print just the URL:

```bash
curl -s -X POST https://yeet.md/api/share \
  -H "Content-Type: application/json" \
  -d "$(jq -Rs '{content: .}' < notes.md)" \
  | jq -r .url
```

## Delete a snapshot

Send a DELETE to `/api/delete/<id>` with the delete token from the publish response as a bearer token. The link stops working immediately.

```
DELETE https://yeet.md/api/delete/abc123
Authorization: Bearer <deleteToken>
```

Curl:

```bash
curl -X DELETE https://yeet.md/api/delete/abc123 \
  -H "Authorization: Bearer YOUR_DELETE_TOKEN"
```

## Limits

- Content length: 3 characters minimum, 500 KB maximum
- Rate limit: 100 publishes per IP per hour
- HTTPS only. Plain HTTP requests are rejected
- Snapshots are immutable. To update content, publish a new snapshot and (optionally) delete the old one

## Status codes

- `200` — success
- `400` — missing or invalid `content` field
- `401` — wrong delete token
- `404` — snapshot id not found
- `413` — payload too large (over 500 KB)
- `429` — rate limit hit (publish only)

## OpenAPI

Machine-readable spec: <https://yeet.md/openapi.yaml>
Plugin discovery card: <https://yeet.md/.well-known/ai-plugin.json>

## Acceptable use

Same as the [privacy policy and terms](https://yeet.md/privacy): don't publish illegal, harmful, infringing, or harassing content. Don't use the API to bulk-spam snapshots. The rate limit is generous for human use; if you need higher throughput, get in touch first.
