# Tag Validation Mode

1. Can be applied at the presentation level or slide level (the lowest level takes precedence).
2. Select between the two modes: [#strict](#strict "mention") or [#lenient](#lenient "mention")

### Strict

1. The system validates all tags defined in the payload.
2. If any tag is missing from the template.pptx, a `VALIDATION_ERROR` (400) is returned.

Reference: [tags](https://docs.powerpointgeneratorapi.com/json-template-syntax/tags "mention")

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1-ou1x1WjiEOmhxMj7jUss85hS85CkESc)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2FjluG40czoeDRsl6yyUPf%2Ftemplate.png?alt=media&#x26;token=69bccf5a-91b6-4d74-bb21-876331edd80b" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
  "presentation": {
    "template": "template.pptx",
    "tag_validation_mode": "strict",
    "slides": [
      {
        "slide_index": 0,
        "tags": [
          {
            "key": "non-existent-tag",
            "value": "ONE"
          },
          {
            "key": "date",
            "value": "TWO"
          },
          {
            "key": "client",
            "value": "THREE"
          },
          {
            "key": "type",
            "value": "FOUR"
          },
          {
            "key": "month",
            "value": "FIVE"
          }
        ]
      }
    ]
  }
}

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}

### Lenient

1. Missing tags are skipped without interrupting execution.
2. This mode is useful when working with templates that have optional placeholders or evolving structures.

Reference: [tags](https://docs.powerpointgeneratorapi.com/json-template-syntax/tags "mention")

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1VwMvF4DU16NoW37-n4MEQl7pFpeD0W6w) | [output.pptx](https://drive.google.com/uc?export=download\&id=1-thmVhz_GgRuLGKvAUM0_ZEMW-IpetxD)

{% columns %}
{% column width="41.66666666666667%" %}

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2FjluG40czoeDRsl6yyUPf%2Ftemplate.png?alt=media&#x26;token=69bccf5a-91b6-4d74-bb21-876331edd80b" alt=""><figcaption></figcaption></figure>

***

<figure><img src="https://1155212587-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgoqdluo05I2RXHZpTr-887967055%2Fuploads%2Fo0YAlCNZXNyqHn8fge4m%2Foutput.png?alt=media&#x26;token=8788fde3-e8f3-4436-b929-c8413505ce5a" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="58.33333333333333%" %}
{% code lineNumbers="true" %}

```json
{
  "presentation": {
    "template": "template.pptx",
    "tag_validation_mode": "lenient",
    "slides": [
      {
        "type": "slide",
        "slide_index": 0,
        "tags": [
          {
            "key": "non-existent-tag",
            "value": "ONE"
          },
          {
            "key": "date",
            "value": "TWO"
          },
          {
            "key": "client",
            "value": "THREE"
          },
          {
            "key": "type",
            "value": "FOUR"
          },
          {
            "key": "month",
            "value": "FIVE"
          }
        ]
      }
    ]
  }
}

```

{% endcode %}
{% endcolumn %}
{% endcolumns %}
