Create a document

POST /api/v1/document

Headers

  • X-PLANNR-ACCOUNT-UUID string
application/json

Body Required

  • name string Required

    The name of the document.

  • client_uuids array[string] Required

    An array containing the client uuids that should be sent the document when it is built.

  • template_uuid string

    The UUID of the document template you want to be used with this document. You must not provide the sfdt or docx fields when creating from a template.

  • known_dependants array[string]

    Optional: The document variable dependants. Used to swap variables out for real data.

Responses

  • 201 application/json
    Hide response attributes Show response attributes object
    • uuid string

      The UUID of the resource.

    • created_at string

      The timestamp of when the resource was created.

    • updated_at string

      The timestamp of when the resource was updated.

    • version integer

      The document builder version. Used for internal purposes only. Defaults to 3

    • name string

      The name of the document.

    • status string

      The status of the document.

    • last_publishing_error string

      The last error that occured during publishing.

    • required_dependants object

      The required dependant variables of the document.

      Hide required_dependants attribute Show required_dependants attribute object
      • client-1 string
    • known_dependants object

      The dependants submitted to the document previously.

      Hide known_dependants attribute Show known_dependants attribute object
      • client-1 string
    • public_docx_url string

      The download URL of the DOCX content. This is intended for the user to download if they are signed into Plannr. You can access this data via the API using the route in /api/v1.

    • public_sfdt_url string

      The download URL of the SFDT (SyncFusion) content. This is intended for the user to download if they are signed into Plannr. You can access this data via the API using the route in /api/v1.

    • public_pdf_url string

      The download URL of the PDF content. This is intended for the user to download if they are signed into Plannr. You can access this data via the API using the route in /api/v1.

    • public_preview_url string

      The image preview URL of the document. This is intended for the user to preview the document before opening it. You can access this data via the API using the route in /api/v1.

POST /api/v1/document
curl \
 --request POST 'https://api.plannrcrm.com/api/v1/document' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --header "X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}" \
 --data '{"name":"Client Service Agreement","client_uuids":["1c209bf4-7fae-4592-9751-ed527fe3f1f5","8da8d2b0-c3ff-4a80-a5c7-26e936c802af"],"template_uuid":"375ba3fb-7aec-499b-9f3b-7a6d861b336e","known_dependants":[{"client-1":"29edb695-d4c5-4ab9-8a68-26b90e422ccd"}]}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}

# Payload
{
  "name": "Client Service Agreement",
  "client_uuids": [
    "1c209bf4-7fae-4592-9751-ed527fe3f1f5",
    "8da8d2b0-c3ff-4a80-a5c7-26e936c802af"
  ],
  "template_uuid": "375ba3fb-7aec-499b-9f3b-7a6d861b336e",
  "known_dependants": [
    {
      "client-1": "29edb695-d4c5-4ab9-8a68-26b90e422ccd"
    }
  ]
}
Response examples (201)
{
  "name": "Welcome Template",
  "uuid": "c522ff2f-7ebc-4ead-8e3c-481a50c0e087",
  "status": "published",
  "version": 3,
  "created_at": "2025-06-26T11:37:07+01:00",
  "updated_at": "2025-06-26T11:37:07+01:00",
  "public_pdf_url": "https://api.plannrcrm.com/document/09b8e77b-057b-4918-933a-fde3db4f0654/content/pdf?plannr_account_uuid=1f27b370-5ce7-4475-b633-c8a9b48518d6",
  "public_docx_url": "https://api.plannrcrm.com/document/d90e73c2-269a-4eb3-b66e-70000098f2f7/content/docx?plannr_account_uuid=0ece6ca1-9baf-4a90-9780-3e53478b5ad1",
  "public_sfdt_url": "https://api.plannrcrm.com/document/6ed66e6e-e1d8-454b-9580-97032b42a802/content/sfdt?plannr_account_uuid=fa359178-b321-49fb-b671-bf29f5947350",
  "known_dependants": {
    "client-1": "2e137f15-c203-40d3-91a1-79f6c2fd7bd1"
  },
  "public_preview_url": "https://api.plannrcrm.com/document/1c441907-891d-4383-8487-55fe4cd0c758/content/preview?plannr_account_uuid=91678a53-b534-456d-bccf-2a27a7c78085",
  "required_dependants": {
    "client-1": "client"
  },
  "last_publishing_error": "There was an error converting this file to PDF. Please try again later."
}