> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/linha-de-faciais/configuracao-de-credencial-facial/cadastrar-faces.md).

# Cadastrar Faces

### Cadastrar Faces

O cadastro de uma biometria é uma das partes mais importantes na identificação de uma pessoa. Então alguns cuidados são importantes no momento do cadastro.

O parâmetro *PhotoData* é a foto de usuário convertida em [Base64](https://pt.wikipedia.org/wiki/Base64). A foto deve respeitar os seguintes parâmetros:

* **Resolução mínima:** 150 × 300 pixels (L × A)
* **Resolução Máxima:** 600 × 1200 pixels (L × A)
* *A altura não deve exceder duas vezes a largura*\*
* **Tamanho máximo de arquivo:** 100KB

Recomenda-se a utilização de imagens com resolução superior a **500 × 500 pixels (L × A)** onde o rosto não deve ocupar mais de 2/3 da área total da imagem Para a aparência/conteúdo das fotos:

* Verifique se o rosto está visível e se a testa não está coberta por cabelos.
* Enquadre todo o rosto, olhe para a câmera e esteja de olhos abertos durante o cadastro.
* Evite usar óculos e não use chapéus ou outros ornamentos para o rosto que influenciem a gravação da imagem do rosto.
* Enquadre da cabeça aos ombros e dê preferência a um fundo neutro ou branco.
* Evite sombras no seu rosto ou ao fundo.
* Faça uma expressão neutra e natural e mantenha os braços ao longo do corpo.
* Como pode conferir abaixo, o padrão para a foto é semelhante ao exigido em um documento oficial.
* Padrão 3x4.

Aqui uma ilustração que consta do manual do produto:

&#x20;![](https://i.imgur.com/FKz0Os9.png)

Assista o video para saber mais:

[![](https://i.imgur.com/K28vI7F.png)](https://www.youtube.com/embed/FD5a7xa8hVo?start=271)

{% hint style="warning" %}
Antes de encaminhar o cadastro de face, é necessário cadastrar o usuário no sistema. Caso contrário, não será possível usar o valor do UserID para adicionar a credencial face ao usuário. Maiores dúvidas quanto ao cadastramento do usuário, acesse [Cadastro de Usuários](/linha-de-faciais/configuracao-de-usuarios/cadastro-de-usuarios.md)
{% endhint %}

#### Requisição - POST

`http://192.168.1.201/cgi-bin/AccessFace.cgi?action=insertMulti`

#### Body - *application/json*

```sh
  {
    "FaceList": [
      {
        "UserID": "5",
        "PhotoData": [
          "RuRZh0Nw6TiqMyYWQm5yDL4mV.......AAgIi5XX7TG1GYiozu33GO1RsnEfIbMzahTmOC+Rz0EuXLl/oJmu1w04KLzkI/qYz"
        ]
      },
      {
        "UserID": "6",
        "PhotoData": [
          "FwInAAqakDJlx4u4B5nwMBXZf.......x2hcqKyIQffxPioPMOVD5nxFvizLJtmHAmW8jl4FIltAze03nz+lDTqfzFIq4opfN"
        ]
      }
    ]
  }
```

| param          | type   | description                     |
| -------------- | ------ | ------------------------------- |
| `UserID` \*    | String | ID do Usuário, exemplo: `16`.   |
| `PhotoData` \* | String | Base64 da Face a ser cadastrada |

Permitido no máximo 10 faces por requisição.

#### Exemplo de Retorno - *text/plain*

```sh
OK
```

#### Exemplos

{% tabs %}
{% tab title="Python" %}

```python
 import requests
import json
 
device_ip = '10.1.35.87'
username = 'admin'
password = 'acesso1234'
 
url = "http://{}/cgi-bin/AccessFace.cgi?action=insertMulti".format(
                              str(device_ip),
                          )
 
digest_auth = requests.auth.HTTPDigestAuth(username, password)
 
payload = json.dumps({
"FaceList": [
  {
    "UserID": "16",
    "PhotoData": [
      "/9j/4AAQSkAAD/4RbQRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAcAAAAcgEyAAIAAAAUAAAAjodpAvyAAAAnEDIwMTg6MDQ6MTIgMTU6MjM6MDUAAAAAA6ABAAMAAAAB//AAKACAAQAAAABAAAB9KADAAQAAAABAAAB9AAAAAAAAAAGAQMAAwAAAAEABgAAARoABQAAAAEAAAEeARsABQAAAAEAAAEmASgAAwAAAAEAAgAAAgEABAAAAAEAAAEuAgIABAAAAAEAABWaAAAZURv9Iv4It/+789ax5eU+alVjOvMtzTfDm/s7hpf+Eg8N/L9/cl6i1xn/CurHUolbw54s0nWHf8A5dLhvssqf99feqlqszppt3L/ALPzVxSbvubN7/8AfdY1Tvy/34zOj1vwf4j8PSv/AGnpF3Cn/PbyvNT/AL7Wuq8Z38ulfDD4YwW1zJbS+RdXG+3bY6fPXJaJ488QeG4PK0/Wru2Tb8sTtvT/AMer1f4lfE6C40zwRY+JfDWm628WhJK8u37Lcb5W+/uWtJ83NA+m98b+zx8UfGKfEaygl1ye8t4oJZfKu1SXftT+/X17YfGPUYYka50y2uXT72x/Kr5d/Zytvh9qXjW9uYP7Z0G4isWTZNsuIvmf+CvoK80Tw8llcf8AFZwInlS7/wDQ23o+yvMxPL7X4DkqcnMfNl/+0/Pf6lqG7w5bfZ7idnbZdNv+/Xong/8AaE0NPhV4lubzTLvTUlvLeyXY3m73+9XgNt4V8JX8T/YfiFbeay7/APiYWD26bv8Afrsr/wCEviC2+CVl/Z8EOuLe600vnaTOsvmoqff2/s+607f40UV2P4pHzS/gQ/wC3jzC5kMJmdPlfe/NT6Pe3PiHXU0PU7iS9sZHbmZtzp8uPlbtRRXlSP0bLfiPRPjlZR6N4v0nS7bIs7HTIIYI2Odq+lXPglaRXnjW9SVd6xaRPInsxdM0UUS/gBD4jzD423M3/AAkMcfmvsjbylXPRdm//ANC5rhppnsGhuYG2TRzLIrf7VFFckdz28J8Z+m37J+pTyandwM+Yp9OiuHX1k3nn9TX0z2oornWxzV/jEooooOc//9k="
    ]
  }
]
})
headers = {
'Content-Type': 'application/json'
}
 
rval = requests.post(url, auth=digest_auth, data=payload, timeout=20, verify=False)
 
print(rval.text)
```

{% endtab %}
{% endtabs %}

### Cadastrar Face (SS 7520 T e SS 7530)

{% hint style="warning" %}
Os dispositivos SS 7520 T e SS 7530 ainda não suportam o cadastro multiplos de face (Chamada a Cima), sendo necessário utilizar a seguinte chamada para o cadastro nestes dispositivos&#x20;
{% endhint %}

{% hint style="info" %}
Obs: É importante seguir as recomendações de cadastro de face descrita em "Cadastrar Faces"
{% endhint %}

#### Requisição - POST

`http://192.168.1.201/cgi-bin/FaceInfoManager.cgi?action=add`

#### Body - *application/json*

```sh
  {
    "UserID": "16",
    "Info": {
      "UserName": "Alexandre16",
      "PhotoData": [
        "9j4AAQSkZJRgABAQAAAQABAADgAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc"
      ]
    }
  }
```

| param          | type   | description                                                                                    |
| -------------- | ------ | ---------------------------------------------------------------------------------------------- |
| `UserID` \*    | String | ID do Usuário, exemplo: `16`. É possivel tambem realizar o cadastro de um valor em Hexadecimal |
| `UserName` \*  | String | Nome do Usuário, exemplo: `Alexandre`                                                          |
| `PhotoData` \* | Number | Base64 da Face a ser cadastrada                                                                |

#### Exemplo de Retorno - *text/plain*

```sh
OK
```


---

# 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://portal-integracao.intelbras.com.br/linha-de-faciais/configuracao-de-credencial-facial/cadastrar-faces.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.
