> ## 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.

# Credential presets

> The cornerstone primitive for credential issuance: format, attributes, and disclosure rules.

A **credential preset** is a published, ready-to-use credential shape: its format, attributes, and disclosure rules. Once published, anyone issuing the credential refers to it by its identifier (something like `acme:degree-certificate` or `didx:basic-identity`).

To issue a credential, you pick a preset and supply the per-recipient values for the attributes it declares. Think of the preset as a blank form: the fields, types, required markers, and disclosure rules are all baked in. Issuance is filling that form in for a specific person, and the platform stamping it with a cryptographic signature. The signed, filled-in form is the credential the user holds in their wallet.

## Identifier and metadata

The metadata that identifies a preset is the same regardless of credential format:

| Field                 | What it is                                                                                                                                                                                                      |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                  | Canonical preset identifier (`<author>:<code>`). This is what issuers pass as `presetId`.                                                                                                                       |
| `author`              | The publisher's tenant alias.                                                                                                                                                                                   |
| `code`                | The slug part of the id, set at creation. Together with `author`, it uniquely identifies the preset.                                                                                                            |
| `templateName`        | Human-readable label shown to issuers browsing the catalogue, and shown to holders in their wallet.                                                                                                             |
| `templateDescription` | One- or two-line summary of what the credential is for.                                                                                                                                                         |
| `credentialFormat`    | The wire format of the issued credential: `sd-jwt` (selective-disclosure JWT) or `mdoc` (ISO 18013-5 mDL). Determines which sub-resource the preset lives under, and which schema the rest of the body follows. |

Once published, a preset is immutable; the identifier you choose at creation lives forever. Choose the slug carefully.

## Two formats, two shapes

The rest of the preset's body — `templateAttributes`, `templateType`, `issuerConfig`, `validUntil` — differs significantly between SD-JWT and mDoc. The two formats use different attribute structures, different signer options, and different validity rules. Each format gets its own anatomy page; pick the one that matches the credential you're working with:

<CardGroup cols={2}>
  <Card title="Anatomy of an SD-JWT credential preset" icon="file-lines" href="/products/didx-me/guides/issuers/sd-jwt-credential-preset-anatomy">
    The default for most credentials. Selective disclosure built in, wide wallet support.
  </Card>

  <Card title="Anatomy of an mDoc credential preset" icon="id-card" href="/products/didx-me/guides/issuers/mdoc-credential-preset-anatomy">
    For ISO 18013-5 credentials such as mobile driving licences and government-issued ID.
  </Card>
</CardGroup>

## Format-specific endpoints

Because the two shapes differ, the API exposes a separate sub-resource per format. Use the one that matches the credential format you're working with:

| Operation   | SD-JWT                                | mDoc                                | Generic                        |
| ----------- | ------------------------------------- | ----------------------------------- | ------------------------------ |
| Create      | `POST /presets/credentials/sd-jwt`    | `POST /presets/credentials/mdoc`    | `POST /presets/credentials`    |
| List        | `GET /presets/credentials/sd-jwt`     | `GET /presets/credentials/mdoc`     | `GET /presets/credentials`     |
| Fetch by id | `GET /presets/credentials/sd-jwt/:id` | `GET /presets/credentials/mdoc/:id` | `GET /presets/credentials/:id` |

Prefer the **format-specific** endpoints in normal use: each accepts and returns a single, format-shaped schema with no discriminated union to navigate. The **generic** endpoints accept either format (discriminated by `credentialFormat` in the body) and exist for backwards compatibility. Credential templates follow the same split.

## Three paths

<CardGroup cols={3}>
  <Card title="Browse a credential preset" icon="magnifying-glass" href="/products/didx-me/guides/issuers/browse-credential-presets">
    Find a preset already published by DIDx or another publisher and issue against it. No setup, no design work.
  </Card>

  <Card title="Create an SD-JWT preset" icon="pen-to-square" href="/products/didx-me/guides/issuers/create-sd-jwt-credential-preset">
    Publish your own SD-JWT credential shape so it can be issued by name.
  </Card>

  <Card title="Create an mDoc preset" icon="pen-to-square" href="/products/didx-me/guides/issuers/create-mdoc-credential-preset">
    Publish your own mDoc credential shape so it can be issued by name.
  </Card>
</CardGroup>

## When a preset isn't enough

If no preset matches your use case, you can define a one-off [custom credential template](/products/didx-me/guides/issuers/create-credential-template) instead. This is the exception, not the rule; most integrations don't need it.
