# Shape validation mode

1. Can be applied at the presentation 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 shapes defined in the payload.
2. If any shape is missing from the `template.pptx`, a `VALIDATION_ERROR` (400) is returned.

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

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

{% 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%2FTxk63WQ44tKrzcfIH2Mh%2Ftemplate.png?alt=media&#x26;token=bcf5452a-5ef8-475b-85f1-e193d7d431dc" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

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

```json
{
    "presentation": {
        "template": "template.pptx",
        "shape_validation_mode": "strict",
        "slides": [
            {
                "slide_index": 0,
                "shapes": [
                    {
                        "name": "TextBox 1",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 500",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 600",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 4",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    }
                ]
            }
        ]
    }
}
```

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

### Lenient

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

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

Download: [input.zip](https://drive.google.com/uc?export=download\&id=1E8ofueM6hVMXGxFxta2TIA7aAK00eTGu) | [output.pptx](https://drive.google.com/uc?export=download\&id=1rx-KPV1rLxC7pSkYZWP793z52d5DRI5f)

{% 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%2F3be2UQCIL4g3g8byj6yH%2Ftemplate.png?alt=media&#x26;token=a47533a6-0bb0-43d2-945b-4e886eba65de" 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%2FPfgawGqBmmpNJqRx0Lw5%2Foutput.png?alt=media&#x26;token=21bcb99c-131a-4bfe-ab4a-9bd5a1dc1f8e" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

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

```json
{
    "presentation": {
        "template": "template.pptx",
        "shape_validation_mode": "lenient",
        "slides": [
            {
                "slide_index": 0,
                "shapes": [
                    {
                        "name": "TextBox 1",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 500",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 600",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    },
                    {
                        "name": "TextBox 4",
                        "text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
                    }
                ]
            }
        ]
    }
}
```

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerpointgeneratorapi.com/examples/shape/shape-validation-mode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
