Sheet H1 · Reference

Operations

All 79 operations your plugin can call.

Operations are how your plugin reads and changes the writer’s projects. Each one takes a JSON object and returns one, and your plugin calls them through the host functions (every kit has a wrapper for this).

Your plugin can only call the operations its manifest asks for under [permissions], and the writer sees that list before installing it. You can ask for operations by name, or for a whole group at once: for example, content:read covers every operation that reads a project. Destructive operations, the ones that delete things, are never included in a group; you have to name each one.

The Kotlin and Rust kits have a typed function for each operation, shown under its description: see Hammer and hammer::ops. An … stands for the optional inputs, which Kotlin takes as named parameters and Rust in an options struct. In C, call an operation by name with hammer_call.

Your plugin can call ops.list to see which operations it’s allowed to use. It needs permission for that too, which content:read includes.

In the tables below, an input field marked optional can be left out. Outputs always include every field.

account

account.status

read account:read

The sync server and account this install uses, and optionally whether the server still accepts it.

Kotlin
Hammer.account.status(…)
Rust
ops::account::status(AccountStatusOptions { … })
Input
FieldTypeMeaning
check optionalbooleanAsk the server whether the stored token is still good; needs the network.
Output
FieldTypeMeaning
serverstring or null
sslboolean or null
emailstring or null
loggedInboolean
tokenValidboolean or nullNull unless checked.

backup

backup.create

write content:write

Back up a project's saved files.

Kotlin
Hammer.backup.create(project)
Rust
ops::backup::create(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
datestring

backup.list

read content:read

A project's backups, oldest first.

Kotlin
Hammer.backup.list(project)
Rust
ops::backup::list(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
backupslist of objects
backups[].datestring

draft

draft.apply

prose content:prose

Replace a scene's text with one of its drafts, saving the replaced text as a draft first.

Kotlin
Hammer.draft.apply(project, id)
Rust
ops::draft::apply(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
sceneIdinteger
previousDraftIdinteger or nullThe draft holding the text it replaced; null when the text was unchanged.
wordCountinteger

draft.create

write content:write

Save a scene's current text as a named draft.

Kotlin
Hammer.draft.create(project, sceneId, name)
Rust
ops::draft::create(project, scene_id, name)
Input
FieldTypeMeaning
projectstring
sceneIdinteger
namestring
Output
FieldTypeMeaning
idinteger
namestring
createdstring

draft.delete

destructive content:by name

Delete a draft for good.

Kotlin
Hammer.draft.delete(project, id)
Rust
ops::draft::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
createdstring

draft.list

read content:read

A scene's saved drafts, oldest first.

Kotlin
Hammer.draft.list(project, sceneId)
Rust
ops::draft::list(project, scene_id)
Input
FieldTypeMeaning
projectstring
sceneIdinteger
Output
FieldTypeMeaning
draftslist of objects
drafts[].idinteger
drafts[].namestring
drafts[].createdstring

draft.read

read content:read

A draft's markdown.

Kotlin
Hammer.draft.read(project, id)
Rust
ops::draft::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
sceneIdinteger
namestring
createdstring
markdownstring

entry

entry.create

write content:write

Add an encyclopedia entry to a project.

Kotlin
Hammer.entry.create(project, name, type, text, …)
Rust
ops::entry::create(project, name, r#type, text, EntryCreateOptions { … })
Input
FieldTypeMeaning
projectstring
namestring
typeone of "person", "place", "thing", "event", "idea"
textstring
tags optionallist of strings
aliases optionallist of stringsOther names the entry goes by, matched in scenes like its name.
Output
FieldTypeMeaning
idinteger
namestring
typeone of "person", "place", "thing", "event", "idea"
textstring
tagslist of strings
aliaseslist of strings
hasImageboolean
images optionallist of integersImage ids in order, primary first. An id can name an image no longer in the project.
referencedBylist of integersScene ids whose references to this entry have been confirmed.

entry.delete

destructive content:by name

Delete an encyclopedia entry for good. Its images stay in the project.

Kotlin
Hammer.entry.delete(project, id)
Rust
ops::entry::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
typeone of "person", "place", "thing", "event", "idea"
aliases optionallist of stringsOther names the entry goes by.

entry.images.add

write content:write

Add an image already in the project to the end of an encyclopedia entry's images.

Kotlin
Hammer.entry.images.add(project, id, imageId)
Rust
ops::entry::images::add(project, id, image_id)
Input
FieldTypeMeaning
projectstring
idintegerThe entry.
imageIdinteger
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].

entry.images.import

write content:write

Add a new image to the project, named after an encyclopedia entry, and to the end of the entry's images. The extension is jpg, jpeg, png, webp, or svg, and must match the image.

Kotlin
Hammer.entry.images.`import`(project, id, extension, content)
Rust
ops::entry::images::import(project, id, extension, content)
Input
FieldTypeMeaning
projectstring
idintegerThe entry.
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
contentbase64 string
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].

entry.images.list

read content:read

The images an encyclopedia entry shows, primary first.

Kotlin
Hammer.entry.images.list(project, id)
Rust
ops::entry::images::list(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].

entry.images.primary

write content:write

Make one of an encyclopedia entry's images its primary image, moving it first.

Kotlin
Hammer.entry.images.primary(project, id, imageId)
Rust
ops::entry::images::primary(project, id, image_id)
Input
FieldTypeMeaning
projectstring
idintegerThe entry.
imageIdinteger
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].

entry.images.remove

write content:write

Take an image off an encyclopedia entry. The image stays in the project.

Kotlin
Hammer.entry.images.remove(project, id, imageId)
Rust
ops::entry::images::remove(project, id, image_id)
Input
FieldTypeMeaning
projectstring
idintegerThe entry.
imageIdinteger
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].

