Log In

Create a Generated Document for a User

post/public/v1/users/{user}/generated-documents

Pass either template.id, to generate the document from one of the provider's user document templates, or content, to write the document's rich text (HTML) directly. Sending both, or neither, is rejected. A document generated from a Word template is finalised straight away; any other document is created as a draft.

  • Authorizationstringrequired

    Bearer authentication header of the form Bearer <token>, where <token> is your API key. See How to set up an API key.

  • userstringrequired

    The user UUID

Body

application/json
  • namestringrequiredmax length 255
  • templateobject
    ▶Show 1 child attributes
    • idstring
  • contentstringmax length 16777215

    Limited to 16777215 bytes.

Response

201application/json

GeneratedDocumentResource

  • dataobjectrequired
    ▶Show 9 child attributes
    • idstringrequired
      Example:g1e2n3d4-a5b6-47c8-9d0e-1f2a3b4c5d6e
    • namestringrequired
      Example:Support Plan - Jane Citizen
    • statusenum<string>required
      Available options:draftfinalised
    • typeenum<string>required
      Available options:rich_textword
    • template_namestring | nullrequired
      Example:Support Plan
    • contentstring | nullrequired
      Example:<p>Jane's goals for the next 12 months.</p>
    • finalised_atstring | nullrequired
      Example:2024-01-16T09:00:00+00:00
    • created_atstringrequired
      Example:2024-01-15T10:30:00+00:00
    • updated_atstringrequired
      Example:2024-01-15T11:05:00+00:00
  • 401Unauthenticated
  • 403Authorization error
  • 404Not found
  • 422Validation error