---
title: "Execute Module"
method: PUT
path: "/modules/{moduleId}/execute"
tags: ["Modules"]
---

# Execute Module

`PUT /modules/{moduleId}/execute`

## Request

- Base URL: `https://env.unqork.io/api/1.0`
- URL: `https://env.unqork.io/api/1.0/modules/{moduleId}/execute`
- Auth: OAuth 2
  - Client credentials
  - Password
  - Token URL: `https://xyzfinancial.unqork.io/api/1.0/oauth2/access_token`
- TypeScript: <https://skmtc.dev/unqork/apis/unqork-customer-api/docs/modules/:moduleId/execute/put.ts> (a function with typed inputs; its response is checked against the schema)

Execute module rules/validations configured in specified module with specified submission data, optionally save data. The response will include the saved submission data that would be available in the specified module.
### Authorization Required:
  - Designer Administrator or Express Read

## Path parameters

- `moduleId` string, required

## Request body

- ModuleExecuteRequest
  - `submissionId` string: ID of module submission to use. If `submissionId` is unspecified and `save` is specified, a new submission will be created with `moduleId` as the module being executed and `userId` as the user making the request.
  - `data` object: Raw data to include in submission data when executing (and saving, if specified).
  - `metadata` MetadataRequest: Object containing key-value pairs. To set nested values, this must be an object like `{"statuses.complete": "yes", "statuses.processed": "no"}`, which is MongoDB [dot notation](https://docs.mongodb.com/manual/core/document/#dot-notation).
  - `validate` boolean: Whether or not to validate submission data post-execution.
  - `save` boolean: Whether to save data for the existing submission (or create a new submission) after execution. Data will never be saved when an execution error is encountered.
  - `saveOnValidationError` boolean: If set to `true` (and both save and validate are also set to `true`), will save and send back a 2xx response, even if validation errors occurred.
  - `hydrateDataInitially` boolean: If set to `true`, will fully populate data object before module begins execution.

## Response `200`

Submission executed

- ModuleExecuteResponse
  - `id` string
  - `userId` string: Submission owner
  - `moduleId` string
  - `created` string, date-time
  - `modified` string, date-time
  - `deleted` string, date-time
  - `data` object: Raw output data
    - `rawData` object: Saved submission data
    - `resolved` object: Submission data resulting from execution
  - `metadata` object
  - `validationErrors` object[]
    - `id` string
    - `path` string
    - `label` string
    - `parent` string
    - `message` string
  - `invalidNavigationPanels` object[]
    - `key` string
    - `label` string

## Other responses

- `412`: Validation and/or execution error
- `2XX`: Custom HTTP status code if set by server side execution for API modules
- `4XX`: Custom HTTP status code if set by server side execution for API modules
- `5XX`: Custom HTTP status code if set by server side execution for API modules
- `default`: Error

---

[API](https://skmtc.dev/unqork/apis/unqork-customer-api.md) - [All operations](https://skmtc.dev/unqork/apis/unqork-customer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unqork/apis/unqork-customer-api/revisions/13dad4096373?raw)