entry.list

read content:read

A project's encyclopedia entries, with their aliases, optionally only one type or those with a tag.

Kotlin
Hammer.entry.list(project, …)
Rust
ops::entry::list(project, EntryListOptions { … })
Input
FieldTypeMeaning
projectstring
type optionalone of "person", "place", "thing", "event", "idea" or null
tag optionalstring or null
Output
FieldTypeMeaning
entrieslist of objects
entries[].idinteger
entries[].namestring
entries[].typeone of "person", "place", "thing", "event", "idea"
entries[].aliases optionallist of stringsOther names the entry goes by.

entry.read

read content:read

An encyclopedia entry, with the scenes confirmed to reference it.

Kotlin
Hammer.entry.read(project, id)
Rust
ops::entry::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
typeone of "person", "place", "thing", "event", "idea"
textstring
tagslist of strings
aliaseslist of strings
hasImageboolean
images optionallist of integersImage ids in order, primary first. An id can name an image no longer in the project.
referencedBylist of integersScene ids whose references to this entry have been confirmed.

entry.update

write content:write

Replace an encyclopedia entry's text, and its name, tags, or aliases when given.

Kotlin
Hammer.entry.update(project, id, text, …)
Rust
ops::entry::update(project, id, text, EntryUpdateOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
textstring
name optionalstring or null
tags optionallist of strings or null
aliases optionallist of strings or null
Output
FieldTypeMeaning
idinteger
namestring
typeone of "person", "place", "thing", "event", "idea"
textstring
tagslist of strings
aliaseslist of strings
hasImageboolean
images optionallist of integersImage ids in order, primary first. An id can name an image no longer in the project.
referencedBylist of integersScene ids whose references to this entry have been confirmed.

export

export.formats

read content:read

The formats project.export can produce.

Kotlin
Hammer.export.formats()
Rust
ops::export::formats()
Input

Takes no input: pass {}.

Output
FieldTypeMeaning
formatslist of objects
formats[].idstring
formats[].fileExtensionstring
formats[].mimeTypestring

idea

idea.archive

write content:write

Archive a story idea.

Kotlin
Hammer.idea.archive(id)
Rust
ops::idea::archive(id)
Input
FieldTypeMeaning
idstring
Output
FieldTypeMeaning
idstring
titlestring or null
contentstring
tagslist of strings
createdstring
updatedstring
promotedstring or null
archivedstring or null

idea.create

write content:write

Add a story idea.

Kotlin
Hammer.idea.create(content, …)
Rust
ops::idea::create(content, IdeaCreateOptions { … })
Input
FieldTypeMeaning
contentstring
title optionalstring or null
tags optionallist of strings
Output
FieldTypeMeaning
idstring
titlestring or null
contentstring
tagslist of strings
createdstring
updatedstring
promotedstring or null
archivedstring or null

idea.delete

destructive content:by name

Delete a story idea for good.

Kotlin
Hammer.idea.delete(id)
Rust
ops::idea::delete(id)
Input
FieldTypeMeaning
idstring
Output
FieldTypeMeaning
idstring
titlestring or null
contentstring
tagslist of strings
createdstring
updatedstring
promotedstring or null
archivedstring or null

idea.list

read content:read

Story ideas, which belong to the account rather than a project.

Kotlin
Hammer.idea.list(…)
Rust
ops::idea::list(IdeaListOptions { … })
Input
FieldTypeMeaning
archived optionalboolean or nullTrue for only archived ideas, false for only active ones; omitted for both.
Output
FieldTypeMeaning
ideaslist of objects
ideas[].idstring
ideas[].titlestring or null
ideas[].contentstring
ideas[].tagslist of strings
ideas[].createdstring
ideas[].updatedstring
ideas[].promotedstring or null
ideas[].archivedstring or null

idea.unarchive

write content:write

Return an archived story idea to the active ones.

Kotlin
Hammer.idea.unarchive(id)
Rust
ops::idea::unarchive(id)
Input
FieldTypeMeaning
idstring
Output
FieldTypeMeaning
idstring
titlestring or null
contentstring
tagslist of strings
createdstring
updatedstring
promotedstring or null
archivedstring or null

idea.update

write content:write

Replace a story idea's text, and its title or tags when given. An empty title clears it.

Kotlin
Hammer.idea.update(id, content, …)
Rust
ops::idea::update(id, content, IdeaUpdateOptions { … })
Input
FieldTypeMeaning
idstring
contentstring
title optionalstring or nullLeft out, unchanged; empty, cleared.
tags optionallist of strings or null
Output
FieldTypeMeaning
idstring
titlestring or null
contentstring
tagslist of strings
createdstring
updatedstring
promotedstring or null
archivedstring or null

image

image.add

write content:write

Add an image to a project. The extension is jpg, jpeg, png, webp, or svg, and must match the image.

Kotlin
Hammer.image.add(project, name, extension, content)
Rust
ops::image::add(project, name, extension, content)
Input
FieldTypeMeaning
projectstring
namestring
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
contentbase64 string
Output
FieldTypeMeaning
idinteger
namestring
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
inUsebooleanWhether an entry or a text in the project uses the image.

image.delete

destructive content:by name

Delete an image for good, first taking it out of every entry and text that uses it, and the project cover.

Kotlin
Hammer.image.delete(project, id)
Rust
ops::image::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
extensionstring
removedFromlist of objectsEverything the image was taken out of before it was deleted.
removedFrom[].kindone of "scene", "note", "timeline", "entry", "draft", "image", "cover"
removedFrom[].id optionalinteger or nullNull for [ImageUserKind.Cover], which is not an entity.

image.get

read content:read

One image's name, extension, and bytes.

Kotlin
Hammer.image.get(project, id)
Rust
ops::image::get(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
extensionstring
contentbase64 string

image.list

read content:read

A project's images, with whether anything in the project uses each one.

Kotlin
Hammer.image.list(project)
Rust
ops::image::list(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
imageslist of objects
images[].idinteger
images[].namestring
images[].extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
images[].inUsebooleanWhether an entry or a text in the project uses the image.

image.rename

write content:write

Rename an image.

Kotlin
Hammer.image.rename(project, id, name)
Rust
ops::image::rename(project, id, name)
Input
FieldTypeMeaning
projectstring
idinteger
namestring
Output
FieldTypeMeaning
idinteger
namestring
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
inUsebooleanWhether an entry or a text in the project uses the image.

image.replace

write content:write

Replace an image's bytes, keeping its id, so everything that uses it shows the new image. The extension is jpg, jpeg, png, webp, or svg, and must match the image.

Kotlin
Hammer.image.replace(project, id, extension, content)
Rust
ops::image::replace(project, id, extension, content)
Input
FieldTypeMeaning
projectstring
idinteger
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS]; it may differ from the image's current one.
contentbase64 string
Output
FieldTypeMeaning
idinteger
namestring
extensionstringOne of [ImageFormat.ALLOWED_EXTENSIONS].
inUsebooleanWhether an entry or a text in the project uses the image.

note

note.create

write content:write

Add a note to a project.

Kotlin
Hammer.note.create(project, content, …)
Rust
ops::note::create(project, content, NoteCreateOptions { … })
Input
FieldTypeMeaning
projectstring
contentstring
tags optionallist of strings
Output
FieldTypeMeaning
idinteger
createdstring
tagslist of strings
contentstring

note.delete

destructive content:by name

Delete a note for good.

Kotlin
Hammer.note.delete(project, id)
Rust
ops::note::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
createdstring
tagslist of strings
contentstring

note.list

read content:read

A project's notes, optionally only those with a tag.

Kotlin
Hammer.note.list(project, …)
Rust
ops::note::list(project, NoteListOptions { … })
Input
FieldTypeMeaning
projectstring
tag optionalstring or null
Output
FieldTypeMeaning
noteslist of objects
notes[].idinteger
notes[].createdstring
notes[].tagslist of strings
notes[].contentstring

note.read

read content:read

One note.

Kotlin
Hammer.note.read(project, id)
Rust
ops::note::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
createdstring
tagslist of strings
contentstring

note.update

write content:write

Replace a note's text, and its tags when given.

Kotlin
Hammer.note.update(project, id, content, …)
Rust
ops::note::update(project, id, content, NoteUpdateOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
contentstring
tags optionallist of strings or nullLeft out, the tags stay as they are.
Output
FieldTypeMeaning
idinteger
createdstring
tagslist of strings
contentstring

ops

ops.list

read content:read

Every operation you may call, with JSON schemas for its input and output.

Kotlin
Hammer.ops.list()
Rust
ops::ops::list()
Input

Takes no input: pass {}.

Output
FieldTypeMeaning
operationslist of objects
operations[].namestring
operations[].descriptionstring
operations[].accessone of "read", "write", "prose", "destructive"
operations[].scopeone of "content", "account", "plugins"
operations[].inputmap of string to any
operations[].outputmap of string to any

plugin

plugin.list

read plugins:read

The installed runtime plugins, and what each may use.

Kotlin
Hammer.plugin.list()
Rust
ops::plugin::list()
Input

Takes no input: pass {}.

Output
FieldTypeMeaning
pluginslist of objects
plugins[].idstring
plugins[].name optionalstring or nullNull, as are [version] and [description], when its package can no longer be read.
plugins[].version optionalstring or null
plugins[].description optionalstring or null
plugins[].enabledboolean
plugins[].operations optionallist of stringsThe operations it may use.
plugins[].http optionallist of stringsHosts it may send what the user writes to.
plugins[].userHostSetting optionalstring or nullThe setting holding an address it may also send what the user writes to.

project

project.create

write content:write

Create an empty project.

Kotlin
Hammer.project.create(name)
Rust
ops::project::create(name)
Input
FieldTypeMeaning
namestring
Output
FieldTypeMeaning
namestring

project.delete

destructive content:by name

Delete a project, and everything in it, for good. It must not be open in Hammer.

Kotlin
Hammer.project.delete(project)
Rust
ops::project::delete(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
namestring

project.export

read content:read

Export a project, or some of its scenes, in one of the formats from export.formats.

Kotlin
Hammer.project.export(project, format, …)
Rust
ops::project::export(project, format, ProjectExportOptions { … })
Input
FieldTypeMeaning
projectstring
formatstringAn id from export.formats.
sceneIds optionallist of integers or nullLimits the export to these scenes; omitted exports the whole story.
treatTopLevelAsChapters optionalboolean
Output
FieldTypeMeaning
fileNamestring
mimeTypestring
contentbase64 string

project.import

prose content:prose

Create a project from a Markdown or RTF manuscript, split into scenes by its headings or a chapter pattern.

Kotlin
Hammer.project.`import`(format, content, …)
Rust
ops::project::import(format, content, ProjectImportOptions { … })
Input
FieldTypeMeaning
name optionalstring or nullLeft out, the title the file gives itself.
formatone of "markdown", "rtf"
contentbase64 string
markdownSplit optionalone of "auto", "h1", "h2", "pattern"
rtfSplit optionalone of "formatting", "pattern", "single"
chapterPattern optionalstring or nullA regular expression for the lines that start a chapter; left out, chapter, part, prologue, and epilogue.
chapterGroups optionalbooleanPut each chapter's scenes in a group.
Output
FieldTypeMeaning
namestring
scenesinteger

project.info

read content:read

A project's details: author, language, tags, word count goal, cached totals, and sync linkage.

Kotlin
Hammer.project.info(project)
Rust
ops::project::info(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
namestring
projectIdstring
createdstring or null
lastAccessedstring or null
authorNamestring or null
languagestring or null
tagslist of strings
wordCountGoalobject or null
wordCountGoal.cadenceone of "day", "week"
wordCountGoal.countinteger
wordCountinteger or null
sceneCountinteger or null
lastEditedstring or null

project.list

read content:read

List every project with its word count and when it was last edited.

Kotlin
Hammer.project.list()
Rust
ops::project::list()
Input

Takes no input: pass {}.

Output
FieldTypeMeaning
projectslist of objects
projects[].namestring
projects[].projectIdstring
projects[].wordCountinteger or nullFrom the statistics cache; null until statistics are first calculated.
projects[].createdstring or nullNull when the project's metadata can't be read.
projects[].lastAccessedstring or null
projects[].lastEditedstring or null

project.rename

write content:write

Rename a project. It must not be open in Hammer.

Kotlin
Hammer.project.rename(project, name)
Rust
ops::project::rename(project, name)
Input
FieldTypeMeaning
projectstring
namestring
Output
FieldTypeMeaning
namestring

scene

scene.append

prose content:prose

Add markdown to the end of a scene's text, as a new paragraph.

Kotlin
Hammer.scene.append(project, id, markdown)
Rust
ops::scene::append(project, id, markdown)
Input
FieldTypeMeaning
projectstring
idinteger
markdownstring
Output
FieldTypeMeaning
wordCountinteger

scene.archive

write content:write

Archive a scene: take it out of the story, keeping its text, drafts, and notes.

Kotlin
Hammer.scene.archive(project, id)
Rust
ops::scene::archive(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.archived

read content:read

A project's archived scenes.

Kotlin
Hammer.scene.archived(project)
Rust
ops::scene::archived(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
sceneslist of objects
scenes[].idinteger
scenes[].namestring

scene.create

write content:write

Create an empty scene or group, at the end of its parent unless an index is given.

Kotlin
Hammer.scene.create(project, name, …)
Rust
ops::scene::create(project, name, SceneCreateOptions { … })
Input
FieldTypeMeaning
projectstring
namestring
kind optionalone of "scene", "group"
parentId optionalinteger or nullThe group to create it in; left out, the top level.
index optionalinteger or nullIts position among its siblings; left out, the end.
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.delete

destructive content:by name

Delete a scene, archived or not, or an empty group, for good.

Kotlin
Hammer.scene.delete(project, id)
Rust
ops::scene::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.meta.read

read content:read

A scene's outline, notes, tags, and references: the entries confirmed as in it, and those dismissed.

Kotlin
Hammer.scene.meta.read(project, id)
Rust
ops::scene::meta::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
outlinestring
notesstring
tagslist of strings
currentDraftstring
createdstring or null
lastEditedstring or null
referenceslist of integersEntry ids confirmed as in the scene.
dismissedReferenceslist of integersEntry ids the writer dismissed, which name matching no longer adds.

scene.meta.write

write content:write

Change a scene's outline, notes, or tags. Fields left out keep their value.

Kotlin
Hammer.scene.meta.write(project, id, …)
Rust
ops::scene::meta::write(project, id, SceneMetaWriteOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
outline optionalstring or null
notes optionalstring or null
tags optionallist of strings or null
Output
FieldTypeMeaning
outlinestring
notesstring
tagslist of strings
currentDraftstring
createdstring or null
lastEditedstring or null
referenceslist of integersEntry ids confirmed as in the scene.
dismissedReferenceslist of integersEntry ids the writer dismissed, which name matching no longer adds.

scene.move

write content:write

Move a scene or group to a position within a group, or the top level when parentId is left out. index is its position there after the move.

Kotlin
Hammer.scene.move(project, id, index, …)
Rust
ops::scene::r#move(project, id, index, SceneMoveOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
parentId optionalinteger or nullThe group to move into; left out, the top level.
indexinteger
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.read

read content:read

A scene's markdown, including unsaved edits, with its outline, notes, and tags.

Kotlin
Hammer.scene.read(project, id)
Rust
ops::scene::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
archivedboolean
markdownstring
wordCountinteger
metaobject
meta.outlinestring
meta.notesstring
meta.tagslist of strings
meta.currentDraftstring
meta.createdstring or null
meta.lastEditedstring or null
meta.referenceslist of integersEntry ids confirmed as in the scene.
meta.dismissedReferenceslist of integersEntry ids the writer dismissed, which name matching no longer adds.

scene.read.many

read content:read

Scenes in story order with their markdown, metadata, and the groups they sit in, a page of about maxWords, counting outlines and notes, at a time: every scene, a group's, or those in ids. Archived scenes are left out. Pass next as after for the following page; it is null on the last.

Kotlin
Hammer.scene.read.many(project, …)
Rust
ops::scene::read::many(project, SceneReadManyOptions { … })
Input
FieldTypeMeaning
projectstring
group optionalinteger or nullA group whose scenes, at any depth, to read.
ids optionallist of integers or null
after optionalinteger or nullThe previous page's next.
maxWords optionalinteger
Output
FieldTypeMeaning
sceneslist of objects
scenes[].idinteger
scenes[].namestring
scenes[].pathlist of stringsNames of the groups containing the scene, outermost first.
scenes[].markdownstring
scenes[].wordCountinteger
scenes[].metaobject
scenes[].meta.outlinestring
scenes[].meta.notesstring
scenes[].meta.tagslist of strings
scenes[].meta.currentDraftstring
scenes[].meta.createdstring or null
scenes[].meta.lastEditedstring or null
scenes[].meta.referenceslist of integersEntry ids confirmed as in the scene.
scenes[].meta.dismissedReferenceslist of integersEntry ids the writer dismissed, which name matching no longer adds.
nextinteger or nullThe last scene's id when more follow, to pass as after; null on the last page.

scene.references.set

write content:write

Change which entries a scene references. confirm marks entries as in the scene, and un-dismisses them; dismiss marks entries as only mentioned, so name matching stops adding them; clear forgets entries either way, so a later match can add them again.

Kotlin
Hammer.scene.references.set(project, id, …)
Rust
ops::scene::references::set(project, id, SceneReferencesSetOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
confirm optionallist of integers
dismiss optionallist of integers
clear optionallist of integers
Output
FieldTypeMeaning
outlinestring
notesstring
tagslist of strings
currentDraftstring
createdstring or null
lastEditedstring or null
referenceslist of integersEntry ids confirmed as in the scene.
dismissedReferenceslist of integersEntry ids the writer dismissed, which name matching no longer adds.

scene.rename

write content:write

Rename a scene or group.

Kotlin
Hammer.scene.rename(project, id, name)
Rust
ops::scene::rename(project, id, name)
Input
FieldTypeMeaning
projectstring
idinteger
namestring
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.tree

read content:read

A project's scenes and groups in story order, with word counts.

Kotlin
Hammer.scene.tree(project)
Rust
ops::scene::tree(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
nodeslist of SceneNodes
SceneNode
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"
wordCountinteger
childrenlist of SceneNodes

scene.unarchive

write content:write

Return an archived scene to the story, at the end of the top level.

Kotlin
Hammer.scene.unarchive(project, id)
Rust
ops::scene::unarchive(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
namestring
kindone of "scene", "group"

scene.write

prose content:prose

Replace a scene's text with markdown. Mode draft saves it as a new draft of the scene and leaves the scene alone. Mode live replaces the scene's text, saving the old text as a draft first.

Kotlin
Hammer.scene.write(project, id, mode, markdown, …)
Rust
ops::scene::write(project, id, mode, markdown, SceneWriteOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
modeone of "draft", "live"
markdownstring
draftName optionalstring or nullThe new draft's name, in draft mode only.
Output
FieldTypeMeaning
draftIdinteger or nullThe new draft, in draft mode.
previousDraftIdinteger or nullIn live mode, the draft holding the text it replaced; null when the text was unchanged.
wordCountinteger

stats

stats.activity

read content:read

Words written per day over a date range, plus lifetime words per device.

Kotlin
Hammer.stats.activity(project, …)
Rust
ops::stats::activity(project, StatsActivityOptions { … })
Input
FieldTypeMeaning
projectstring
from optionalstring or nullFirst day included, in the device's time zone; omitted for no lower bound.
to optionalstring or nullLast day included; omitted for no upper bound.
Output
FieldTypeMeaning
dayslist of objects
days[].datestring
days[].wordsinteger
deviceslist of objectsLifetime totals, not limited to the range.
devices[].devicestring
devices[].wordsinteger

stats.project

read content:read

A project's statistics, as its Home screen shows them.

Kotlin
Hammer.stats.project(project, …)
Rust
ops::stats::project(project, StatsProjectOptions { … })
Input
FieldTypeMeaning
projectstring
recalculate optionalbooleanRecalculate even when the cached statistics are current.
Output
FieldTypeMeaning
totalWordsinteger
sceneCountinteger
chapterslist of objectsTop-level scenes and groups, in story order.
chapters[].idinteger
chapters[].namestring
chapters[].wordsinteger
longestSceneobject or null
longestScene.idinteger
longestScene.namestring
longestScene.wordsinteger
shortestSceneWordsinteger
medianSceneWordsinteger
noteCountinteger
timelineEventCountinteger
entryCountslist of objects
entryCounts[].typeone of "person", "place", "thing", "event", "idea"
entryCounts[].countinteger
topAppearanceslist of objectsPeople appearing in the most scenes.
topAppearances[].entryIdinteger
topAppearances[].namestring
topAppearances[].typeone of "person", "place", "thing", "event", "idea"
topAppearances[].sceneCountinteger
wordCountGoalobject or null
wordCountGoal.cadenceone of "day", "week"
wordCountGoal.countinteger
lastEditedstring or null
lastEditedSceneobject or null
lastEditedScene.idinteger
lastEditedScene.namestring

stats.sessions

read content:read

Writing sessions over a date range, from every device.

Kotlin
Hammer.stats.sessions(project, …)
Rust
ops::stats::sessions(project, StatsSessionsOptions { … })
Input
FieldTypeMeaning
projectstring
from optionalstring or nullFirst day included, in the device's time zone; omitted for no lower bound.
to optionalstring or nullLast day included; omitted for no upper bound.
Output
FieldTypeMeaning
sessionslist of objects
sessions[].devicestring
sessions[].startedAtstring
sessions[].endedAtstring
sessions[].wordsinteger

sync

sync.status

read account:read

Each project's link to the sync server, its last sync, and how many of its changes are waiting to sync.

Kotlin
Hammer.sync.status()
Rust
ops::sync::status()
Input

Takes no input: pass {}.

Output
FieldTypeMeaning
projectslist of objects
projects[].namestring
projects[].linkedbooleanTrue once the project has synced.
projects[].lastSyncstring or nullNull when never synced.
projects[].pendingChangesinteger

tag

tag.find

read content:read

Every scene, note, entry, and timeline event carrying a tag.

Kotlin
Hammer.tag.find(project, tag)
Rust
ops::tag::find(project, tag)
Input
FieldTypeMeaning
projectstring
tagstring
Output
FieldTypeMeaning
entitieslist of objects
entities[].kindone of "scene", "note", "entry", "timeline"
entities[].idinteger

tag.list

read content:read

The tags used in a project, most used first, optionally counting one kind of entity.

Kotlin
Hammer.tag.list(project, …)
Rust
ops::tag::list(project, TagListOptions { … })
Input
FieldTypeMeaning
projectstring
kind optionalone of "scene", "note", "entry", "timeline" or null
limit optionalinteger or null
Output
FieldTypeMeaning
tagslist of objects
tags[].tagstring
tags[].countinteger

timeline

timeline.create

write content:write

Add a plain event to a project's timeline, main unless timeline names another, at the end unless an index is given. A dated timeline needs a start and takes no index. Entries and scenes are added with timeline.place.

Kotlin
Hammer.timeline.create(project, content, …)
Rust
ops::timeline::create(project, content, TimelineCreateOptions { … })
Input
FieldTypeMeaning
projectstring
contentstring
date optionalstring or nullDeprecated alias of label; label wins when both are given.
tags optionallist of strings
index optionalinteger or nullIts position in the timeline; left out, the end. A dated timeline takes none.
title optionalstring or nullIts own title; left out, the content's first line is shown.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
lane optionalstring or nullThe lane it runs in.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, such as {"year": 97, "day": 210}; required on a dated timeline.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; needs a start.
references optionallist of integersScene and entry ids it refers to.
timeline optionalstring or nullThe timeline's id, from timeline.settings.read; left out, or "main", the main timeline.
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.def.create

write content:write

Add a timeline to a project, manual unless mode says otherwise; a dated one needs a calendar. Its name is trimmed and no other timeline may have it, ignoring case. Returns it with its id, which the timeline option of other operations takes.

Kotlin
Hammer.timeline.def.create(project, name, …)
Rust
ops::timeline::def::create(project, name, TimelineDefCreateOptions { … })
Input
FieldTypeMeaning
projectstring
namestring
mode optionalone of "manual", "dated" or nullLeft out, manual.
calendar optionalobject or nullRequired for a dated timeline.
calendar.presetone of "story", "gregorian"
calendar.epochName optionalstring or nullWhat year 0 of a story calendar is called, such as "The Fall".
calendar.coarsestUnit optionalstring or nullStory calendar only: the coarsest unit dates use, so a one-day story can run in hours.
laneOrder optionallist of stringsLanes in the order they are drawn.
Output
FieldTypeMeaning
idstringStable id; the main timeline is "main".
namestring
modeone of "manual", "dated"
calendarobject or nullThe calendar dates are on; null until one is chosen.
calendar.presetone of "story", "gregorian"
calendar.epochName optionalstring or nullWhat year 0 of a story calendar is called, such as "The Fall".
calendar.coarsestUnit optionalstring or nullStory calendar only: the coarsest unit dates use, so a one-day story can run in hours.
laneOrderlist of stringsLanes in the order they are drawn; lanes in use but not listed follow alphabetically.

timeline.def.delete

destructive content:by name

Delete a timeline and every event on it for good; entries and scenes placed there are left alone. The main timeline cannot be deleted.

Kotlin
Hammer.timeline.def.delete(project, timeline)
Rust
ops::timeline::def::delete(project, timeline)
Input
FieldTypeMeaning
projectstring
timelinestringThe timeline's id; main cannot be deleted.
Output
FieldTypeMeaning
timelinestringThe deleted timeline's id.
deletedEventsintegerHow many events were on it, deleted with it.

timeline.delete

destructive content:by name

Delete a timeline event for good. Deleting a placement leaves its entry or scene alone.

Kotlin
Hammer.timeline.delete(project, id)
Rust
ops::timeline::delete(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.list

read content:read

A timeline's events in display order: their manual order, or by start date on a dated timeline. The main timeline unless timeline names another; orphaned lists, by order, the events left on timelines deleted since, such as one made offline before a sync.

Kotlin
Hammer.timeline.list(project, …)
Rust
ops::timeline::list(project, TimelineListOptions { … })
Input
FieldTypeMeaning
projectstring
timeline optionalstring or nullThe timeline's id; left out, or "main", the main timeline.
orphaned optionalbooleanInstead, the events whose timeline was deleted.
Output
FieldTypeMeaning
eventslist of objects
events[].idinteger
events[].orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
events[].datestring or nullDeprecated alias of label, always equal to it.
events[].contentstringA plain event's markdown; always empty for a placement.
events[].tagslist of stringsA plain event's tags; always empty for a placement.
events[].kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
events[].subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
events[].title optionalstring or nullA plain event's own title.
events[].label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
events[].displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
events[].lane optionalstring or nullThe lane it runs in; null for none.
events[].milestone optionalbooleanA turning point, marked across every lane.
events[].start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
events[].end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
events[].references optionallist of integersScene and entry ids a plain event refers to.
events[].cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
events[].timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.move

write content:write

Move a timeline event to a position on its own timeline; index is its position after the move. A dated timeline is ordered by its dates, so nothing can be moved on it. timeline.set moves an event to another timeline.

Kotlin
Hammer.timeline.move(project, id, index)
Rust
ops::timeline::r#move(project, id, index)
Input
FieldTypeMeaning
projectstring
idinteger
indexinteger
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.place

write content:write

Place an encyclopedia entry of type event, or a scene, on a project's timeline, main unless timeline names another. Each can be placed once on each timeline, and its name and words come from it. A dated timeline needs a start.

Kotlin
Hammer.timeline.place(project, kind, subject, …)
Rust
ops::timeline::place(project, kind, subject, TimelinePlaceOptions { … })
Input
FieldTypeMeaning
projectstring
kindone of "event", "entry", "scene"entry or scene.
subjectintegerThe entry or scene id.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, such as {"year": 97, "day": 210}; required on a dated timeline.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; needs a start.
lane optionalstring or nullThe lane it runs in.
milestone optionalbooleanA turning point, marked across every lane.
timeline optionalstring or nullThe timeline's id, from timeline.settings.read; left out, or "main", the main timeline.
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.read

read content:read

One timeline event.

Kotlin
Hammer.timeline.read(project, id)
Rust
ops::timeline::read(project, id)
Input
FieldTypeMeaning
projectstring
idinteger
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.set

write content:write

Set single fields of any timeline event, or clear them by name, leaving the rest alone. A placement takes only label, lane, milestone, start, and end. This is how a placement is edited. A timeline other than the event's own moves it there, with start and end, when given, as its dates on that timeline's calendar; a dated timeline refuses the move unless the event's start fits or one is given.

Kotlin
Hammer.timeline.set(project, id, …)
Rust
ops::timeline::set(project, id, TimelineSetOptions { … })
Input
FieldTypeMeaning
projectstring
idintegerThe timeline event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullThe free-text "when", shown on a manual timeline.
lane optionalstring or nullThe lane it runs in.
milestone optionalboolean or nullA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start.
clear optionallist of stringsFields to clear, from title, label, lane, start, and end.
timeline optionalstring or nullMoves the event to this timeline, by id, "main" for the main one.
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.

timeline.settings.read

read content:read

A project's timelines, main first, each with its id, name, mode, calendar, and lane order, and how many events are left on timelines deleted since (see timeline.list orphaned).

Kotlin
Hammer.timeline.settings.read(project)
Rust
ops::timeline::settings::read(project)
Input
FieldTypeMeaning
projectstringThe project's name, or its server project id.
Output
FieldTypeMeaning
timelineslist of objectsThe project's timelines: main first, then the others in the order they were made.
timelines[].idstringStable id; the main timeline is "main".
timelines[].namestring
timelines[].modeone of "manual", "dated"
timelines[].calendarobject or nullThe calendar dates are on; null until one is chosen.
timelines[].calendar.presetone of "story", "gregorian"
timelines[].calendar.epochName optionalstring or nullWhat year 0 of a story calendar is called, such as "The Fall".
timelines[].calendar.coarsestUnit optionalstring or nullStory calendar only: the coarsest unit dates use, so a one-day story can run in hours.
timelines[].laneOrderlist of stringsLanes in the order they are drawn; lanes in use but not listed follow alphabetically.
orphaned optionalintegerEvents whose timeline was deleted, such as one made offline before a sync; timeline.list orphaned lists them.

timeline.settings.write

write content:write

Change one timeline's settings, main unless timeline names another; fields left out stay as they are, and name renames it. Switching to dated gives every event without a valid start one, spaced evenly in the current order; switching to manual keeps the date order as the manual order. A new calendar drops dates that do not fit it, keeping the start as the label of an event that has none.

Kotlin
Hammer.timeline.settings.write(project, …)
Rust
ops::timeline::settings::write(project, TimelineSettingsWriteOptions { … })
Input
FieldTypeMeaning
projectstring
name optionalstring or nullA new name, which renames the timeline.
mode optionalone of "manual", "dated" or nullSwitching to dated needs a calendar, here or already set.
calendar optionalobject or null
calendar.presetone of "story", "gregorian"
calendar.epochName optionalstring or nullWhat year 0 of a story calendar is called, such as "The Fall".
calendar.coarsestUnit optionalstring or nullStory calendar only: the coarsest unit dates use, so a one-day story can run in hours.
laneOrder optionallist of strings or nullLanes in the order they are drawn.
spacing optionalobject or nullOnly when switching to dated; left out, events are one of the calendar's coarsest unit apart.
spacing.unitstringThe calendar unit to step by, such as "day".
spacing.step optionalinteger
spacing.originmap of string to integerThe first event's date, such as {"year": 97}.
timeline optionalstring or nullThe timeline's id; left out, or "main", the main timeline.
Output
FieldTypeMeaning
timelineslist of objectsThe project's timelines: main first, then the others in the order they were made.
timelines[].idstringStable id; the main timeline is "main".
timelines[].namestring
timelines[].modeone of "manual", "dated"
timelines[].calendarobject or nullThe calendar dates are on; null until one is chosen.
timelines[].calendar.presetone of "story", "gregorian"
timelines[].calendar.epochName optionalstring or nullWhat year 0 of a story calendar is called, such as "The Fall".
timelines[].calendar.coarsestUnit optionalstring or nullStory calendar only: the coarsest unit dates use, so a one-day story can run in hours.
timelines[].laneOrderlist of stringsLanes in the order they are drawn; lanes in use but not listed follow alphabetically.
orphaned optionalintegerEvents whose timeline was deleted, such as one made offline before a sync; timeline.list orphaned lists them.

timeline.update

write content:write

Replace a plain event's text, and any other field given; an empty value clears it. The text is always required, so every call replaces it. Edit a placement with timeline.set.

Kotlin
Hammer.timeline.update(project, id, content, …)
Rust
ops::timeline::update(project, id, content, TimelineUpdateOptions { … })
Input
FieldTypeMeaning
projectstring
idinteger
contentstringThe plain event's markdown; must be empty for a placement, which is edited with timeline.set.
date optionalstring or nullDeprecated alias of label; label wins when both are given.
tags optionallist of strings or null
title optionalstring or null
label optionalstring or nullFree-text "when" a manual timeline shows.
lane optionalstring or null
milestone optionalboolean or null
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start.
references optionallist of integers or nullScene and entry ids it refers to.
Output
FieldTypeMeaning
idinteger
orderintegerManual position. A dated timeline orders by start date and uses this only to break ties.
datestring or nullDeprecated alias of label, always equal to it.
contentstringA plain event's markdown; always empty for a placement.
tagslist of stringsA plain event's tags; always empty for a placement.
kind optionalone of "event", "entry", "scene"A plain event, or the placement of an encyclopedia entry or a scene.
subject optionalinteger or nullThe placed entry or scene id; null for a plain event.
title optionalstring or nullA plain event's own title.
label optionalstring or nullFree-text "when" a manual timeline shows, such as "Day 3" or "Spring, 1802".
displayTitle optionalstringThe name to show: the subject's name, else the title, the content's first line, or the cached title.
lane optionalstring or nullThe lane it runs in; null for none.
milestone optionalbooleanA turning point, marked across every lane.
start optionalmap of string to integer or nullWhen it starts on the timeline's calendar, as filled units such as {"year": 97, "day": 210}.
end optionalmap of string to integer or nullWhen it ends, in the same form as start; null for a moment.
references optionallist of integersScene and entry ids a plain event refers to.
cachedTitle optionalstring or nullA placement's subject name when last seen, kept in case the subject is deleted.
timeline optionalstringThe id of the timeline it is on, "main" for the main one; a straggler keeps its deleted timeline's.