Harbor Gateway
  1. Controllers
Harbor Gateway
  • Harbor Gateway API
    • Health & Status
      • Admin interface
      • Health check
    • Transactions
      • List all transactions
      • Create a transaction
      • Get transaction details
      • Release transaction
      • Open locker by transaction ID
    • Lockers
      • List all lockers
      • Get locker details
      • Open locker by ID
      • Open all lockers
    • System
      • Get system information
      • Update system configuration
      • Get system logs
    • Schemas
      • Locker
      • TransactionResponse
      • LockController
      • System
      • LogEntry
      • OperationResponse
      • LockerOperationResponse
      • MultiStatusOperationResponse
      • OpenAllLockersResponse
      • Error
  • Harbor Gateway Admin API
    • Authentication
      • Login with Basic Auth and receive session token
      • Logout and invalidate session token
    • Controllers
      • List all lock controllers
        GET
      • Manually add a lock controller
        POST
      • Trigger manual mDNS scan
        POST
      • Get controller details
        GET
      • Update controller settings
        PATCH
      • Remove controller from system
        DELETE
      • Replace a failed controller
        POST
      • Adjust locker count for controller
        PATCH
    • Lockers
      • Update locker service state
    • System
      • Refresh network information
      • Reboot gateway system
    • Diagnostics
      • Test Sentry error tracking integration
    • Schemas
      • Schemas
        • Controller
        • ControllerDetails
        • CreateControllerRequest
        • AdjustLockerCountResponse
        • OperationResponse
        • Error
      • Response
        • Unauthorized
        • NotFound
        • InternalServerError
  1. Controllers

Replace a failed controller

POST
/controllers/{controllerId}/replace
Replace a failed or offline controller with a newly discovered one. The physical
locker bank remains the same, so the old controller's locker records are
reassigned to the new controller, preserving all active transactions and locker IDs.
Automatic locker provisioning:
New controllers are automatically provisioned with 20 lockers during mDNS discovery.
During replacement, these auto-created lockers are deleted and the old controller's
existing locker records are reassigned to maintain consistency.
Typical workflow:
1.
Identify failed controller (operational=false)
2.
Physically swap hardware (unplug old, plug in new)
3.
Wait for mDNS discovery of new controller (auto-creates 20 lockers)
4.
Call this endpoint to complete replacement
5.
Old controller's lockers (with transactions) are moved to new controller
6.
New controller's auto-created lockers are deleted
7.
Old controller is deleted
Result: Same locker records and IDs, now pointing to new controller hardware.
Operation is atomic (transaction-based).

Request

Authorization
Basic Auth
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
or
API Key
Add parameter in header
X-Session-Token
Example:
X-Session-Token: ********************
or
Path Params

Body Params application/jsonRequired

Examples

Responses

🟢200OK
application/json
Controller replaced successfully
Body

🟠404Not Found
🟠409Conflict
🔴500Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/controllers//replace' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "newControllerId": 0
}'
Response Response Example
200 - Example 1
{
    "success": true,
    "reassignedLockers": 0,
    "activeTransactions": 0
}
Modified at 2025-11-27 00:06:25
Previous
Remove controller from system
Next
Adjust locker count for controller
Built with