---
title: "Generate documents for selected employments"
method: POST
path: "/v2/providers/employers/{employerId}/documenttemplates/{documentId}/generatedocuments"
tags: ["Generate document"]
---

# Generate documents for selected employments

`POST /v2/providers/employers/{employerId}/documenttemplates/{documentId}/generatedocuments`

## Request

- Base URL: `https://api.loket.nl`
- URL: `https://api.loket.nl/v2/providers/employers/{employerId}/documenttemplates/{documentId}/generatedocuments`
- Auth: none required

__Activity name :__ <a href="https://developer.loket.nl/Activities/PostGenerateDocumentsByEmployerIdAndDocumentId" target="_blank">PostGenerateDocumentsByEmployerIdAndDocumentId</a>

__Metadata:__ Available templates can be acquired(GET) at Employer level(/v2/v2/providers/employers/{employerId}/documenttemplates/generatedocument/metadata).

Generate documents for a selection of employments and store it in the employment dossier. Via Qwoater. (One document is generated and stored for each selected employment)

## Path parameters

- `employerId` string, uuid, required
- `documentId` string, required

## Headers

- `Authorization` string, required
- `Accept` string, required

## Request body

- DocumentPostWithEmployments
  - `description` string: The description defined by the submitter. Qwoater: Docfield 33 Omschrijving
  - `year` integer, nullable: The year the document relates to. Qwoater: Docfield 86 Jaar
  - `attribute` string, nullable: The attribute defined by the submitter. Qwoater: Docfield 32 Kenmerk
  - `dateOfAlert` string, date, nullable: The date at which document will alerted for cancellation. Qwoater: AlertDate
  - `filename` string: The name of the file. Qwoater: Filename
  - `templateEmployerId` string, uuid: The unique identifier of the employer to which the template belongs (GUID/UUID).
  - `referenceDate` string, date: This date will be used to select date depending data such as department and function.
  - `sendEmailNotification` boolean, nullable: Indicate whether to send an email to the employees.
  - `employmentIds` string[]

## Response `202`

OK. The process of generating documents has started.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/loket/apis/loket-api.md) - [All operations](https://skmtc.dev/loket/apis/loket-api/llms.txt) - [OpenAPI document](https://skmtc.dev/loket/apis/loket-api/revisions/32170564148f?raw)
