Documents

Update a document

Changed on

This method allows you to modify an already created document

post/documents.update

Request

  • Base URL
    https://app.getoutline.com/api
  • URL
    https://app.getoutline.com/api/documents.update
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: https://app.getoutline.com/oauth/authorize
      Token URL: https://app.getoutline.com/oauth/token scopes: read, write

Request body

idstring required

Unique identifier for the document. Either the UUID or the urlId is acceptable.

titlestring

The title of the document.

textstring

The body of the document in markdown.

iconstring nullable

Icon displayed alongside the document title

colorstring nullable

Color for the document icon (hex format)

fullWidthboolean

Whether the document should be displayed in full width

templateIdstring uuid nullable

Identifier for the template this document is based on

collectionIdstring uuid nullable

Identifier for the collection to move the document to

insightsEnabledboolean

Whether insights should be visible on the document

editMode'append' | 'prepend' | 'replace' | 'patch'

The editing mode for text updates to a document. When set to patch, the findText parameter is required and the existing occurrence of findText will be replaced with the value of text.

findTextstring

The text to find within the document when using patch editMode. This text will be replaced with the value of text. Required when editMode is patch.

publishboolean

Whether this document should be published and made visible to other workspace members, if a draft

lastRevisioninteger

If set, the update is rejected with a 409 response when the document's current revision number does not match this value. Use this for optimistic concurrency control to avoid overwriting changes made since the client last loaded the document.

deprecatedReasonstring nullable

The reason the document was archived or deleted. Can only be updated on an archived or deleted document.

Example request

{
  "id": "hDYep1TPAM"
}

Response

OK

Example response

{
  "data": {
    "title": "Welcome to Acme Inc",
    "icon": "🎉",
    "text": "…",
    "urlId": "hDYep1TPAM",
    "createdBy": {
      "name": "Jane Doe"
    },
    "updatedBy": {
      "name": "Jane Doe"
    },
    "deletedBy": {
      "name": "Jane Doe"
    }
  },
  "policies": [
    {
      "abilities": {
        "read": true,
        "update": true,
        "delete": false
      }
    }
  ]
}

Changes