> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-pt-br/sdks/backend-sdk/selphid/technical_documentation/api_reference/gallery-1-n/api-v1-selphid-identify-enroll-template-galleryid-templateid.md).

# /api/v1/selphid/identify/enroll/template/{galleryId}/{templateId}

Enrolls a facial template in a gallery.

```json
{"openapi":"3.0.0","info":{"title":"SelphID-SDK Rest API","version":"6.21.0"},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Default API key header name. It can be overridden at startup with `auth_api_key_header_name`."}},"schemas":{"GalleryId":{"type":"string","description":"The name of a facial template gallery."},"FacialTemplateId":{"type":"string","description":"The name of a facial template in a gallery."},"GalleryTemplate":{"type":"object","description":"A facial template, used for enrollment in a 1:N gallery.","properties":{"facialTemplate":{"$ref":"#/components/schemas/FacialTemplate"}},"required":["facialTemplate"]},"FacialTemplate":{"type":"string","description":"Biometric template buffer, obtained through GetFacialTemplate(), base64-encoded."},"EnrollResult":{"type":"object","description":"The result of enrolling a template in a gallery.","properties":{"galleryIndex":{"$ref":"#/components/schemas/GalleryIndex"},"facialTemplate":{"$ref":"#/components/schemas/FacialTemplate"},"sdkDuration":{"$ref":"#/components/schemas/SdkDuration"}}},"GalleryIndex":{"type":"integer","description":"The index of a facial template in a gallery.","minimum":0},"SdkDuration":{"type":"number","description":"Duration of the operation in milliseconds."},"BadRequestResult":{"type":"object","description":"Result when incorrect parameters arrive in the request.","properties":{"status":{"type":"number"},"error":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"A date and time value in \"%Y-%m-%dT%H:%M:%SZ\" format."},"ExceptionResult":{"type":"object","description":"An error occurred in the call to the SelphID-SDK backend.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}}},"paths":{"/api/v1/selphid/identify/enroll/template/{galleryId}/{templateId}":{"post":{"description":"Enrolls a facial template in a gallery.","tags":["Gallery 1:n"],"parameters":[{"in":"path","name":"galleryId","schema":{"$ref":"#/components/schemas/GalleryId"},"required":true},{"in":"path","name":"templateId","schema":{"$ref":"#/components/schemas/FacialTemplateId"},"required":true}],"requestBody":{"description":"JSON with the facial template.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GalleryTemplate"}}}},"responses":{"200":{"description":"Result of the enrollment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollResult"}}}},"400":{"description":"Incorrect parameters in the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"500":{"description":"An error occurred in the call to the SelphID-SDK backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}}}}
```
