> For the complete documentation index, see [llms.txt](https://docs.stric.com.br/documentacao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stric.com.br/documentacao/pix/chaves-pix/registrar-nova-chave.md).

# Registrar nova chave

## Cadastrar uma nova chave

<mark style="color:green;">`POST`</mark> `https://dev.stric.com.br/pix/keys`

#### Headers

| Name                                            | Type   | Description               |
| ----------------------------------------------- | ------ | ------------------------- |
| authorization<mark style="color:red;">\*</mark> | String | Bearer token              |
| account<mark style="color:red;">\*</mark>       | String | ID da conta a ser operada |

#### Request Body

| Name                                    | Type   | Description                                                       |
| --------------------------------------- | ------ | ----------------------------------------------------------------- |
| value<mark style="color:red;">\*</mark> | String | Valor da chave                                                    |
| type<mark style="color:red;">\*</mark>  | String | <p>Tipo da chave cadastrada (Ver tabela abaixo)</p><p></p><p></p> |

{% tabs %}
{% tab title="200: OK Caso de sucesso" %}

```javascript
{
    "key": "*****",
    "type": "random",
    "typeCode": 4,
    "status": "WAITING",
    "statusCode": 0,
    "id": "63207615-fb27-47dd-ba2e-589d26bb0846",
    "date": "2022-06-20T22:33:06.852Z"
}
```

{% endtab %}

{% tab title="400: Bad Request Type inválido" %}

```javascript
{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Validation failed",
    "validation": {
        "body": {
            "source": "body",
            "keys": [
                "type"
            ],
            "message": "\"type\" must be one of [document, email, phone, random]"
        }
    }
}
```

{% endtab %}
{% endtabs %}

### Tipos de chaves disponíveis

| type     | Descrição       |
| -------- | --------------- |
| document | CPF/CNPJ        |
| random   | Chave Aleatória |
| email    | E-mail          |
| phone    | Celular         |
