# 创建 Pix 密钥 (/zh/docs/conta-digital/endpoints/pix-keys/post_pix_key)

## POST /transactions/pix-keys

`POST https://api.hub.payzu.com.br/api/v1/transactions/pix-keys`

Scope: `PIX_KEY_WRITE`. Registers a new Pix key on the account, random (`EVP`) or CNPJ. The key comes back already `ACTIVE`, and the first key of the account becomes the default.

### Body params

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `type` | string | yes | Key type. Today you can create `EVP` and `CNPJ`. — `EVP`, `CNPJ`, `CPF`, `EMAIL`, `PHONE` |
| `key` | string | no | Key value. Required, except for `EVP`, where it must not be sent. CPF and CNPJ must belong to the account holder. — minLength: 1 |

### Responses

**201** Key created.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `id` | string | yes | Key identifier. It goes in the delete and set-default routes. |
| `key` | string | yes | Key value, in full. |
| `type` | string | yes | Key type. — `EVP`, `CNPJ`, `CPF`, `EMAIL`, `PHONE` |
| `status` | string | yes | Key status. — `PENDING`, `ACTIVE`, `REMOVED` |
| `isDefault` | boolean | yes | Whether it is the account default key. |
| `createdAt` | string | yes | Date and time in ISO 8601, UTC. — format: date-time |
| `updatedAt` | string | yes | Date and time in ISO 8601, UTC. — format: date-time |

**400** Invalid request.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**401** Missing, invalid or expired credential.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**403** Not allowed: scope, IP or disabled operation.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**409** Conflict with the current state.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**412** A step is missing before this operation.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**422** Business rule refusal.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**502** The bank did not respond or refused.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |