Documents

Create Document from Markdown File Upload

Changed on

Create from a Markdown upload

Upload a Markdown (.md) file to create a new document. The file content will be converted into a PandaDoc document.

Note: A file you upload is not stored in your PandaDoc account, so you have to upload it with every request.

Alpha: Markdown file upload is currently in alpha. This functionality may change or be removed without notice.

post/public/v1/documents?upload-markdown

Request

Request body multipart/form-data

filestring binary

The Markdown file to upload.

Accepted content types: text/markdown, text/x-markdown.

Example request

{
  "data": {
    "name": "API Sample Document from Markdown",
    "folder_uuid": "QMDSzwabfFzTgjW4kUijqQ",
    "owner": {
      "membership_id": "QMDSzwabfFzTgjW6KijHyu"
    },
    "recipients": [
      {
        "role": "user",
        "signing_order": 1,
        "email": "josh@example.com",
        "phone": "+14842634627",
        "first_name": "Josh",
        "last_name": "Ron",
        "redirect": {
          "url": "https://example.com"
        },
        "type": "recipient",
        "verification_settings": {
          "verification_place": "before_open",
          "email_otp_verification": {
            "email": "user@example.com"
          }
        }
      }
    ],
    "tokens": [
      {
        "name": "Client.CompanyName",
        "value": "PandaDoc"
      }
    ],
    "metadata": {
      "lead_id": "1234567",
      "lead_source": "PandaDoc"
    },
    "tags": [
      "created_via_api",
      "test_document",
      "created_from_source"
    ],
    "fields_mapping": {
      "signer": [
        "signer_name",
        "signer_date"
      ],
      "reviewer": [
        "reviewer_comment"
      ]
    }
  }
}

Response

OK

idstring
namestring
status'document.draft' | 'document.sent' | 'document.completed' | 'document.uploaded' | 'document.error' | 'document.viewed' | 'document.waiting_approval' | 'document.approved' | 'document.rejected' | 'document.waiting_pay' | 'document.paid' | 'document.voided' | 'document.declined' | 'document.external_review' | 'document.scheduled'
date_createdstring
date_modifiedstring
expiration_datestring nullable
versionstring nullable
uuidstring
info_messagestring

Example response

{
  "id": "cKbJ7uay3cEGtsKuGPwYGX",
  "name": "API Sample Document from PandaDoc Template",
  "status": "document.draft",
  "date_created": "2021-10-08T11:06:32.337395Z",
  "date_modified": "2021-10-08T11:06:32.337395Z",
  "expiration_date": "2021-10-08T11:06:32.337395Z",
  "version": "EV2",
  "uuid": "cKbJ7uay3cEGtsKuGPwYGX",
  "links": [
    {
      "rel": "status",
      "href": "https://api.pandadoc.com/public/v1/documents/jzjCfYgKQYm2u9ctwN6io4",
      "type": "GET"
    }
  ],
  "info_message": "You need to poll the Document Status method until the status will be changed to document.draft"
}

Changes