{% extends "base.html" %} {% block title %}Docs ยท dayfile{% endblock %} {% block main %}

Docs

Everything you need to write events and read them back. A log lives at https://<name>.dayfile.cloud.

{% include "_diagram.html" %}
The service is in beta, so details may change. A log has a write token (can only post) and a read token (can only read).

The ideas

Log
Your one append-only record of everything that happened, at NAME.dayfile.cloud. NAME is your username, so the username, the log and its address are the same thing. You get one log. Nothing in it is edited or deleted.
Event
One entry in the log: a title, plus optional detail, tags and times. "Backup finished" is an event.
Tag
A free label you attach to group events, such as launch or health. An event can have many tags, and you can filter by them. One tag is special: todo. An event tagged todo is a to-do: it starts open and gets a Close button. Every other event has no status.
Feed
A saved filtered view of the log, for example "all events tagged work". Feeds hold no data of their own: the log is the single source of truth and a feed is a window onto it. Your log has a default feed, and you can add named ones at /f/NAME. Reading a feed in a browser, an RSS or Atom feed reader or code gives the same events.
Live updates
Staying connected so new events reach you as they arrive, instead of asking again (see Staying up to date). Any feed or the whole log can be followed this way.
Token
A password for one job. A write token can only add events, and can be limited to named sources. A read token can only read, limited by audience labels. Make one per script or device so you can revoke it alone.
Audience
A label on an event that decides who may read it. With none, only you can (self). The label public lets a public feed show it.
Source
Who sent an event, for example backup-script. It is how a write token is limited and how retries are recognized.

Quick start

Post an event

curl -X POST https://NAME.dayfile.cloud/events \
  -H "Authorization: Bearer WRITE_TOKEN" \
  -H "content-type: application/json" \
  -d '{"title":"Hello"}'

It answers 201 with the stored event. Only title is required. dayfile fills in the id, the time, and the source when your write token has exactly one. Each quick post is a new event. To make retries safe, send the full form with a source.id and ref (see Events): posting the same pair again returns the existing event with 200.

Read it back

curl -H "Authorization: Bearer READ_TOKEN" https://NAME.dayfile.cloud/events

For an RSS reader (any feed reader that understands Atom or JSON Feed) that cannot send headers, use the token in the path:

https://NAME.dayfile.cloud/t/READ_TOKEN/feed.json
https://NAME.dayfile.cloud/t/READ_TOKEN/feed.atom

Anyone holding that URL can read the log. Treat it like a password.

Events

FieldMeaning
specversionrequired"dayfile/1"
idrequiredA ULID you choose. Time-sortable, and can be made offline.
sourcerequired{"id", "ref"}. id names the sender; ref is its own identifier, used to make posting idempotent.
occurred_atrequiredWhen it happened. UTC, YYYY-MM-DDTHH:MM:SSZ.
titlerequiredPlain-text headline.
bodyPlain-text detail.
visible_atWhen it appears in feeds. Defaults to occurred_at; a future time holds it back.
expires_atWhen it stops appearing in feeds.
tags, urgencyFlat strings (fleet/anomaly is just a convention); urgency 0 to 3. The tag todo makes the event a to-do with a status.
payloadA JSON object of your own data. dayfile stores it and passes it along but does not check its shape; agree the shape with whatever reads it.
refs, links[{rel, id}] and [{rel, href}].
audienceLabels that decide who may read it. Missing means ["self"].

