# Registration of new webhook

Registers the webhook. For a single event (event, for example
order:create) ONLY ONE URL can be registered.

If you try to enter the webhook for an event that already exists, you
will
 receive error 422 with message Webhook already exists for this event. Successful creation (registration) of webhook is signaled by code 201. The endpoint returns the info
on the created webhook. One of the items is id, which is assigned to
the webhook and is used for its identification

upon change or deletion.


The supported event can be found in code list Webhook event types.


It is possible to enter up to 50 webhooks using a single call.

Please note that url cannot be longer than 2000 characters.

Endpoint: POST /api/webhooks
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (array, required)

  - `data.event` (string, required)
    event, see [Webhook event types](#section/code-lists/webhook-event-types) code list

  - `data.url` (string, required)
    Webhook URL

## Response 201 fields (application/json):

  - `data` (object, required)

  - `data.webhooks` (array, required)

  - `data.webhooks.id` (integer, required)
    notification unique ID

  - `data.webhooks.event` (string, required)
    event, see [Webhook event types](#section/code-lists/webhook-event-types) code list

  - `data.webhooks.url` (string, required)
    webhook URL

  - `data.webhooks.created` (string,null, required)
    webhook registration date

  - `data.webhooks.updated` (string,null, required)
    webhook update date (can be null)

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object, required)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.


