# 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         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stric.com.br/documentacao/pix/chaves-pix/registrar-nova-chave.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
