Add Module Template Block
POST /moduleTemplates/{moduleTemplateId}/blocks
/moduleTemplates/{moduleTemplateId}/blocksRequired Tokens
| Field | Type | Required | Description |
|---|---|---|---|
| Bearer | Authorization: Bearer <api-key> | Optional | Your API key. Pass it as the Bearer token on every request. |
| Event token | x-Event-Token | Optional | Run **Get Tokens** in the Authorization folder, or call `GET /Events/{eventId}/authorize` manually. |
Adds a block to a module template. Blocks are the building blocks of a module and come in three types: Content, Question, and Request. Only the field corresponding to the block's type should be populated — the others should be null.
New blocks are appended to the end of the module's block list. Use Update Module Template Block Index to reorder after adding.
Returns 201 Created with no body on success.
Event scoping: These endpoints do not include {eventId} in the URL. The event is determined automatically from your x-Event-Token — the API uses it to know which event's data to return. Ensure you have a valid event token before making any calls in this folder.
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| moduleTemplateId | Guid | Required | The ID of the module template to add the block to. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | Required | Block type: `Content`, `Question`, or `Request`. |
| contentBlock | object \ | Optional | ✔️ if `type` is `Content` |
| questionBlock | object \ | Optional | ✔️ if `type` is `Question` |
| requestBlock | object \ | Optional | ✔️ if `type` is `Request` |
Content Block
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Required | HTML/rich text content to display. |
Question Block
| Field | Type | Required | Description |
|---|---|---|---|
| label | string | Required | Short label for the question. |
| questionText | string | Required | Full question text shown to the collaborator. |
| responseType | string | Required | Expected response format. See valid values below. |
| responseOptions | array | Optional | Required for `Select`/`MultiSelect`. Not allowed for other types. Each option has `label`, `type` (`Text`, `Number`, or `Date`), and `value`. |
Valid responseType values:
Select, MultiSelect, Text, RichText, Number, Date, DateTime, Checkbox, Link, File, MultiFile, Image
Request Block
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Required | Name of the request. |
| lineItemLabel | string | Required | Display label used throughout the app wherever this request appears as a line item (orders, procurements, tables). Supports variable injection — you can embed dynamic values using `{{variableName}}` syntax alongside plain text. |
| isAdvanceApproved | bool | Required | Whether advance-side approval is required. |
| isResourceApproved | bool | Required | Whether resource-side approval is required. |
| isAssetRequest | bool | Required | Whether fulfilling this request links an asset. |
| allowedAssetTypes | array | Optional | List of asset type IDs (Guids) allowed for this request. Required when `isAssetRequest` is `true`. |
| properties | array | Optional | Custom properties the collaborator fills in for this request. Each has `label`, `isRequired`, `responseType` (same valid values as question `responseType`), and optional `responseOptions` (for `Select`/`MultiSelect`). |
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid token. |
NOT_FOUND | 404 | Module template not found for this event. |
BAD_REQUEST | 400 | Invalid block type or missing required block fields. |