Docs API

Base path: https://developerapi.motaware.com/docs/v1

Scopes: docs.read for the GET routes, docs.write for everything else (it also allows reads). The person's Motaware plan must include Docs, otherwise the answer is 403 entitlement.app_unavailable. On a lapsed plan reads keep working and changes get 403.

Endpoints

MethodPathPurpose
GET/documentsDocuments, paged
POST/documentsCreate an empty document: { "title"?, "folderId"? }
GET/documents/search?q=Search: [{id, title, snippet, ownerName, updatedAt, folderId}]
POST/documents/importCreate a document from a file (multipart, up to 20 MB)
GET/documents/{id}One document
PUT/documents/{id}Rename, move or star: { "title"?, "folderId"?, "isStarred"? }
DELETE/documents/{id}Move a document to the trash
POST/documents/{id}/restoreRestore from the trash
GET/documents/{id}/export/{format}Export as txt, md, markdown, html, pdf or docx
GET/foldersFolders
POST/foldersCreate a folder: { "name", "parentFolderId"?, "color"? }
PUT/folders/{id}Change a folder: { "name"?, "color"?, "parentFolderId"?, "moveToRoot"? }
DELETE/folders/{id}Delete a folder
GET/folders/{id}/contentsA folder's subfolders and documents

Reading and writing content

Motaware Docs documents are edited collaboratively in real time, so the API works with whole documents:

  • Read a document's content through export (md or html for text; pdf or docx for files).
  • Create a document with content through import: multipart file (.md .markdown .html .htm .txt .docx), optional folderId query parameter. The answer includes the new document's id.
  • Editing the content of an existing document isn't possible through the API yet.

Exports reflect the last saved version from the editor, so a change someone is making right now can take a moment to appear.

Document

Fields: id, title, slug, ownerName, folderId, wordCount, isPublic, isStarred, createdAt, updatedAt; the detail adds collaboratorCount and currentUserPermission (Owner, Editor, Commenter or Viewer).

isPublic can't be set through the API: making a document public is sharing, which v1 doesn't offer, so it's refused with 400 field_not_supported.

Listing

GET /documents takes scope (owned default, shared, all), folderId, sort (updated, created, title), search, pageNumber and pageSize (at most 100), and returns { items, pageNumber, totalPages, totalCount, hasPreviousPage, hasNextPage }.

Examples

curl -X POST https://developerapi.motaware.com/docs/v1/documents/import \
  -H "Authorization: Bearer $MOTAWARE_API_KEY" -F "file=@plan.md"

curl https://developerapi.motaware.com/docs/v1/documents/{id}/export/md \
  -H "Authorization: Bearer $MOTAWARE_API_KEY"

Not available yet

Editing content in place, sharing and collaborators, comments, suggestions, versions, templates and live editing.