Forms

Generate a document from a submission

POST/submissions/{submission_id}/documents
forms:writegenerate_submission_documentDeprecatedSunset 2027-06-30

Renders a document from the submission against an attached form template. Rendering can be long-running, so the request returns 202 Accepted with a jobId and the work is enqueued. Poll GET /v2/jobs/{id} to follow progress; the finished document appears on GET /submissions/{submission_id}/documents. A template that is not attached to the submission's form returns 422. Deprecated: withdrawn on 2027-06-30. POST /submissions/{id}/actions/generate-documents replaces it; the Link header names it.

Path parameters

  • submission_idstring (uuid)Required#

    The submission's id, a uuid. An unknown id, or a submission you cannot see, returns 404.

Request body

application/json, required

  • templatestring (uuid)Required#

    The attached form-template id to render.

  • namestring | null#

    Optional name for the generated document.

{
  "template": "8e9f0102-3a4b-4c5d-9e6f-708192a3b4c5",
  "name": "Subscription Agreement - Ada Lovelace.pdf"
}

Responses

202

Accepted - the document-generation job has been enqueued.

JobAccepted
{
  "jobId": "0b9d2c7e-1f3a-4c5b-8d6e-7f8091a2b3c4"
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
422

Request validation failed (HTTP 422). The body is either the Laravel validation envelope (message + field-keyed errors) or the API error envelope for domain rejections (e.g. form_type_not_supported, folder_locked, parent_not_found, folder_not_empty).

429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/submissions/{submission_id}/documents\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "template": "8e9f0102-3a4b-4c5d-9e6f-708192a3b4c5",
  "name": "Subscription Agreement - Ada Lovelace.pdf"
}'