# Fernscout dev

> A travel journal whose content is JSON documents and photographs in a folder
> the author owns. Reading happens in a browser, where its owner may also
> write directly in their own studio. Otherwise, writing happens through an
> agent holding a token — still no CMS, whether that agent is this
> instance's own assistant, over WhatsApp where it offers one, or one you
> bring yourself.

## Ways in

Whoever you are — a person with no agent, an agent reading this file, or the
model behind a browser tab — start by working out which of these you are. It
decides what you fetch next.

**The owner, in their own studio.** For the journal's own owner, who would
rather write directly than dictate to an agent — sign in and edit at
https://dev.fernscout.ch/<username>/studio: a day, a trip, an invitation,
composed through guided screens rather than a chat. No API key, no token, no
header of your own choosing — a browser session the owner's own cookie opens,
calling the same drafts-then-publish API this document describes underneath.
It cannot skip the owner's own confirmation for anything this document says an
agent cannot finish either — deleting, a real postcard — because the studio is
a different door onto this API, not a way around it.

**Your own agent, against this document and `/api/v2/openapi.json`.** For an
agent that can send an arbitrary HTTP request with a header of its own
choosing — see "Can you write here?" below if you are not sure that is you.
Running that agent on your own machine, against a photo library or a bank
statement already on disk, is one way of doing this rather than a fourth:
https://github.com/severinlindenmann/fernscout-helper.

## Already holding a token?

Call `GET /api/v2/<user>/status` first, before anything else on this page. It
answers in one call where the journal stands: every trip you may write to,
every **draft waiting for a person to see it**, whether your token is
journal-wide or scoped to one trip, and storage and inbox counts. It is also
the cheapest credential check there is: `401` means go and get a code, `200`
means you are in. `GET /api/v2/status` (no `<user>`, no auth) answers for the
instance itself: which capabilities are on, upload limits, and pricing.

