# Templates

## Retrieve the templates the verifier is working with

> Returns a collection of templates that the client can use and send to the verifier endpoints.\<hr />\*\*Claim-based access control:\*\* \<code>Verifier\_Admin\</code>, \<code>Verifier\_User\</code>, \<code>Verifier\_Auditor\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Verifier Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Verifier Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/verifier/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"WebappTemplatesDetailDto":{"type":"object","properties":{"definitionName":{"type":"array","items":{"type":"array"}},"definitionId":{"type":"string"},"definition":{"$ref":"#/components/schemas/WebappTemplateDefinitionDetailDto"}}},"WebappTemplateDefinitionDetailDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebappTemplateDefinitionSchemaDetailDto"}}}},"WebappTemplateDefinitionSchemaDetailDto":{"type":"object","properties":{"uri":{"type":"string"}},"required":["uri"]}}},"paths":{"/private/webapp/templates":{"get":{"operationId":"AgentWebappController_webappTemplates","summary":"Retrieve the templates the verifier is working with","description":"Returns a collection of templates that the client can use and send to the verifier endpoints.<hr />**Claim-based access control:** <code>Verifier_Admin</code>, <code>Verifier_User</code>, <code>Verifier_Auditor</code>","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebappTemplatesDetailDto"}}}}},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"503":{"description":"The agent service is unavailable"}},"tags":["Templates"]}}}}
```

## Create a new dynamic presentation definition

> Enables the use of dynamic presentation definitions. The presentation definition is a JSON object that defines the rules the clients need to follow in order to produce a valid verifiable presentation.\<hr />\*\*Claim-based access control:\*\* \<code>Verifier\_Admin\</code>, \<code>Verifier\_User\</code>, \<code>Verifier\_Auditor\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Verifier Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Verifier Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/verifier/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"WebappPresentationDefinitionBodyCreateDto":{"type":"object","properties":{"definitionName":{"type":"string"},"credentials":{"type":"array","items":{"$ref":"#/components/schemas/WebappPresentationDefinitionCredentialBodyRowDto"}}},"required":["definitionName","credentials"]},"WebappPresentationDefinitionCredentialBodyRowDto":{"type":"object","properties":{"credentialId":{"type":"string"},"fields":{"type":"object"}},"required":["credentialId","fields"]},"WebappPresentationDefinitionDetailDto":{"type":"object","properties":{"definitionId":{"type":"string","description":"The definitionId defines the credential to ask for, eg: emailCredential. The value should start with lowercase and continue using camelCase pattern"}}}}},"paths":{"/private/webapp/presentation-definitions":{"post":{"operationId":"AgentWebappController_webappPresentationDefinitions","summary":"Create a new dynamic presentation definition","description":"Enables the use of dynamic presentation definitions. The presentation definition is a JSON object that defines the rules the clients need to follow in order to produce a valid verifiable presentation.<hr />**Claim-based access control:** <code>Verifier_Admin</code>, <code>Verifier_User</code>, <code>Verifier_Auditor</code>","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebappPresentationDefinitionBodyCreateDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebappPresentationDefinitionDetailDto"}}}},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"503":{"description":"The agent service is unavailable"}},"tags":["Templates"]}}}}
```

## Returns a list of presentation definition templates and their required fields.

> Returns a list of presentation definition templates and their required fields. The templates are used when creating a new presentation definition and checked against the required fields to ensure that the presentation definition is valid.\<hr />\*\*Claim-based access control:\*\* \<code>Verifier\_Admin\</code>, \<code>Verifier\_User\</code>, \<code>Verifier\_Auditor\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Verifier Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Verifier Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/verifier/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"WebappPresentationDefinitionsTemplatesDetailDto":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/TemplateRowDto"}}},"required":["templates"]},"TemplateRowDto":{"type":"object","properties":{"definitionName":{"type":"string"},"credentials":{"type":"array","items":{"$ref":"#/components/schemas/TemplateCredentialRowDto"}}},"required":["definitionName","credentials"]},"TemplateCredentialRowDto":{"type":"object","properties":{"credentialId":{"type":"string"},"fields":{"$ref":"#/components/schemas/TemplateCredentialFieldsRowDto"}},"required":["credentialId","fields"]},"TemplateCredentialFieldsRowDto":{"type":"object","properties":{"type":{"type":"string"},"properties":{"type":"object"},"required":{"type":"array","items":{"type":"string"}}},"required":["type","properties","required"]}}},"paths":{"/private/webapp/presentation-definitions/templates":{"get":{"operationId":"AgentWebappController_webappPresentationDefinitionsTemplates","summary":"Returns a list of presentation definition templates and their required fields.","description":"Returns a list of presentation definition templates and their required fields. The templates are used when creating a new presentation definition and checked against the required fields to ensure that the presentation definition is valid.<hr />**Claim-based access control:** <code>Verifier_Admin</code>, <code>Verifier_User</code>, <code>Verifier_Auditor</code>","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebappPresentationDefinitionsTemplatesDetailDto"}}}},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"503":{"description":"The agent service is unavailable"}},"tags":["Templates"]}}}}
```


---

# 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.teranode.group/tng-identity-documentation/tng-identity-verifier/verifier-api/api-documentation/templates.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.
