# API docs

bygga. has one small public API: an endpoint that adds an email address to the waitlist for new guides. It needs no key or account. The machine-readable description is the [OpenAPI spec](https://ikeahelp.com/openapi.json), and the [API catalog](https://ikeahelp.com/.well-known/api-catalog) links to it.

## Join the waitlist

`POST https://ikeahelp.com/api/waitlist`

Send the email as JSON or as a form field. Add `Accept: application/json` to get JSON back. Without it, the endpoint redirects to a thank-you page, so it also works as a plain HTML form.

```bash
curl -X POST https://ikeahelp.com/api/waitlist \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{"email": "you@example.com", "source": "my-agent"}'
```

| Field | Required | Notes |
| --- | --- | --- |
| `email` | Yes | Up to 254 characters. |
| `source` | No | Letters, numbers and dashes, up to 64 characters. Tells us where the signup came from. |

A successful call returns `{"ok": true, "already": false}`. Signing up twice is safe: the second call returns `"already": true`.

## Errors

Errors are JSON with a stable `code`, a readable `error` and a `hint` on how to fix the request:

```json
{ "ok": false, "code": "invalid_email", "error": "That email doesn’t look right.", "hint": "Send a valid address in the `email` field." }
```

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid_email` | The email is missing or malformed. |
| 404 | `not_found` | No endpoint at that path. |
| 405 | `method_not_allowed` | Only `POST` is supported. |
| 500 | `server_error` | Something failed on our side. Safe to retry. |

## Reading guides as Markdown

Every page has a Markdown version. Request it with `Accept: text/markdown`, or add `index.md` to the page URL, for example [the LACK guide](https://ikeahelp.com/guides/lack-side-table/index.md). The [llms.txt](https://ikeahelp.com/llms.txt) file lists every guide.

## Privacy

Emails are used only to announce new guides. See the [privacy page](https://ikeahelp.com/privacy/).
