> 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-en/sdks/backend-sdk/voice/technical_documentation/api_reference/enrollment/api-v1-enrollment.md).

# /api/v1/enrollment

This endpoint is used to enroll a new voice. It receives one or more audio files and returns a voice template. The voice template is a string that contains the biometric information of the voice. This template can be used to authenticate voices in the future.

```json
{"openapi":"3.0.1","info":{"title":"Voice-Service REST API","version":"3.2.0"},"servers":[{"url":"http://127.0.0.1:6982/"}],"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Default name of the API key header. It can be overridden at startup with `auth_api_key_header_name`."}},"schemas":{"EnrollmentBody":{"type":"object","description":"Enrollment request body","properties":{"audios":{"description":"The array length can be 1, or from 3 to 5. Sending 2 audios or more than 5 is not valid. 1 audio for text-independent enrollment. 3 to 5 audios for text-dependent enrollment.","type":"array","maxItems":5,"items":{"$ref":"#/components/schemas/AudioBuffer"}},"check_liveness":{"$ref":"#/components/schemas/CheckLiveness"},"check_quality":{"$ref":"#/components/schemas/CheckQuality"},"liveness_threshold":{"$ref":"#/components/schemas/LivenessThreshold"},"minimum_snr_db":{"$ref":"#/components/schemas/MinimumSnrDb"},"minimum_speech_duration_ms":{"$ref":"#/components/schemas/MinimumAudioLengthMs"},"minimum_speech_relative_length":{"$ref":"#/components/schemas/MinimumSpeechRelativeLength"},"maximum_multiple_speakers_detector_score":{"$ref":"#/components/schemas/MaximumMultipleSpeakersDetectorScore"},"extra_data":{"$ref":"#/components/schemas/ExtraData"}},"required":["audios"]},"AudioBuffer":{"type":"string","description":"Raw audio buffer in WAV, OPUS/OGG, MP3 or AAC format, encoded in base64 RFC4648. The audio may or may not be encrypted."},"CheckLiveness":{"type":"boolean","default":false,"description":"If true, a liveness check will be performed"},"CheckQuality":{"type":"boolean","default":true,"description":"If true, a quality check will be performed"},"LivenessThreshold":{"type":"number","default":0.5,"description":"Threshold for liveness detection. If the liveness probability is below this value, the audio is considered invalid."},"MinimumSnrDb":{"type":"number","description":"Minimum SNR in dB for the audio to be considered valid.","default":8},"MinimumAudioLengthMs":{"type":"number","description":"Minimum audio duration in milliseconds for it to be considered valid.","default":1000},"MinimumSpeechRelativeLength":{"type":"number","description":"Minimum relative speech length (speech length relative to the total audio duration).","default":0},"MaximumMultipleSpeakersDetectorScore":{"type":"number","description":"Maximum score allowed by the multiple speakers detector.","default":1},"ExtraData":{"type":"string","description":"Tokenized data to invoke the Api Tracking service after the operation, encoded in base64."},"EnrollmentResponse":{"type":"object","description":"Enrollment response","properties":{"operation_result":{"$ref":"#/components/schemas/OperationResult"},"template_type":{"$ref":"#/components/schemas/TemplateType"},"template":{"$ref":"#/components/schemas/AudioTemplate"},"validate_audios_result":{"type":"array","items":{"$ref":"#/components/schemas/AudioResult"}}}},"OperationResult":{"type":"number","description":"Result of the operation.","enum":["NOISY                          = 0","LONG_REVERBERATION             = 1","SMALL_SPEECH                   = 2","OK                             = 3","NOT_EVALUATED                  = 4","SPOOF                          = 5","DUPLICATED_AUDIO               = 6","DIFFERENT_VOICES               = 7","EMPTY_AUDIO                    = 8","TOO_MANY_AUDIOS                = 9","NOT_ENOUGH_GOOD_AUDIOS         = 10","CONFIG_MANAGER_ERROR           = 11","INVALID_LICENSE                = 12","EXPIRED                        = 13","SUSPENDED                      = 14","E_SYSTEM_PERMISSION            = 15","E_WMIC                         = 16","E_INET                         = 17","E_NET_PROXY                    = 18","E_REVOKED                      = 19","E_LICENSE_KEY                  = 20","E_ACTIVATION_LIMIT             = 21","E_VM                           = 22","E_COUNTRY                      = 23","E_IP                           = 24","E_CONTAINER                    = 25","DATA_NOT_FOUND                 = 26","ENVIRONMENT_VARIABLE_NOT_FOUND = 27","SMALL_RELATIVE_SPEECH          = 28","MULTIPLE_SPEAKERS              = 29"]},"TemplateType":{"type":"string","description":"Type of template returned as the result of the operation."},"AudioTemplate":{"type":"string","description":"Biometric template buffer, obtained from Enrollment(), encrypted and encoded in base64 RFC4648."},"AudioResult":{"type":"object","description":"Result of processing an audio","properties":{"audio_position":{"$ref":"#/components/schemas/AudioPosition"},"result_code":{"$ref":"#/components/schemas/OperationResult"},"liveness_score":{"$ref":"#/components/schemas/LivenessScore"},"matching_score":{"$ref":"#/components/schemas/MatchingScore"},"snr_db_detected":{"$ref":"#/components/schemas/SnrDbDetected"},"speech_length_ms_detected":{"$ref":"#/components/schemas/SpeechLengthMsDetected"},"speech_relative_length_detected":{"$ref":"#/components/schemas/SpeechRelativeLengthDetected"},"multiple_speakers_score_detected":{"$ref":"#/components/schemas/MultipleSpeakersScoreDetected"}}},"AudioPosition":{"type":"integer","description":"Position of the audio in the audio array. Starts at 0."},"LivenessScore":{"type":"number","description":"Liveness probability"},"MatchingScore":{"type":"number","description":"Matching probability"},"SnrDbDetected":{"type":"number","description":"SNR in dB detected in the audio."},"SpeechLengthMsDetected":{"type":"number","description":"Speech duration in milliseconds detected in the audio."},"SpeechRelativeLengthDetected":{"type":"number","description":"Relative speech length detected in the audio."},"MultipleSpeakersScoreDetected":{"type":"number","description":"Multiple speakers score detected in the audio."},"BadRequestResult":{"type":"object","description":"Result returned when the request contains incorrect parameters.","properties":{"status":{"type":"number"},"error":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"A date/time value in the format \"%Y-%m-%dT%H:%M:%SZ\"."},"ExceptionResult":{"type":"object","description":"An error occurred while calling the Voice-SDK backend.","properties":{"status":{"type":"number"},"error":{"type":"string"},"exception":{"type":"string"},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}}}},"paths":{"/api/v1/enrollment":{"post":{"description":"This endpoint is used to enroll a new voice. It receives one or more audio files and returns a voice template. The voice template is a string that contains the biometric information of the voice. This template can be used to authenticate voices in the future.","tags":["Enrollment"],"requestBody":{"description":"JSON with the input voice, encrypted and encoded in base64 RFC4648 format","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentBody"}}}},"responses":{"200":{"description":"The result of the voice enrollment. The *_detected fields are only present when the audio quality check fails.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"400":{"description":"The request contains incorrect parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestResult"}}}},"500":{"description":"An error occurred while calling the Voice-SDK backend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResult"}}}}}}}}}
```
