Generate a document from a submission
/submissions/{submission_id}/documentsRenders 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
The submission's id, a uuid. An unknown id, or a submission you cannot see, returns 404.
Request body
application/json, required
The attached form-template id to render.
Optional name for the generated document.
{
"template": "8e9f0102-3a4b-4c5d-9e6f-708192a3b4c5",
"name": "Subscription Agreement - Ada Lovelace.pdf"
}Responses
{
"jobId": "0b9d2c7e-1f3a-4c5b-8d6e-7f8091a2b3c4"
}Authorization failed. error.code is one of org_disabled,
ip_blocked, missing_scope, scope_disabled, user_disabled.
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).
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"
}'