Document
A Document is structured, versioned material in one of three forms, a document, a deck, or a sheet, rendered to any format.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
form | string | required | One of document, deck, or sheet. |
Object
{
"$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, inverseexportOf. - 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, inversegenerates.
Verbs
createCreates a Document.POST /{namespace}/documentsgetReturns one Document by id.GET /{namespace}/documents/{id}listReturns Documents, newest first, one page at a time.GET /{namespace}/documentsupdateChanges the given properties of a Document.PATCH /{namespace}/documents/{id}deleteDeletes a Document; its history is kept.DELETE /{namespace}/documents/{id}renderRender produces a file from a Document in the format the reader asks for.POST /{namespace}/documents/{document}/render
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Document.create | Yes | Yes | Yes | No |
Document.get | Yes | Yes | Yes | Yes |
Document.list | Yes | Yes | Yes | Yes |
Document.update | Yes | Yes | Yes | No |
Document.delete | Yes | Yes | Yes | No |
Document.render | Yes | Yes | Yes | No |
Call it
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.