> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Visão Geral

> Gestão do perfil próprio (foto, nome, status), consulta de terceiros e privacidade

**Auth:** `TokenAccount` ou `TokenInstance` em todas as rotas. Cada chamada valida a ownership da instância.

Esta seção cobre as rotas `/api/profile/*` para atualizar o próprio perfil, consultar perfis de terceiros e ler / atualizar configurações de privacidade do WhatsApp.

## Endpoints

| Método | Path                                | Função                                                              |
| ------ | ----------------------------------- | ------------------------------------------------------------------- |
| POST   | `/api/profile/account/:instance`    | [Atualizar foto / nome / status](/pt/api/profile/update-account)    |
| GET    | `/api/profile/getAccount/:instance` | [Obter perfil próprio ou de terceiro](/pt/api/profile/read-account) |
| GET    | `/api/profile/getPrivacy/:instance` | [Obter privacidade](/pt/api/profile/read-privacy)                   |
| GET    | `/api/profile/privacy/:instance`    | [Alias de `/getPrivacy`](/pt/api/profile/read-privacy-alias)        |
| POST   | `/api/profile/privacy/:instance`    | [Atualizar privacidade](/pt/api/profile/update-privacy)             |

## Estrutura de privacidade

A API agrupa as configurações em três subobjetos: `visibility`, `privacy` e `permissions`.

```json theme={null}
{
  "visibility": {
    "lastSeen": "contacts",
    "status": "all",
    "profile": "contacts",
    "online": "match_last_seen"
  },
  "privacy": {
    "readReceipts": "all"
  },
  "permissions": {
    "callAdd": "all",
    "groupAdd": "contacts"
  }
}
```

### Valores aceitos por campo

| Campo                             | Valores                                           |
| --------------------------------- | ------------------------------------------------- |
| `lastSeen` / `status` / `profile` | `all` / `contacts` / `contact_blacklist` / `none` |
| `online`                          | `all` / `match_last_seen`                         |
| `readReceipts`                    | `all` / `none`                                    |
| `callAdd`                         | `all` / `known`                                   |
| `groupAdd`                        | `all` / `contacts` / `contact_blacklist`          |

## Modelo `AccountProfileData`

Resposta de [`GET /getAccount`](/pt/api/profile/read-account):

```json theme={null}
{
  "profilePicture": "https://pps.whatsapp.net/...",
  "profileName": "João Silva",
  "profileStatus": "Disponivel",
  "phoneNumber": "5511999999999",
  "jid": "5511999999999@s.whatsapp.net",
  "lid": "199789077627112@lid"
}
```

## Envelope de erro

```json theme={null}
{
  "success": false,
  "error": { "message": "At least one field must be provided (profilePicture, profileName, or profileStatus)" }
}
```

## Quadro de erros (resumo)

| Categoria | Mensagem                                                                              |
| --------- | ------------------------------------------------------------------------------------- |
| Validação | `At least one field must be provided (profilePicture, profileName, or profileStatus)` |
| Validação | `At least one privacy setting must be provided`                                       |
| Validação | `Invalid <field> value: <value>. Valid values: ...`                                   |
| Estado    | `Instance is not connected to WhatsApp`                                               |
| Número    | `Number not found or not registered on WhatsApp`                                      |
| Número    | `invalid LID format`                                                                  |
| Falha     | `failed to update <field> privacy: <reason>`                                          |

## Próximo

<CardGroup cols={2}>
  <Card title="Atualizar conta" icon="user-pen" href="/pt/api/profile/update-account">
    Mudar foto, nome de exibição ou status.
  </Card>

  <Card title="Atualizar privacidade" icon="shield" href="/pt/api/profile/update-privacy">
    Ajustar quem vê o que.
  </Card>
</CardGroup>
