Documents

Import a file as a document

Changed on

This method allows you to create a new document by importing an existing file. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document.

post/documents.import

Request

  • Base URL
    https://app.getoutline.com/api
  • URL
    https://app.getoutline.com/api/documents.import
  • 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 multipart/form-data

fileobject required

Plain text, markdown, docx, pdf, csv, tsv, html, mhtml (or mht) web pages, eml email messages, and textbundle/textpack bundles are supported.

collectionIdstring nullable

Identifier for the collection to import into. One of collectionId or parentDocumentId is required. Pass the literal string personal to import into the authenticated user's personal collection.

parentDocumentIdstring uuid nullable

Identifier for the parent document to import under. One of collectionId or parentDocumentId is required.

publishboolean

Whether to publish the imported document

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

    • info

      added the optional property / to the response with the status

    • info

      response property data/url deprecated

    • info

      the request property format was generalized from uuid to no format