Skip to main content
POST
Edit, rename, move or restore a document
Changes the markdown, name or folder, or restores a revision. Pass the guards from documents_get so a change someone else made fails with DocumentConflict instead of being overwritten. On a Slack canvas markdown saves your draft and nothing reaches Slack until documents_publish; resolve saves merged markdown over the canvas’s latest revision after a conflict. Requires the documents:write scope.

Authorizations

x-api-key
string
header
required

An Avazal API key (avz_…) created in Settings → API keys.

Body

application/json
id
string
required

A doc_ or aart_ id from documents_list, or a Slack canvas as chcv_…/.

markdown
string

a string at most 1000000 character(s) long

Maximum string length: 1000000
name
string

a string at most 255 character(s) long

Required string length: 1 - 255
Pattern: ^\S[\s\S]*\S$|^\S$|^$
parentId
string | null

Document or folder

Pattern: ^doc_[\s\S]*?$
restore
string

Bring back this revision from documents_revisions.

Pattern: ^drev_[\s\S]*?$
resolve
boolean
expectedRevisionId
string

The revisionId from documents_get. Needed to change markdown; fails with DocumentConflict if someone saved since.

Pattern: ^drev_[\s\S]*?$
expectedGeneration
integer

draft.generation from documents_get, 0 when draft is null. Needed to change a canvas or restore a revision.

Required range: x >= 0
expectedVersion
integer

version from documents_get or documents_list. Needed to rename or move.

Response

A document, folder, Slack canvas or something a run saved. A read adds its markdown, your canvas draft and publish state.

A document, folder, Slack canvas or something a run saved. A read adds its markdown, your canvas draft and publish state.

id
string
required

The object's id. Every operation that takes it accepts it.

url
string | null
required

A link that opens the object where it lives.

source
enum<string>
required

Where the object lives. Avazal is the source of its own objects.

Available options:
avazal,
slack,
gmail,
google-calendar,
google-drive,
linear,
github,
contacts
title
string
required
kind
enum<string>
required

file is a markdown document or a file a run saved, folder holds documents, and page, images and report are what a run saved with documents_save.

Available options:
file,
folder,
page,
images,
report
parentId
string | null
required

Document or folder

Pattern: ^doc_[\s\S]*?$
revisionId
string | null
required

Document revision

Pattern: ^drev_[\s\S]*?$
version
integer | null
required
updatedAt
string | null
required
conversation
string | null
required

The channel or DM a Slack canvas belongs to.

Pattern: ^chcv_[\s\S]*?$
run
string

The run that saved it with documents_save.

Pattern: ^arun_[\s\S]*?$
files
object[]

The files a run saved, in order.

markdown
string

a string at most 1000000 character(s) long

Maximum string length: 1000000
draft
object | null
publish
object | null

Where a Slack canvas's draft stands against Slack.

context
object