# Create webhook (/en/docs/pix-processamento/endpoints/webhooks/post_user_webhook)

## POST /user/webhooks

`POST https://api.payzu.processamento.com/v1/user/webhooks`

Registers a webhook endpoint. If `generateSecret` is true, the response includes the HMAC `secret` (shown only here).

Guia: Webhooks (/docs/pix-processamento/webhooks)

### Body params

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `url` | string | yes | HTTPS URL that will receive the notifications. — format: uri |
| `events` | object[] | no | Events to subscribe to. Omit or leave empty to receive all events. — default:  |
| `generateSecret` | boolean | no | Generate an HMAC signing secret for this webhook. — default: false |
| `active` | boolean | no | Whether the webhook starts active. |

### Responses

**201** Webhook created.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `id` | string | no | Webhook identifier. |
| `url` | string | no | Address that receives the notifications. |
| `active` | boolean | no | Indicates whether the webhook starts out receiving events. |
| `events` | object[] | no | Events subscribed by this webhook. |
| `hasSecret` | boolean | no | Indicates whether the webhook has a signing secret. |
| `createdAt` | string | no | format: date-time |
| `updatedAt` | string | no | Date and time of the last change to the webhook. — format: date-time |
| `secret` | string | null | no | HMAC signing secret. Shown only on creation and on rotate-secret. Store it now. |

**400** Invalid request

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `status` | string | yes | Fixed marker of an error response. |
| `error` | string | yes | Name of the corresponding HTTP status. |
| `errorCode` | string | yes | Stable machine-readable error code, when available. |
| `message` | string | yes | Human-readable error message. |
| `statusCode` | integer | yes | HTTP status code. |
| `requestId` | string | yes | Unique request correlation ID (cuid). Include it when contacting support. |
| `details` | object[] | no | Field-level validation errors, when applicable. |
| `details.field` | string | yes | Path of the field rejected in validation, without the leading slash. |
| `details.message` | string | yes | Reason that field was rejected, in Portuguese. |
| `retryAfterSeconds` | integer | no | Seconds to wait before retrying. Present only on 429 responses. |

**401** Authentication failure

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `status` | string | yes | Fixed marker of an error response. |
| `error` | string | yes | Name of the corresponding HTTP status. |
| `errorCode` | string | yes | Stable machine-readable error code, when available. |
| `message` | string | yes | Human-readable error message. |
| `statusCode` | integer | yes | HTTP status code. |
| `requestId` | string | yes | Unique request correlation ID (cuid). Include it when contacting support. |
| `details` | object[] | no | Field-level validation errors, when applicable. |
| `details.field` | string | yes | Path of the field rejected in validation, without the leading slash. |
| `details.message` | string | yes | Reason that field was rejected, in Portuguese. |
| `retryAfterSeconds` | integer | no | Seconds to wait before retrying. Present only on 429 responses. |

**403** Operation not allowed

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `status` | string | yes | Fixed marker of an error response. |
| `error` | string | yes | Name of the corresponding HTTP status. |
| `errorCode` | string | yes | Stable machine-readable error code, when available. |
| `message` | string | yes | Human-readable error message. |
| `statusCode` | integer | yes | HTTP status code. |
| `requestId` | string | yes | Unique request correlation ID (cuid). Include it when contacting support. |
| `details` | object[] | no | Field-level validation errors, when applicable. |
| `details.field` | string | yes | Path of the field rejected in validation, without the leading slash. |
| `details.message` | string | yes | Reason that field was rejected, in Portuguese. |
| `retryAfterSeconds` | integer | no | Seconds to wait before retrying. Present only on 429 responses. |

**409** Conflict with the current state of the resource

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `status` | string | yes | Fixed marker of an error response. |
| `error` | string | yes | Name of the corresponding HTTP status. |
| `errorCode` | string | yes | Stable machine-readable error code, when available. |
| `message` | string | yes | Human-readable error message. |
| `statusCode` | integer | yes | HTTP status code. |
| `requestId` | string | yes | Unique request correlation ID (cuid). Include it when contacting support. |
| `details` | object[] | no | Field-level validation errors, when applicable. |
| `details.field` | string | yes | Path of the field rejected in validation, without the leading slash. |
| `details.message` | string | yes | Reason that field was rejected, in Portuguese. |
| `retryAfterSeconds` | integer | no | Seconds to wait before retrying. Present only on 429 responses. |