Skip to content

Document

A Document is structured, versioned material in one of three forms, a document, a deck, or a sheet, rendered to any format.

Properties

PropertyTypeRequiredDescription
formstringrequiredOne of document, deck, or sheet.

Object

JSON
{
  "$id": "https://api.sb/routewise.dev/documents/document_1",
  "$type": "Document",
  "form": "document"
}

Relationships

  • A Document exports to many Files: each rendering of a Document to a format, such as PDF, is stored as a File. exportsTo, inverse exportOf.
  • A Document is generated from one Template: a Template fills its variables from the graph to generate a Document, such as a proposal or an invoice. generatedFrom, inverse generates.

Verbs

  1. createCreates a Document.
    POST /{namespace}/documentsdoDocument.created
  2. getReturns one Document by id.
    GET /{namespace}/documents/{id}readNo Event
  3. listReturns Documents, newest first, one page at a time.
    GET /{namespace}/documentsreadNo Event
  4. updateChanges the given properties of a Document.
    PATCH /{namespace}/documents/{id}doDocument.updated
  5. deleteDeletes a Document; its history is kept.
    DELETE /{namespace}/documents/{id}doDocument.deleted
  6. renderRender produces a file from a Document in the format the reader asks for.
    POST /{namespace}/documents/{document}/renderdoDocument.rendered

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Document.createYesYesYesNo
Document.getYesYesYesYes
Document.listYesYesYesYes
Document.updateYesYesYesNo
Document.deleteYesYesYesNo
Document.renderYesYesYesNo

Call it

Text
Render the latest document.

Example

The quarterly investor update is a Document in deck form. The same Document renders to PDF for email and to Markdown for an Agent.