> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/fix/snyk-pull-or-merge-requests/customize-pr-templates/examples-and-template-validation.md).

# Examples and template validation

Examples and validation for Snyk custom PR templates

## Examples of custom PR templates

The following example templates show how to use the variables in a PR template.

### API custom PR template example

```json
{
    "data": {
        "attributes": {
            "title": "[{{ snyk_pull_request_type }}] for {{ package_name }}",
            "commit_message": "{{ snyk_pull_request_type}}: for {{ package_name }}",
            "description": "Moving package {{ package_name }} from {{ package_from }} to {{ package_to }}\nFixes {{ issue_count }} issues\nFor more details see {{ snyk_project_url }}\nProject {{ snyk_project_name }}\nOrg {{ snyk_org_name }}"
        },
        "type": "pull_request_template"
    }
}
```

### YAML custom PR template example

```yaml
title: This PR fixes {{ issue_count }} issues
commitMessage: "fix: {{ issue_count }} Snyk issues"
description: |
  {{ #is_upgrade_pr }}
  This PR has been opened to make sure our repositories are kept up-to-date.
  It updates {{ package_name }} from version {{ package_from }} to version {{ package_to }}.
  Review relevant docs for possible breaking changes.
  {{ /is_upgrade_pr }}
  
  **Tickets**
  {{ #jira_ids }}
  - Fixes {{ . }}
  {{ /jira_ids }}
  
  To find more details, see the Snyk project [{{ snyk_project_name }}]({{ snyk_project_url }})
```

## Validate the custom PR template

You can validate the correctness of your template by following the steps described for each section.

### API template validation

For the API configuration, you can validate the correctness of your template by following these steps:

1. If an error response is returned, there are issues with the custom content. Fix the issues and wait to receive an API success response.
2. Open a PR and verify that your custom inputs are being used.

### YAML template validation

You can validate the correctness of your template by following these steps:

1. Add the template file to your Project (repository).
2. Open a PR and verify that your custom inputs are being used.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/scan-fix-and-prevent/fix/snyk-pull-or-merge-requests/customize-pr-templates/examples-and-template-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
