{% extends "base.html" %} {% block title %}Docs ยท dayfile{% endblock %} {% block main %}
Everything you need to write events and read them back. A log lives at https://<name>.dayfile.cloud.
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.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.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.self). The label public lets a public feed show it.backup-script. It is how a write token is limited and how retries are recognized.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.
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.
| Field | Meaning | |
|---|---|---|
specversion | required | "dayfile/1" |
id | required | A ULID you choose. Time-sortable, and can be made offline. |
source | required | {"id", "ref"}. id names the sender; ref is its own identifier, used to make posting idempotent. |
occurred_at | required | When it happened. UTC, YYYY-MM-DDTHH:MM:SSZ. |
title | required | Plain-text headline. |
body | Plain-text detail. | |
visible_at | When it appears in feeds. Defaults to occurred_at; a future time holds it back. | |
expires_at | When it stops appearing in feeds. | |
tags, urgency | Flat strings (fleet/anomaly is just a convention); urgency 0 to 3. The tag todo makes the event a to-do with a status. | |
payload | A 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}]. | |
audience | Labels 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.
These work on /events, /feed.json and /feed.atom:
tag=a&tag=b | Events with all the tags (tag_any= for any). |
status=open | open (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=7d | Became visible in the last N minutes, hours or days (m, h, d). |
limit=N | Page size. Default 50, at most 200. |
since_seq=N | Only 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.
| Request | Token | What it does |
|---|---|---|
POST /events | write | Add one event or a list of events. |
GET /events | read | List events with filters (see above). |
GET /events/{id} | read | One event. |
GET /usage | read | How full your log is: events and bytes used, your limits, and the write rate. |
GET /events/stream | read | Live updates (Server-Sent Events). |
GET /feed.json, /feed.atom | read | The default feed. |
GET /f/NAME.json, .atom | read, or none if public | A named feed. |
GET /t/TOKEN/feed.json and /t/TOKEN/f/NAME.json | in the path | The same feeds, for readers that cannot send headers. |
/mcp | read, and optionally write | The 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.
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.
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.
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}'.
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"])
Store a write token as a repository secret named DAYFILE_WRITE_TOKEN, then add a step:
- 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 %}
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.
Events are never edited. A later event points back at the earlier one through refs:
completes marks it closed. A closing event can leave out title and inherits the original's.supersedes replaces it with a newer version.retracts hides it. Retracting the retraction brings it back.replies-to only threads.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.
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.
GET /events?since_seq=N&wait=30 waits up to 30 seconds for something new and returns an empty page if nothing comes.GET /events/stream sends Server-Sent Events and closes after 300 seconds, so reconnect with Last-Event-ID. A browser's EventSource cannot send an Authorization header; use fetch with a streaming body.cursor and released_cursor from each response and send them back as since_seq and released_after.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.
https://<you>.{{ base_domain }}/mcp and press Connect. You sign in with GitHub and choose whether the assistant may write or only read.claude mcp add --transport http dayfile https://<you>.{{ base_domain }}/mcp, then run /mcp to sign in.Authorization: Bearer <read>~<write>, a read token and a write token joined with a tilde. Leave out the tilde and the write token for read-only access.pip install "dayfile[mcp]" adds the dayfile mcp command, which uses DAYFILE_URL, DAYFILE_READ_TOKEN and DAYFILE_WRITE_TOKEN.Apps you connect by signing in are listed under Tokens, where you can disconnect them at any time.
403 (event quota exceeded or storage quota exceeded); reading and exporting keep working. Events can't be deleted one by one, so when a log is full, download it and use Start a fresh log in Settings, or write to team@dayfile.app for more room.429 with Retry-After, and nothing is written.401 | No token, or one that is unknown, expired or revoked. These look the same on purpose. |
403 | The 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. |
404 | No such log or event. |
409 | The id is already used by a different event. |
422 | The event is not valid. The message says why. |
429 | Over a rate limit. Wait Retry-After seconds. |
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 %}