> For the complete documentation index, see [llms.txt](https://docs.teranode.group/tng-identity-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.teranode.group/tng-identity-documentation/tng-identity-issuers/issuer-api/api-documentation/credential-templates.md).

# Credential Templates

## Upload credential template background cover image.

> Accepts the next image formats: \*\*image/jpeg, image/png, image/webp\*\*. Max size is:  \*\*5242880 bytes\*\*.\<hr />\*\*Claim-based access control:\*\* \<code>Issuer\_Admin\</code>, \<code>Issuer\_User\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Issuer Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Issuer Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/issuer/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"PartialTypeClass":{"type":"object","properties":{"image":{"type":"string","format":"binary"}}},"CredentialTemplateWithCoverImageDetailDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"format":"date-time","type":"string"},"updatedAt":{"format":"date-time","type":"string"},"correlationId":{"type":"string","description":"Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with! "},"credentialId":{"type":"string","description":"Defines the credential type"},"isDefaultCoverImage":{"type":"boolean","description":"Whether the credential template is a default cover image"},"coverImage":{"$ref":"#/components/schemas/DetailMediaDto"}}},"DetailMediaDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"mimeType":{"$ref":"#/components/schemas/MimeType"},"keyUrl":{"type":"string"},"filename":{"type":"string"},"type":{"$ref":"#/components/schemas/MediaType"}},"required":["id","mimeType","keyUrl","filename"]},"MimeType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"MediaType":{"type":"string","enum":["cover_image","claim_image"]}}},"paths":{"/private/credential-templates/correlation/{correlationId}/credential/{credentialId}/background-cover-upload":{"put":{"operationId":"CredentialTemplateController_uploadImage","summary":"Upload credential template background cover image.","description":"Accepts the next image formats: **image/jpeg, image/png, image/webp**. Max size is:  **5242880 bytes**.<hr />**Claim-based access control:** <code>Issuer_Admin</code>, <code>Issuer_User</code>","parameters":[{"name":"correlationId","required":true,"in":"path","description":"Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with! ","schema":{"type":"string"}},{"name":"credentialId","required":true,"in":"path","description":"Defines the credential type","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PartialTypeClass"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialTemplateWithCoverImageDetailDto"}}}},"400":{"description":"Invalid request body."},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"413":{"description":"Image exceeds the allowed size."},"415":{"description":"Unsupported media type."},"500":{"description":"Internal server error."}},"tags":["Credential Templates"]}}}}
```

## Fetch credential templates

> Fetch all the information related to the credential templates\<hr />\*\*Claim-based access control:\*\* \<code>Issuer\_Admin\</code>, \<code>Issuer\_User\</code>, \<code>Issuer\_Auditor\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Issuer Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Issuer Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/issuer/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"CredentialTemplateCollectionDetailDto":{"type":"object","properties":{"credentials":{"description":"Collection of templates the issuer is working with","type":"array","items":{"$ref":"#/components/schemas/CredentialTemplateRowDetailDto"}}}},"CredentialTemplateRowDetailDto":{"type":"object","properties":{"correlationId":{"type":"string","description":"Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with! "},"credentialId":{"type":"string","description":"Defines the credential type"},"isDefaultCoverImage":{"type":"boolean","description":"Whether the credential template is a default cover image"},"coverImage":{"$ref":"#/components/schemas/DetailMediaDto"},"display":{"type":"array","items":{"type":"array"}},"format":{"type":"string","description":"The format of the credential this is."},"fieldOrder":{"description":"The order of credential template fields","type":"array","items":{"type":"array"}},"fields":{"type":"object","description":"Credential template fields","additionalProperties":{"$ref":"#/components/schemas/WellKnownOpenidCredentialIssuerCredentialConfigurationDefinitionItemDto"}}}},"DetailMediaDto":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"mimeType":{"$ref":"#/components/schemas/MimeType"},"keyUrl":{"type":"string"},"filename":{"type":"string"},"type":{"$ref":"#/components/schemas/MediaType"}},"required":["id","mimeType","keyUrl","filename"]},"MimeType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"MediaType":{"type":"string","enum":["cover_image","claim_image"]},"WellKnownOpenidCredentialIssuerCredentialConfigurationDefinitionItemDto":{"type":"object","properties":{"value_type":{"type":"string","description":"The type of the value this claim should be. Generally its `string`, but in the future could also be `number`, maybe `boolean`, etc. "},"mandatory":{"type":"boolean","description":"Is this claim required to be present at credential offer creation?"},"display":{"type":"array","items":{"$ref":"#/components/schemas/NameAndLocaleDto"}},"format":{"$ref":"#/components/schemas/StringFormat"},"minLength":{"type":"number","description":"Specifies an optional minimum length of the claim string value, if the `value_type` is \"string\"."},"maxLength":{"type":"number","description":"Specifies an optional maximum length of the claim string value, if the `value_type` is \"string\"."},"pattern":{"type":"string","description":"Specifies an optional regex pattern that the claim string value must match, if the `value_type` is \"string\"."},"patternDescription":{"type":"string","description":"Human readable description of the regex pattern. Can be used to explain the pattern."},"enum":{"description":"Specifies an optional list of valid string values for the claim, if the `value_type` is \"string\".","type":"array","items":{"type":"string"}},"minDate":{"type":"string","description":"Specifies an optional minimum date of the claim string value, if the `value_type` is \"string\"."},"maxDate":{"type":"string","description":"Specifies an optional maximum date of the claim string value, if the `value_type` is \"string\"."},"min":{"type":"number","description":"Specifies an optional minimum value of claim number value, if the `value_type` is \"number\"."},"max":{"type":"number","description":"Specifies an optional maximum value of claim number value, if the `value_type` is \"number\"."}}},"NameAndLocaleDto":{"type":"object","properties":{"name":{"type":"string"},"locale":{"type":"string"}}},"StringFormat":{"type":"string","description":"Underlying format of the \"string\" `value_type`, to enhance validation.","enum":["date","date-time","email","uuid","byte"]}}},"paths":{"/private/credential-templates/correlation/{correlationId}":{"get":{"operationId":"CredentialTemplateController_getAll","summary":"Fetch credential templates","description":"Fetch all the information related to the credential templates<hr />**Claim-based access control:** <code>Issuer_Admin</code>, <code>Issuer_User</code>, <code>Issuer_Auditor</code>","parameters":[{"name":"correlationId","required":true,"in":"path","description":"Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with! ","schema":{"type":"string"}},{"name":"credentialId","required":false,"in":"query","description":"Defines the credential type","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialTemplateCollectionDetailDto"}}}},"400":{"description":"Invalid request body."},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"500":{"description":"Internal server error."}},"tags":["Credential Templates"]}}}}
```

## Deletes the credential template cover image and reverts back to the Issuer default one if exists else throws an error.

> Delete credential template cover image.\<hr />\*\*Claim-based access control:\*\* \<code>Issuer\_Admin\</code>, \<code>Issuer\_User\</code>

```json
{"openapi":"3.0.0","info":{"title":"Identity Issuer Backend Documentation","version":"dev"},"servers":[{"url":"{hostname}","description":"Issuer Backend REST API Server","variables":{"hostname":{"default":"https://identity.nchainplatform.com/products/web/$IDENTITY_ENV_ID/issuer/api"}}}],"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}}},"paths":{"/private/credential-templates/correlation/{correlationId}/credential/{credentialId}/cover-image":{"delete":{"operationId":"CredentialTemplateController_deleteCoverImage","summary":"Deletes the credential template cover image and reverts back to the Issuer default one if exists else throws an error.","description":"Delete credential template cover image.<hr />**Claim-based access control:** <code>Issuer_Admin</code>, <code>Issuer_User</code>","parameters":[{"name":"correlationId","required":true,"in":"path","description":"Defines a organisation which is defined as a correlationId. Must be a value the Issuer is working with! ","schema":{"type":"string"}},{"name":"credentialId","required":true,"in":"path","description":"Defines the credential type","schema":{"type":"string"}}],"responses":{"204":{"description":"Successfully deleted"},"400":{"description":"Invalid request params."},"401":{"description":"Invalid authentication credentials."},"403":{"description":"User does not have a required claim to perform this operation."},"500":{"description":"Internal server error."}},"tags":["Credential Templates"]}}}}
```