The server adds seq (the event's position in the log) and recorded_at. You can post one event or a JSON array of them; if any event is malformed, none is written.

Reading with filters

These work on /events, /feed.json and /feed.atom:

tag=a&tag=bEvents with all the tags (tag_any= for any).
status=openopen (a todo not yet closed), closed, superseded, retracted or none (an ordinary event with no status). The default shows open, closed and none (not retracted or replaced).
within=7dBecame visible in the last N minutes, hours or days (m, h, d).
limit=NPage size. Default 50, at most 200.
since_seq=NOnly events after position N. Page with this, never with timestamps.

GET /events/{id} returns one event. /events returns {"events": [...], "cursor": N, "released_cursor": T, "next": url or null}, oldest first.

Endpoints at a glance

RequestTokenWhat it does
POST /eventswriteAdd one event or a list of events.
GET /eventsreadList events with filters (see above).
GET /events/{id}readOne event.
GET /usagereadHow full your log is: events and bytes used, your limits, and the write rate.
GET /events/streamreadLive updates (Server-Sent Events).
GET /feed.json, /feed.atomreadThe default feed.
GET /f/NAME.json, .atomread, or none if publicA named feed.
GET /t/TOKEN/feed.json and /t/TOKEN/f/NAME.jsonin the pathThe same feeds, for readers that cannot send headers.
/mcpread, and optionally writeThe assistant connection, described below.

Make tokens under Tokens in the web app (choose read or write, a source name for write tokens, and an expiry; the secret is shown once) and named feeds under Feeds.

Feeds, private and public

Your log has a default feed at /feed.json (or .atom) and you can add named feeds, each a saved filter:

https://NAME.dayfile.cloud/f/work.json
https://NAME.dayfile.cloud/f/work.atom
https://NAME.dayfile.cloud/t/READ_TOKEN/f/work.json   (token in the path, for feed readers)

A feed without a suffix (/f/work) answers with JSON Feed. A named feed's filter is fixed: the URL accepts only paging (limit, since_seq).

A feed is private by default and needs a read token. Make it public and anyone can read it with no token, read only. A public feed shows only events that match its filter and carry the audience label public ("audience": ["public"]), so nothing is exposed unless you marked it. Posting still needs a write token. Turning a feed private stops it at once, though copies other people already made may remain.

Know when something goes quiet

A job that fails loudly is easy to notice. One that silently stops running is not. A heartbeat says how often a source (the name on a write token) or a tag should appear in your log, for example "backup-script every 24h". Set them under Feeds, Heartbeats.

When nothing arrives for the interval plus a short grace period, dayfile adds an ordinary event to your log: a to-do tagged todo and heartbeat, urgency 2, titled like "nightly-backup: nothing from backup-script in 1 day". When the source reports again, dayfile closes that to-do itself. Because it is a normal open to-do, you see it in the Log, in a feed (for example one filtered on the tag heartbeat with status open) and through an assistant connected over MCP, which can ask for open events tagged heartbeat. Checks run every minute.

Recipes

Cron or any shell script

0 3 * * * backup.sh && \
  curl -fsS -X POST https://NAME.dayfile.cloud/events \
    -H "Authorization: Bearer $DAYFILE_WRITE_TOKEN" -H "content-type: application/json" \
    -d '{"title":"Nightly backup finished","tags":["backup"]}'

To record failures too, post a second event on the other branch: || curl ... -d '{"title":"Nightly backup FAILED","tags":["backup","alert"],"urgency":2}'.

Python

import json, os, urllib.request

def log(title, **fields):
    req = urllib.request.Request(
        "https://NAME.dayfile.cloud/events",
        json.dumps({"title": title, **fields}).encode(),
        {"Authorization": "Bearer " + os.environ["DAYFILE_WRITE_TOKEN"],
         "content-type": "application/json"},
    )
    return json.load(urllib.request.urlopen(req, timeout=10))

log("Deployed v1.8", tags=["deploy"])

GitHub Actions

Store a write token as a repository secret named DAYFILE_WRITE_TOKEN, then add a step:

{% raw %}
- name: Tell dayfile
  if: always()
  run: |
    curl -fsS -X POST https://NAME.dayfile.cloud/events \
      -H "Authorization: Bearer ${{ secrets.DAYFILE_WRITE_TOKEN }}" \
      -H "content-type: application/json" \
      -d "{\"title\":\"${{ github.workflow }} ${{ job.status }}\",\"tags\":[\"ci\"]}"
{% endraw %}

n8n, Zapier and other automation tools

Use an HTTP Request step: method POST, URL https://NAME.dayfile.cloud/events, a header Authorization: Bearer WRITE_TOKEN, and a JSON body such as {"title": "New order", "tags": ["shop"]}. Any tool that can send a webhook with a header can post.

Put the token in the tool's secret store, not in the workflow text. Give each job its own write token and source name so you can tell them apart and revoke one without touching the rest.

Changing your mind

Events are never edited. A later event points back at the earlier one through refs:

A reference only takes effect when the event carrying it comes from the same source as its target, or the two share an audience label.

If you posted a secret

Retracting hides an event from the normal views, but it stays in the log and in exports. So first revoke or rotate the secret itself (the password, key or token that was posted); treat it as exposed. Then, if you want it gone from dayfile, use Start a fresh log in Settings, which erases the whole log. Download it first if you want to keep the rest.

Staying up to date

Connect an AI assistant (MCP)

Your log speaks MCP (the Model Context Protocol), so assistants such as Claude can list your events, add one, close a to-do and retract a mistake.

Apps you connect by signing in are listed under Tokens, where you can disconnect them at any time.

Limits

Errors

401No token, or one that is unknown, expired or revoked. These look the same on purpose.
403The token is real but not allowed to do that: a read token posting, a write token reading, a source it may not use, a suspended log, or a log over its event or storage limit.
404No such log or event.
409The id is already used by a different event.
422The event is not valid. The message says why.
429Over a rate limit. Wait Retry-After seconds.

Keeping tokens safe

Only a hash of each token is stored, so a lost token cannot be shown again; ask for a new one. The sign-in page on this site keeps your read token in a cookie that scripts cannot read and never prints it into a page.

{% endblock %}