v4/Reference

Response Codes

Mosler responses carry two layers of status, and it helps to read them separately:

  1. The HTTP status code — the transport-level outcome (did the request reach the right place and authenticate?).
  2. An application code in the JSON body — the business outcome (what happened to the booking, key, or device?).

A request can return HTTP 200/202 and still describe a domain result through the body code. Always branch on both.


HTTP status codes

HTTPMeaningWhen you'll see it
200OKSynchronous read succeeded (e.g. retrieving access, listing events).
202AcceptedA webhook event was accepted for asynchronous processing. Body carries eventId.
400Bad RequestMalformed payload or invalid field values.
401UnauthorizedMissing or invalid apikey header.
404Not FoundNo resource for the given referenceId/eventId in your company.
409ConflictDuplicate resource — e.g. a referenceId that already exists.
429Too Many RequestsClient is being rate-limited. See Rate Limits.
500Internal Server ErrorUnexpected server-side failure. Safe to retry idempotent calls with backoff.

Asynchronous calls: A 202 means received, not done. The booking still has to clear the queue and provision a credential. Track the real outcome through the event's lifecycle status — see Event Lifecycle.


Body response shape

Most endpoints return a consistent envelope. The exact keys vary by endpoint, but the status-bearing fields are stable:

FieldTypeDescription
errorbooleantrue when the operation failed. Branch on this first.
codenumberApplication status code (see tables below).
messagestringHuman-readable description of the code.
dataobject | arrayThe result payload, present on success.
{
    "error": false,
    "code": 7005,
    "message": "Successfully fetched Ekeys for Booking.",
    "data": [
        /* … */
    ]
}

Booking codes (7000–7999)

These are the codes you'll meet most often on the v4 booking and access endpoints.

Success

codemessage
7000Successfully created Booking.
7001Successfully updated Booking.
7002Successfully deleted Booking.
7003Successfully fetched Bookings.
7004Successfully freezed Booking.
7005Successfully fetched Ekeys for Booking.

Client errors

codemessageTypical fix
7400Invalid Data Provided.Check required fields and value formats in the payload.
7401Invalid Reference Id Provided.The referenceId doesn't match a booking in your company.
7402Reference Id already exists.Use a unique referenceId, or send BOOKING_UPDATE.
7403Ekey access not supported.The mapped lock can't issue e-keys; use passcode or card.
7404No upcoming booking found.No active/future booking for the lookup.
7405Access Type not supported.Requested credential type isn't available for this device.

Server errors

codemessage
7500Failed to create Booking.
7501Failed to update Booking.
7502Failed to delete Booking.
7503Failed to fetch Booking.
7504Failed to create key.
7507Unable to update booking.
7508Failed to create key for updated booking.

Server-error codes (75xx) indicate the request was valid but Mosler couldn't complete it. These are safe to retry with exponential backoff; if they persist, capture the eventId/referenceId and contact support.


Location & inventory codes

Returned by the location-mapping endpoints (Mapping Locations).

codemessage
2400Site not found.
2401Building not found.
2402Floor not found.
2403Room not found.
2404No Lock Found

Event lifecycle statuses

These are not numeric codes — they're the status strings on an event, returned by the event endpoints. They tell you where an asynchronous booking is in the pipeline:

StatusMeaning
RECEIVEDAccepted by the webhook service; not yet queued.
QUEUEDPublished to the queue; awaiting the worker.
PROCESSINGWorker is executing business logic.
COMPLETEDBooking processed and access provisioned.
FAILEDProcessing failed after retries — see message.
DEAD_LETTERPermanently failed after 3 attempts; needs manual intervention.
DUPLICATEA matching event was already received; stored for audit only.

Full lifecycle semantics and retry behaviour live in Event Lifecycle.


How to handle codes in your integration

  • Branch on error first, then inspect code for the specific reason.
  • Treat 4xx/74xx as terminal — retrying without changing the request won't help. Fix the payload or reference.
  • Treat 5xx/75xx as transient — retry idempotent operations with exponential backoff.
  • Never key off message text — the human-readable strings can change. Match on the numeric code and the status enum instead.