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

# Create Unit Event Recipient Configuration (BETA)

`POST /units/{unitId}/events/recipients`

## Request

- Base URL: `https://resources.uk.eagleeye.com`
- URL: `https://resources.uk.eagleeye.com/units/{unitId}/events/recipients`
- Auth: none declared. Required headers: `X-EES-AUTH-CLIENT-ID`, `X-EES-AUTH-HASH`

This method allows the calling application to create configuration for a new Unit Event Recipient. Unit Events must already be configured for the Unit to add an additional Recipient. 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

- 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 Recipient Configuration Payload.

- 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.

## 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.dev/eagleeye/apis/resource-api.md) - [All operations](https://skmtc.dev/eagleeye/apis/resource-api/llms.txt) - [OpenAPI document](https://skmtc.dev/eagleeye/apis/resource-api/revisions/10217d37fdc5?raw)
