> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didx.co.za/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom presentation template (advanced)

> Define your own presentation request shape when no preset fits.

<Note>
  **Most integrations don't need this page.** If you can verify using a published preset, do that. See [Create a
  presentation request](/products/didx-me/guides/verifiers/create-presentation-request). Custom presentation templates
  are for cases where you need to verify a credential shape that no preset covers, or layer on your own trusted-issuer
  rules.
</Note>

## Overview

A presentation template specifies what credentials and attributes you want to verify, and which issuers' credentials count as proof. The `type` field in the template must match the `type` from a credential template that was used during issuance; this is how the system knows which credentials to request from the user's wallet.

Use a custom template when:

* You're verifying a credential type that isn't in the public preset catalogue.
* You need a trust list specific to your tenant (issuers you've onboarded yourself, not visible to anyone else).
* You want to combine multiple credential types in one request in a way no preset offers.

### Trust works one level lower than in presets

In a preset, `trustedIssuers` is described in real-world terms (DIDs, x509 certificates) and the platform resolves them to your tenant's records when you use the preset.

In a custom template, you reference your tenant's [trusted-entity records](/products/didx-me/guides/verifiers/trusted-entities) **by id**. These are the same records the preset path would create for you, but you create and manage them explicitly. Before authoring the template, register the entities you'll reference; the response includes the tenant-scoped record ids that go into `trustedIssuers`.

## Endpoint

```
POST https://test.didxtech.com/me-creds/api/v1/templates/presentations
```

## Request

```bash theme={null}
curl -X POST "https://test.didxtech.com/me-creds/api/v1/templates/presentations" \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Basic Identity Verification",
    "description": "Verify the user'\''s first name and last name",
    "credentials": [
      {
        "name": "Basic Identity",
        "description": "First name and last name",
        "type": "https://didx.co.za/vct/didx/basic-identity",
        "attributes": {
          "firstName": { "type": "string" },
          "lastName":  { "type": "string" }
        },
        "trustedIssuers": [
          "cm7d9cq5600pwk3zq3kmpg8uc"
        ]
      }
    ]
  }'
```

### Request body

| Field                          | Type             | Description                                                                                                                    |
| ------------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `name`                         | string           | Name for this presentation template                                                                                            |
| `description`                  | string           | Description of what this template verifies                                                                                     |
| `credentials`                  | array            | List of credential types to request                                                                                            |
| `credentials[].type`           | string           | Must match the `type` URI from the issuer's credential template                                                                |
| `credentials[].attributes`     | object           | The specific attributes to request from the credential                                                                         |
| `credentials[].trustedIssuers` | array of strings | Trusted-entity record ids whose issuers count as proof, e.g. `["cm7d9cq5600pwk3zq3kmpg8uc"]`. Optional, but see warning below. |

<Note>
  The `type` field must be the full URI from the issuer's credential template response (e.g.
  `https://didx.co.za/vct/didx/basic-identity`), not the short name used during template creation.
</Note>

<Warning>
  **Empty or omitted `trustedIssuers` means any issuer is trusted.** Without an explicit list, a valid signature from
  *any* issuer of this credential type will verify. Always populate `trustedIssuers` with the entity ids you actually
  trust before going to production. To get those ids, see [Trusted
  entities](/products/didx-me/guides/verifiers/trusted-entities).
</Warning>

## Response

**HTTP 200 OK**

```json theme={null}
{
  "data": {
    "name": "Basic Identity Verification",
    "description": "Verify the user's first name and last name",
    "createdAt": "2025-02-20T11:27:37.051Z",
    "updatedAt": "2025-02-20T11:27:37.051Z",
    "id": "cm2ytsdid009u4ke3t30aiuvc",
    "credentials": [
      {
        "name": "Basic Identity",
        "description": "First name and last name",
        "format": "sd-jwt-vc",
        "type": "https://didx.co.za/vct/didx/basic-identity",
        "attributes": {
          "firstName": { "type": "string" },
          "lastName": { "type": "string" }
        }
      }
    ]
  },
  "links": {
    "self": "https://test.didxtech.com/me-creds/api/v1/templates/presentations/tpl_6421a8905c17830c188e2e2f"
  },
  "meta": {
    "version": "1.0"
  }
}
```

### Key response fields

| Field    | Description                                                                             |
| -------- | --------------------------------------------------------------------------------------- |
| `id`     | Unique template identifier. Pass it as `presentationTemplateId` when creating a request |
| `format` | The credential format the template uses (e.g. `sd-jwt-vc`)                              |

<Tip>
  Presentation templates are reusable. Create one template and use it for multiple verification requests; save the `id`
  for [Create a presentation request](/products/didx-me/guides/verifiers/create-presentation-request).
</Tip>
