# Adds Unit to Venue

Allows the user to add a unit on the specified venue.

Endpoint: POST /venues/{venueId}/units
Version: 1.0.0

## Path parameters:

  - `venueId` (string, required)
    Venue Id

## Query parameters:

  - `bulk` (boolean, required)
    Flag to indicate bulk operation

  - `venueId` (any)
    Venue Id

  - `category` (string)
    Category applied to every imported unit.
    Enum: "UNIT", "CONFERENCEROOM"

## Request fields (application/json):

  - `id` (string)
    Unique identifier of the unit.

  - `name` (string, required)
    Unit name.

  - `resident` (object, required)
    Contact details of the unit resident.

  - `resident.name` (string)
    Full name of the unit resident.

  - `resident.email` (string)
    Email address for contacting the resident.

  - `resident.phoneNumber` (string)
    Phone number for contacting the resident.

  - `pmsUnitId` (string)
    Property management system unit identifier.

  - `type` (string)
    Unit type.
    Enum: "R1", "PMS", "INTERNAL"

  - `category` (string)
    Category of the unit.
    Enum: same as `category` (2 values)

  - `status` (string)
    Unit status.
    Enum: "DISABLED", "ENABLED"

  - `dpsks` (array)
    List of DPSK passphrase configurations.

  - `dpsks.type` (string, required)
    Type of DPSK persona: UNIT, GUEST, or LINKED.
    Enum: "UNIT", "GUEST", "LINKED"

  - `dpsks.passphrase` (string)
    DPSK passphrase for wireless network access. Maximum length is 63 characters.

  - `dpsks.vlan` (integer)
    VLAN ID for the DPSK configuration. Valid range is 1-4094.

  - `accessPoint` (object)
    Access point configuration for the unit.

  - `accessPoint.name` (string, required)
    Name identifier for the access point.

  - `accessPoint.selectedPorts` (array)
    List of selected LAN ports for the unit.

  - `accessPoint.selectedPorts.macAddress` (string, required)
    The MAC address of the port.

  - `accessPoint.selectedPorts.portIndex` (integer, required)
    The index of the port.

  - `trafficControl` (object)
    Traffic control and QoS profile details.

  - `trafficControl.meteringProfileId` (string, required)
    Identifier of the metering profile to apply.

  - `trafficControl.profileExpiry` (string, required)
    Expiration date and time for the metering profile.

  - `personaId` (string)
    Unique identifier of the unit persona.

  - `guestPersonaId` (string)
    Unique identifier of the guest persona.

## Response 200 fields (application/json):

  - `totalCount` (integer)
    Total number of units processed.
    Example: 100

  - `createdCount` (integer)
    Number of newly created units.
    Example: 60

  - `existingCount` (integer)
    Number of units that already existed (already imported).
    Example: 25

  - `failedCount` (integer)
    Number of units that failed to process.
    Example: 15

  - `errorMessage` (string)
    Error message if the operation failed (e.g., quota exceeded).

  - `venueId` (string)
    Venue ID associated with the bulk units operation.
    Example: "9fcb769a6a9e446ca7f2991326cbe5be"

  - `venueName` (string)
    Venue name associated with the bulk units operation.
    Example: "Opera"

  - `unitsByStatus` (object)
    Units grouped by status: created, existing, and failed.

  - `unitsByStatus.created` (array)
    List of newly created unit names.

  - `unitsByStatus.existing` (array)
    List of existing unit names (already imported).

  - `unitsByStatus.failed` (object)
    Map of failed units with unit name as key and error message as value.

## Response 202 fields (*/*):

  - `requestId` (string)
    Unique identifier for tracking the asynchronous request.

  - `_links` (object)

## Response 400 fields (application/json):

  - `status` (string)
    HTTP status code of the error response.
    Enum: "100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 EARLY_HINTS", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"

  - `timestamp` (string)
    Timestamp when the error occurred.

  - `requestId` (string)
    Unique identifier for tracking the failed request.

  - `message` (string)
    Brief error message describing the issue.

  - `detailedMessage` (string)
    Detailed error message with additional context.

  - `validationErrors` (array)
    List of validation error messages.

  - `errors` (array)
    List of nested error details.

  - `errors.code` (string)
    Error code identifier.

  - `errors.message` (string)
    Human-readable error message.

  - `errors.reason` (string)
    Reason for the error.

  - `errors.suggestion` (string)
    Suggested action to resolve the error.


