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

# Certificate Templates

> Create and manage reusable certificate design templates.

# Certificate Templates

Certificate templates define the visual design of certificates — layout, typography, and graphical elements. Templates are reusable: one template can be applied to thousands of certificates. They are linked to an institution and optionally configured via Canva for visual editing.

***

## The certificate template object

```json theme={null}
{
  "uuid": "i9j0k1l2-m3n4-5678-opqr-789012345678",
  "name": "Undergraduate Diploma 2024",
  "version": "1.0",
  "path": "templates/diploma-2024.pdf",
  "preview_image_path": "templates/previews/diploma-2024.png",
  "canva_config": null,
  "is_default": true,
  "status": "active",
  "institution": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Federal University of Technology"
  }
}
```

| Field                | Type         | Description                                              |
| -------------------- | ------------ | -------------------------------------------------------- |
| `uuid`               | string       | Unique identifier                                        |
| `name`               | string       | Template display name                                    |
| `version`            | string       | Version identifier                                       |
| `path`               | string       | Internal file path of the template                       |
| `preview_image_path` | string\|null | Path to the preview image                                |
| `canva_config`       | json\|null   | Canva design configuration object                        |
| `is_default`         | boolean      | Whether this is the default template for the institution |
| `status`             | enum         | `active`, `inactive`                                     |

***

## List templates

```http theme={null}
GET /certificate-templates
```

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.dokstamp.com/certificate-templates?where[status]=active" \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "X-Tenant: {TENANT}"
  ```
</CodeGroup>

***

## Create a template

```http theme={null}
POST /certificate-templates
```

| Parameter            | Type    | Required | Description                               |
| -------------------- | ------- | -------- | ----------------------------------------- |
| `name`               | string  | Yes      | Template name                             |
| `version`            | string  | Yes      | Version string                            |
| `institution_uuid`   | string  | Yes      | Parent institution UUID                   |
| `path`               | string  | Yes      | File path of the template document        |
| `preview_image_path` | string  | No       | Preview image path                        |
| `canva_config`       | object  | No       | Canva design configuration                |
| `is_default`         | boolean | No       | Set as the institution's default template |
| `status`             | enum    | No       | `active` (default), `inactive`            |

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.dokstamp.com/certificate-templates \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Tenant: {TENANT}" \
    -d '{
      "name": "Undergraduate Diploma 2024",
      "version": "1.0",
      "institution_uuid": "550e8400-e29b-41d4-a716-446655440000",
      "path": "templates/diploma-2024.pdf",
      "is_default": true,
      "status": "active"
    }'
  ```
</CodeGroup>

***

## Get, update, delete

```http theme={null}
GET    /certificate-templates/{uuid}
PATCH  /certificate-templates/{uuid}
PUT    /certificate-templates/{uuid}
DELETE /certificate-templates/{uuid}
DELETE /certificate-templates/batch/destroy
```

***

## Using a template when issuing certificates

Pass the `template_uuid` when creating a certificate:

```json theme={null}
{
  "template_uuid": "i9j0k1l2-m3n4-5678-opqr-789012345678",
  ...
}
```

If `template_uuid` is omitted and the institution has a default template (`is_default: true`), the default is applied automatically.
