Create a document

POST /api/v1/document

Headers

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.

  • 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.

    • The timestamp of when the resource was created.

    • 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.

    • The required dependant variables of the document.

    • The dependants submitted to the document previously.

    • 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.

    • 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.

    • 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.

    • 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 \
 -X POST https://api.plannrcrm.com/api/v1/document \
 -H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 -H "X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}" \
 -d '{"name":"Client Service Agreement","client_uuids":["07341289-4494-46cd-88fd-881222c73e82","3ac07adf-a84f-4051-a771-3af9326fc10c"],"template_uuid":"8c0ba5fb-f454-4591-ab97-76d5fa79a3ba","known_dependants":[{"client-1":"7727a4d1-074b-4468-ac05-5e098403f52d"}]}'
Request examples
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}

# Payload
{
  "name": "Client Service Agreement",
  "client_uuids": [
    "07341289-4494-46cd-88fd-881222c73e82",
    "3ac07adf-a84f-4051-a771-3af9326fc10c"
  ],
  "template_uuid": "8c0ba5fb-f454-4591-ab97-76d5fa79a3ba",
  "known_dependants": [
    {
      "client-1": "7727a4d1-074b-4468-ac05-5e098403f52d"
    }
  ]
}
Response examples (201)
{
  "name": "Welcome Template",
  "uuid": "cca376ea-ff20-4b7f-946f-3df3355e2d36",
  "status": "published",
  "version": 3,
  "created_at": "2024-10-16T11:10:15+01:00",
  "updated_at": "2024-10-16T11:10:15+01:00",
  "public_pdf_url": "https://plannr.valet/document/6b297b72-f9d7-4b71-b2ab-5f4879eee52f/content/pdf?plannr_account_uuid=1997310a-4250-455e-8115-90f6e3c07516",
  "public_docx_url": "https://plannr.valet/document/a45926e3-337f-4387-8d25-bf8a045ecf41/content/docx?plannr_account_uuid=429f7aa6-d8f3-426f-998e-c8050b84c5d7",
  "public_sfdt_url": "https://plannr.valet/document/7483ccfb-f25d-4b7a-8c48-7c32e77f7906/content/sfdt?plannr_account_uuid=f02d5554-dc8c-4e54-91e3-f56c3ed34e47",
  "known_dependants": {
    "client-1": "26577a1a-1b81-4615-bc2f-5becf55203ea"
  },
  "public_preview_url": "https://plannr.valet/document/4cab80cf-4e4a-4df3-a017-89870b6649bc/content/preview?plannr_account_uuid=7f2e56e7-26c2-4c5f-9213-07dc71afcff6",
  "required_dependants": {
    "client-1": "client"
  }
}