---
title: "Create Unit Event Configuration (BETA)"
method: POST
path: "/units/{unitId}/events"
tags: ["Units"]
---

# Create Unit Event Configuration (BETA)

`POST /units/{unitId}/events`

This method allows the calling application to create Unit Event configuration. This endpoint can only be called once to create the configuration. Please note that the unitId *must* be that of the calling unit.

## Path parameters

- `unitId` string, Int64, required

## Headers

- `X-EES-AUTH-CLIENT-ID` string, string, required
- `X-EES-AUTH-HASH` string, string, required
- `Accept-Encoding` '' | 'gzip' | 'deflate' | 'gzip,deflate'
- `X-EES-TRANSACTION-ID` string, string

## Request body

- object
  - `recipients` UnitEventsRecipientRequestEntity[], required
    - union
      - object
        - `type` 'BASIC_POST', required — The type of recipient.
        - `recipientDetails` object, required
          - `url` string, required — The URL of the recipient.
          - `expectedHttpCodes` integer[], required — The expected HTTP response codes from the recipient.
          - `headers` object — The headers to be sent to the recipient.
        - `enabled` boolean, required — Flag indicating whether the recipient is enabled.
      - object
        - `type` 'AUTHENTICATED_REQUEST', required — The type of recipient.
        - `recipientDetails` object, required
          - `url` string, required — The URL of the recipient.
          - `expectedHttpCodes` integer[], required — The expected HTTP response codes from the recipient.
          - `headers` object, required — The headers to be sent to the recipient.
          - `requestMethod` 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'GET' | 'HEAD', required — The HTTP request method to be used for the recipient.
          - `authenticationType` 'oauth2', required — The authentication type to be used for the recipient.
          - `authentication` object, required — OAuth2 authentication details for the recipient.
            - `grantType` 'client_credentials' | 'password', required — The OAuth2 grant type.
            - `endpoint` string, required — The OAuth2 token endpoint URL.
            - `scope` string, required — The OAuth2 scope.
            - `clientId` string, required — The OAuth2 client ID.
            - `clientSecret` string, required — The OAuth2 client secret.
            - `username` string — The username for password grant type. *Required* if `grantType` is `password`.
            - `password` string — The password for password grant type. *Required* if `grantType` is `password`.
        - `enabled` boolean, required — Flag indicating whether the recipient is enabled.
      - object
        - `type` 'AZURE_EVENT_HUB', required — The type of recipient.
        - `recipientDetails` object, required
          - `namespace` string, required — The namespace of the Azure recipient.
          - `eventHub` string, required — The eventHub of the Azure recipient.
          - `keyName` string, required — The keyName of the Azure recipient.
          - `key` string, required — The key of the Azure recipient.
        - `enabled` boolean, required — Flag indicating whether the recipient is enabled.

## Response `201`

Successful Response with Unit Event Configuration Payload

- UnitEventsResponseEntity
  - `recipients` UnitEventsRecipientResponseEntity[]
    - union
      - object
        - `type` 'BASIC_POST' — The type of recipient.
        - `recipientDetails` object
          - `url` string — The URL of the recipient.
          - `expectedHttpCodes` integer[] — The expected HTTP response codes from the recipient.
          - `headers` object — The headers to be sent to the recipient.
        - `enabled` boolean — Flag indicating whether the recipient is enabled.
        - `id` string — The unique identifier of the recipient.
      - object
        - `type` 'AUTHENTICATED_REQUEST' — The type of recipient.
        - `recipientDetails` object
          - `url` string — The URL of the recipient.
          - `expectedHttpCodes` integer[] — The expected HTTP response codes from the recipient.
          - `headers` object — The headers to be sent to the recipient.
          - `requestMethod` 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'GET' | 'HEAD' — The HTTP request method to be used for the recipient.
          - `authenticationType` 'oauth2' — The authentication type to be used for the recipient.
          - `authentication` UnitEventsRecipientAuthenticationEntity — OAuth2 authentication details for the recipient.
            - `grantType` 'client_credentials' | 'password' — The OAuth2 grant type.
            - `endpoint` string — The OAuth2 token endpoint URL.
            - `scope` string — The OAuth2 scope.
        - `enabled` boolean — Flag indicating whether the recipient is enabled.
        - `id` string — The unique identifier of the recipient.
      - object
        - `type` 'AZURE_EVENT_HUB' — The type of recipient.
        - `recipientDetails` object
          - `namespace` string — The namespace of the Azure recipient.
          - `eventHub` string — The eventHub of the Azure recipient.
          - `keyName` string — The keyName of the Azure recipient.
        - `enabled` boolean — Flag indicating whether the recipient is enabled.
        - `id` string — The unique identifier of the recipient.
  - `dateCreated` string, date-time — The date-time when the Unit Event configuration was added to the AIR platform.
  - `lastUpdated` string, date-time — The date-time when the Unit Event configuration was last updated on in the AIR platform.

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `405` — Method Not Allowed.
- `429` — Too Many Requests
- `500` — Server Error
- `501` — Not Implemented
- `502` — Bad Gateway
- `503` — Service Unavailable
- `504` — Gateway Timeout

---

[API](https://skmtc.net/eagleeye/apis/wallet-api.md) · [All operations](https://skmtc.net/eagleeye/apis/wallet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eagleeye/wallet-api/versions/90a122bb14cc/schema)
