Skip to main content
PUT
/
api
/
lockers
/
{lockerNo}
Update Locker
curl --request PUT \
  --url https://api.example.com/api/lockers/{lockerNo} \
  --header 'Content-Type: application/json' \
  --data '
{
  "lockerNo": "<string>",
  "employeeNumber": "<string>",
  "size": 123,
  "location": "<string>",
  "isEmpty": true
}
'
{
  "lockerNo": "<string>",
  "employeeNumber": "<string>",
  "size": 123,
  "location": "<string>",
  "isEmpty": true
}

HTTP Method and Path

PUT /api/lockers/{lockerNo}

Path Parameters

lockerNo
string
required
The unique locker number of the locker to update

Request Body

lockerNo
string
required
The locker number (can be updated to a new value)
employeeNumber
string
The employee number to assign to this locker. Set to empty string to unassign.
size
integer
required
The size of the locker
location
string
required
The physical location of the locker
isEmpty
boolean
Whether the locker is empty. This value is automatically calculated based on the employeeNumber field (false if employeeNumber is provided, true if empty).

Response

Returns the updated locker object.
lockerNo
string
required
The unique locker number identifier
employeeNumber
string
The employee number assigned to this locker
size
integer
required
The size of the locker
location
string
required
The physical location of the locker
isEmpty
boolean
required
Indicates whether the locker is currently empty

Example Request

Update locker assignment

cURL
curl -X PUT https://api.example.com/api/lockers/A001 \
  -H "Content-Type: application/json" \
  -d '{
    "lockerNo": "A001",
    "employeeNumber": "EMP54321",
    "size": 2,
    "location": "Building A - Floor 1"
  }'

Unassign employee from locker

cURL
curl -X PUT https://api.example.com/api/lockers/A001 \
  -H "Content-Type: application/json" \
  -d '{
    "lockerNo": "A001",
    "employeeNumber": "",
    "size": 2,
    "location": "Building A - Floor 1"
  }'

Example Response

Success (200 OK)

{
  "lockerNo": "A001",
  "employeeNumber": "EMP54321",
  "size": 2,
  "location": "Building A - Floor 1",
  "isEmpty": false
}

Error (404 Not Found)

"Locker not found"

Build docs developers (and LLMs) love