Skip to content

API action

Replace a hotel key(rotate)

Make a new key in place of an old one. The old key keeps working for 24 hours.

About this action

What it does
Makes a new with the same name, scopes, allowed addresses and end date as the old one. Hotel people call this: to a key.
When to use it
When a key may have been seen by someone else, or on a plan, like once a year. If you are sure a key was stolen, use Switch off a hotel key: that stops it at once.
Who can use it
A only. The key needs the keys:manage.
Address
POST https://api.zimmerstack.com/api/v1/connect-api/v1/properties/{propertyId}/keys/{keyId}/rotate
Before this
You need the keyId of the old key. Get it with List hotel keys.

What you send

In the address:

propertyId
The hotel's property id, a number. It is the id in the answer of List your hotels.
keyId
The id of the key, a number. It is the id in the answer of List hotel keys.

Things to know

  1. The old key works for 24 more hours. Put the new key into your system in that time. After 24 hours the old key answers 401 API_KEY_REVOKED.
  2. The new key is shown once. The full key is in key, in this answer only. Save it at once in a safe place.
  3. If you lost the answer, start again. A repeat of the same request with the same X-Idempotency-Key answers key: null (). Then switch the new key off, and make one with Make a hotel key.
  4. Only the keys you made. You cannot replace a key the hotel's owner made. You cannot replace your company key here either: a person does that in the partner portal.

The request, in your language

Put your key in place of zsk_test_YOUR_KEY.

Open a terminal and run this. On Windows PowerShell, type curl.exe instead of curl.

terminal
curl -X POST "https://api.zimmerstack.com/api/v1/connect-api/v1/properties/61/keys/87/rotate" -H "Authorization: Bearer zsk_test_YOUR_KEY"

What comes back

The is 200. It means: a new key was made. The answer has three parts: key, view and retired.

response · status code 200
{
  "statuscode": 200,
  "message": "API key rotated",
  "data": {
    "key": "zsk_live_…",
    "view": {
      "id": 88,
      "propertyId": 61,
      "name": "Aarohan PMS, The Lantern House",
      "maskedKey": "zsk_live_Xr4…",
      "mode": "live",
      "status": "ACTIVE",
      "scopes": [
        "ari:read",
        "ari:write",
        "channel-bookings:read"
      ],
      "allowedCidrs": [
        "203.0.113.0/24"
      ],
      "createdAt": "2026-11-24T08:00:00.000Z",
      "lastUsedAt": null,
      "lastUsedIp": null,
      "expiresAt": null,
      "retireAt": null,
      "rotatedToId": null,
      "revokedAt": null,
      "revokedReason": null
    },
    "retired": {
      "id": 87,
      "propertyId": 61,
      "name": "Aarohan PMS, The Lantern House",
      "maskedKey": "zsk_live_Qm7…",
      "mode": "live",
      "status": "ACTIVE",
      "scopes": [
        "ari:read",
        "ari:write",
        "channel-bookings:read"
      ],
      "allowedCidrs": [
        "203.0.113.0/24"
      ],
      "createdAt": "2026-11-23T12:45:00.000Z",
      "lastUsedAt": "2026-11-24T07:59:12.000Z",
      "lastUsedIp": "203.0.113.24",
      "expiresAt": null,
      "retireAt": "2026-11-25T08:00:00.000Z",
      "rotatedToId": 88,
      "revokedAt": null,
      "revokedReason": null
    }
  }
}
key
The new secret key, in full. It is in this answer only. Empty (null) when the same request was sent a second time.
view
The new key: its id, its maskedKey, its scopes and the other fields that List hotel keys shows.
retired
The old key, with the same fields.
retired.retireAt
The time the old key stops working: 24 hours after this request.
retired.rotatedToId
The id of the new key.

Then change the key in your system

Save the new key, and use it in place of the old one. You have 24 hours before the old key stops.

Common mistakes

403 COMPANY_KEY_REQUIRED
You used a hotel key. This request works with a company key only.
404 PROPERTY_NOT_FOUND
The property id is not a hotel you added. With a test key, it is not one of your sandboxes. A hotel whose owner let you in with your vendor code gives this error too.
404 KEY_NOT_FOUND
No key with this id that you made for this hotel. Read the ids again with List hotel keys.
409 KEY_REVOKED
The key is switched off, and a switched-off key cannot be replaced. Make a new one with Make a hotel key.
409 KEY_ALREADY_ROTATING
This key was already replaced, and its 24 hours are still running. Use the new key.
Other errors this request can give
401 API_KEY_INVALID
The key is not right. Copy it again, all of it, with no space before or after.
403 SCOPE_MISSING
The key is not allowed to do this. It needs the scope keys:manage.
403 IP_NOT_ALLOWED
The key only works from the addresses its owner allowed.
429 RATE_LIMITED
Too many requests in a short time. Wait the number of seconds in the Retry-After header, then send again.
401 API_KEY_REVOKED
The key was switched off, or it was replaced and its extra 24 hours are over. Ask the key's owner for the new key. Nothing else makes this key work.

Try it now

No code and no install. This box sends a real request to your . It works with a only, so it can never change a real hotel.

Try it here: replace a hotel key

It starts with zsk_test_. It is kept in this browser tab only. Never paste a live key into a web page.

Go deeper

  • Keys and scopes: The kinds of key, what each may do, and how to replace one.

Words on this page

Hotel key
A key that works for one hotel only. The hotel's owner makes it, or a partner makes it for a hotel it added.
Rotate
To replace a key or a secret with a new one. The old one keeps working for a short time.
Company key
The key of a software company. One key works for all the hotels of that company.
Scope
One permission of a key. For example ari:write lets the key update availability, rates and restrictions.
Idempotency key
A code you choose and send with an update. If the same update is sent twice by mistake, it is done only once.
Status code
A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
Sandbox
Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.
Test key
A key that starts with zsk_test_. It works only on a sandbox, so it can never change a real hotel.

New here? Start with the partner path or the one-hotel path.

Routes, samples, limits and codes on this page come from the API's public contract, read live, Fri, 04 Dec 2026 23:24:17 UTC.