# Compliance templates

Source: https://docs.settlemint.com/docs/developer-guides/api-integration/compliance-templates
Create, list, update, publish, and delete reusable compliance templates through the DALP API.



Compliance template endpoints let integrations manage reusable compliance policy patterns for asset creation. A template stores compliance modules, jurisdictions, required controls, draft or published status, and the compliance module generation the template belongs to.

Use these endpoints when an integration needs to prepare policy templates before operators create assets in the Asset Designer. For the operator workflow, see [Compliance templates](/docs/user-guides/compliance/templates).

## Endpoints [#endpoints]

The compliance template API exposes these endpoints:

| Endpoint                                                 | Use it for                                      |
| -------------------------------------------------------- | ----------------------------------------------- |
| `GET /api/v2/settings/compliance-templates`              | List compliance templates in the active tenant. |
| `POST /api/v2/settings/compliance-templates`             | Create a draft compliance template.             |
| `GET /api/v2/settings/compliance-templates/{id}`         | Read one compliance template.                   |
| `PUT /api/v2/settings/compliance-templates/{id}`         | Update a compliance template.                   |
| `PUT /api/v2/settings/compliance-templates/{id}/publish` | Publish a draft template for asset creation.    |
| `DELETE /api/v2/settings/compliance-templates/{id}`      | Delete a compliance template.                   |

Responses use the DALP single-resource or collection envelope with `data` and `links.self`.

## Create a draft template [#create-a-draft-template]

Create requests start a template in draft state. If you omit `moduleSetVersion`, DALP uses the current compliance module generation. Older clients may still send the deprecated `legacy` boolean; new integrations should send `moduleSetVersion` instead.

```bash
curl --request POST \
  "$DALP_API_URL/api/v2/settings/compliance-templates" \
  --header "X-Api-Key: $DALP_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "Global capital raise policy",
    "description": "Reusable capital raise controls for regulated assets",
    "jurisdictions": [],
    "moduleSetVersion": 2,
    "modules": [],
    "requiredControls": ["capital-raise-limit"]
  }'
```

The response includes the created template and a `links.self` path for the new resource.

## Update template configuration [#update-template-configuration]

Update requests can change the name, description, jurisdictions, modules, and required controls. They cannot change the template's module generation. If an integration needs a different generation, create a new template with the target `moduleSetVersion` and move the required modules or controls there.

DALP validates modules and required controls against the template generation on create, update, and publish. A current-generation template cannot save controls that only belong to a legacy module set. If the API returns a module-set compatibility error, remove the incompatible controls or create a template with the matching generation.

## Publish a template [#publish-a-template]

Publish the template when it is ready to appear in asset creation workflows:

```bash
curl --request PUT \
  "$DALP_API_URL/api/v2/settings/compliance-templates/$TEMPLATE_ID/publish" \
  --header "X-Api-Key: $DALP_API_TOKEN"
```

Publishing changes `isDraft` to `false`. Published templates can be selected during asset creation. Draft templates remain editable preparation records.

## List and filter templates [#list-and-filter-templates]

Use the list endpoint to find templates by search, draft status, system status, jurisdiction, or module generation. For example, request only current-generation draft templates when your integration is preparing a new policy set:

```bash
curl --globoff \
  "$DALP_API_URL/api/v2/settings/compliance-templates?filter[moduleSetVersion]=2&filter[isDraft]=true" \
  --header "X-Api-Key: $DALP_API_TOKEN"
```

Use the template returned by the API as the source of truth before you update it. Another operator or integration may have changed the template version or draft status since your last read.

## Related [#related]

* [Compliance modules](/docs/architecture/security/compliance)
* [Compliance templates user guide](/docs/user-guides/compliance/templates)
* [Asset creation with instrument templates](/docs/user-guides/asset-creation/instrument-templates)
* [DAPI error reference](/docs/developer-guides/api-integration/dapi-error-reference)
