v1

latestOpenAPI 3.0.3MIT2026-07-24122271451.2 KB
Documents

Update Document

Use the PATCH method to update a PandaDoc document.

🚧 Document status

You can only update a document in the Draft status (document.draft).

After creating a new document, it usually retains a document.uploaded status for 3-5 seconds while the document syncs across PandaDoc servers. When the document is available for further API calls, the document moves to the document.draft state. Use Document Status or Webhooks to check document status.

patch/public/v1/documents/{id}

Path parameters

idstring required

Document ID

Request body

namestring

The name of the document.

fieldsDocumentUpdateRequestField

Set specific values to the fields. This object maps merge field names to their corresponding values.

Each key represents a merge field name, and each value is an object containing the data to populate that field with. The structure allows you to pre-populate various field types including text inputs, checkboxes, dropdowns, and date fields.

Key Points:

  • Keys must match the exact merge field names from your template or file.
  • Values must be wrapped in an object with a value property.
  • Supported value types: string, number, boolean.
  • Date fields should use RFC 3339 format (e.g., '2019-12-31T00:00:00.000Z').
  • Signature fields cannot be pre-filled.

Example Usage:

  • Text field: "CustomerName": {"value": "John Doe"}
  • Checkbox: "AgreeToTerms": {"value": true}
  • Date field: "DeliveryDate": {"value": "2019-12-31T00:00:00.000Z"}
tagsstring[]

Mark your document with one or several tags.

metadataobject

You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. If metadata exists in a document then the value will be updated. Otherwise, metadata will be added to the document.

Example request

{
  "name": "Contract",
  "recipients": [
    {
      "email": "josh@example.com",
      "phone": "+14842634627",
      "first_name": "Josh",
      "last_name": "Ron",
      "id": "ZPeAfcpzr9aiVs5vqUf6jg",
      "redirect": {
        "url": "https://example.com"
      },
      "type": "recipient",
      "signing_order": 1
    }
  ],
  "fields": {
    "Like": {
      "value": true
    },
    "Delivery": {
      "value": "Same Day Delivery"
    },
    "Date": {
      "value": "2019-12-31T00:00:00.000Z"
    }
  },
  "tokens": [
    {
      "name": "Favorite.Pet",
      "value": "Panda"
    }
  ],
  "tags": [
    "updated_via_api",
    "test_document"
  ],
  "metadata": {
    "my_favorite_pet": "Cat"
  },
  "pricing_tables": [
    {
      "name": "Pricing Table 1",
      "options": {
        "currency": "USD",
        "Discount": {
          "type": "absolute",
          "name": "Global Discount",
          "value": 10
        },
        "Tax": {
          "type": "percent",
          "name": "Tax First",
          "value": 15
        }
      },
      "sections": [
        {
          "title": "Sample Section",
          "rows": [
            {
              "data": {
                "Name": "Toy Panda",
                "Description": "Fluffy",
                "Price": 10,
                "Cost": 8.5,
                "QTY": 3,
                "SKU": "toy_panda",
                "Discount": {
                  "value": 10,
                  "type": "percent"
                },
                "Tax": {
                  "value": 10,
                  "type": "percent"
                }
              },
              "custom_fields": {
                "Fluffiness": "5/5"
              }
            }
          ]
        }
      ]
    }
  ],
  "images": [
    {
      "urls": [
        "https://s3.amazonaws.com/pd-static-content/public-docs/pandadoc-panda-bear.png"
      ],
      "name": "Image 1"
    }
  ],
  "texts": [
    {
      "name": "Legal Terms Section",
      "data": "## Terms of Service\nThis document outlines the terms and conditions. \n- **Acceptance:** By using our service, you agree to these terms.\n- **Changes:** We may update these terms at any time.\n"
    }
  ]
}

Response

No content