# Criação de Chave PIX

Este endpoint permite **registrar uma nova chave PIX** associada a uma conta bancária específica (`accountId`).

O tipo de chave deve ser informado no corpo da requisição através do campo `keyType`.

São aceitos os seguintes valores:

* `EVP` → Chave aleatória (UUID)
* `CPF` → Documento de pessoa física
* `CNPJ` → Documento de pessoa jurídica
* `EMAIL` → Endereço de e-mail
* `PHONE` → Número de telefone no formato E.164

Após o registro, a resposta retorna os dados completos da chave criada, incluindo seu **status atual** e o **identificador único (`id`)**.

Este endpoint é protegido e requer o uso do cabeçalho `Authorization: Bearer <token>` e `x-tenant-id`.

## Endpoint para criação de uma nova chave

<mark style="color:green;">`POST`</mark> `/accounts/{accountId}/pix/keys`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |
| x-tenant-id   | `Tenant ID`        |

**Body**

| Name      | Type   | Description   |
| --------- | ------ | ------------- |
| `keyType` | string | Tipo de chave |

**Response**

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

```json
{
    "key": {
        "id": "38e291bb-609b-40e7-9b28-e35788aa7d6f",
        "key": "92603db2-e89d-4de5-b6f9-32469f6c6859",
        "type": "EVP",
        "status": "ACTIVE"
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "code": "SCHEMA_VALIDATION",
    "error": "Invalid enum value. Expected 'EMAIL' | 'PHONE' | 'CPF' | 'CNPJ' | 'EVP', received 'EVPX'",
    "message": "Validação: Invalid enum value. Expected 'EMAIL' | 'PHONE' | 'CPF' | 'CNPJ' | 'EVP', received 'EVPX'"
}
```

{% endtab %}
{% endtabs %}


---

# 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/chaves-pix/criacao-de-chave-pix.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.