**There is no call that looks up the owner's email address for you.** `GET
/api/v2/<user>` echoes it back to a token that already owns the journal,
because it is that journal's own document — but nothing hands it to a token
that does not already have one. If yours has expired, ask the person which
address owns the journal rather than looking for an endpoint that tells you.

## Can you write here?

Check this before you ask anyone for their email address. Writing to this
journal — creating one, a trip, a day, publishing it — is HTTP `POST`, `PUT`
or `PATCH`, sent with an `Authorization: Bearer` header carrying a token. If
your tools only fetch pages, or fetch only a URL a person pasted into this
conversation and never one found inside a fetched page, you cannot make those
calls — no matter how completely the rest of this document is written.

One thing actually does it: a harness or client that can send an arbitrary
HTTP request with a header of its own choosing.

If neither is open to you: say so, plainly, and point the owner at their own
studio, https://dev.fernscout.ch/<username>/studio, instead — a page only
their own browser session can open, no API key required, where they write
directly rather than through you. Their studio has an upload screen; nothing
under `/api/v2` gives *you* an equivalent, and no header of your own choosing
means no way to reach that API either. Do not invent an upload address for the
owner to send a file to — you have none — and do not hand the job back by
telling the owner to follow this guide themselves; send them to their studio
instead.

## The one rule

You are the editor: you write, you publish, you correct. Everything you write
arrives as a **draft** — `status` accepts only `"draft"` on the write itself,
and there is no argument that changes that. Putting a day on the site is a
second call, POST /api/v2/<user>/trips/<trip>/days/<slug>/publish, and it is
the owner's to make once they say so — never a side effect of writing or
correcting a day. Ask, in words, and wait for an answer. "It looks finished"
is not consent, and neither is silence.

Write what you were told. No weather nobody mentioned, no meals nobody ate, no
feelings nobody expressed — an empty field beats a plausible fiction. The one
exception is content nobody lived, written to prove the pipeline works: set
`test: true` on the trip or the day and the site says so itself, in a banner,
and keeps it out of the feed and the search index.

That third question below is about listing, not access. Neither decides who may read a particular journey: that is the trip's own visibility — guest means the people the owner has let into this journal, private means only the people who were there, public means anyone — and it is asked explicitly every time a trip is created, never guessed from the journal's own answer.

A private trip stays shut to approved readers too — approving somebody into the journal does not open it, and the owner has no way to grant it per person. If the plan is to share with family, guest is the trip's own value, and approving the reader is the other half of it.

## Before you call anything, ask

1. Their **email address** — the only credential that can ever get a token for this journal.
2. The **journal's address** (`username`), if they have none yet — permanent, never invented or illustrated.
3. What the **journal is called** (`title`).
4. **Public or guest?** — public is listed on this server's own index and on its landing page; guest is not listed anywhere, and search engines are asked not to index it — anyone sent the address can still open it.
5. Their **name**, and **what the site should call them** — two separate questions, never derived from each other.
6. **Which language** they write in, and **which languages a reader may switch into**.
7. **What they count money in** — permanent, never changeable afterwards.

The full script, with a worked example, is at
https://dev.fernscout.ch/skill/new-account.md. Ask all of it, once, before
your first call.

## Where to look next

- [Getting a code, and creating a journal](https://dev.fernscout.ch/skill/new-account.md)
- [A journal's own settings, and deleting one](https://dev.fernscout.ch/skill/add-journal.md): Change what a journal says about itself, and delete one.
- [A trip: making one, and changing it afterwards](https://dev.fernscout.ch/skill/add-a-trip.md): Create a trip, describe who was on it, and change its own fields afterwards.
- [Writing a day: fields, correcting one, and publishing](https://dev.fernscout.ch/skill/add-a-day.md): Write one day as a draft, correct it, and put it on the site.
- [Photographs and video: attaching them, and the inbox](https://dev.fernscout.ch/skill/ingest-photos.md): Attach photographs and video to a day, or stage them before the days exist.
- [A trip's budget and what it actually cost](https://dev.fernscout.ch/skill/costs.md): A trip's budget, what it actually cost, and the rates that convert it.
- [Real postcards, in the post](https://dev.fernscout.ch/skill/send-postcards.md): Propose a printed postcard from a day — a person still has to send it.
- [Printing a photobook](https://dev.fernscout.ch/skill/make-a-photobook.md): Arrange a trip's photobook draft — size, cover, photographs. Ordering and paying stay the owner's own page.
- [The whole machine contract](https://dev.fernscout.ch/api/v2/openapi.json): every route, field, enum and refusal, generated from the schemas that check them
- [What this instance can do](https://dev.fernscout.ch/api/v2/status): capabilities, limits and pricing — no auth

## Letting other people in

There is no agent bearer door onto an invite any more. Letting somebody read a
journal, or write to one trip as a buddy, happens only from the owner's own
browser, at /<user>/studio/readers.

## Journals

- [Fernscout Demo](https://dev.fernscout.ch/example/documentation.txt): Five journeys, to show what this thing does — 5 public trips (served at the bare domain too)

## If you need help extracting pictures or data

The owner's photographs and receipts are on their own machine, and nothing
here can reach them. Fernscout Helper is a separate, MIT-licensed toolbox of
agent skills that runs there: it exports a date range out of a photo library,
opens a page where the owner picks the pictures that belong and says what
happened, reads a bank statement into per-day costs, and asks about the
flights and the car that no statement shows. What it writes is this project's
own content format, as drafts.

- https://github.com/severinlindenmann/fernscout-helper
- [How to use it](https://dev.fernscout.ch/docs/helper)

It is optional and nothing here depends on it. If the owner opened with the
instruction below, they are at the very beginning — no journal, no trip, and a
laptop full of holiday photographs:

  Führe mich durch das Anlegen meines eigenen Reisetagebuchs, nach der Übersicht unter https://dev.fernscout.ch/documentation.txt. Du brauchst dafür eine E-Mail-Adresse, die mir gehört.
