Skip to main content
When a call fails, Lunacal responds with JSON and a message string:
Match on the HTTP status first, then on message if you need to tell two failures apart.

The request used the wrong method

Status: 405 Message: Method not allowed Every route in this API accepts POST only. A browser opening the URL, or a client sending GET, produces this response. Change the method to POST and send a JSON body.

The key was not accepted

Status: 401 Lunacal does not say whether the key is missing, mistyped, expired, or deleted. Check Developer settings, then issue a new key if you no longer have the original. The first message has two spaces between the words. Copy it exactly if your code compares the string. A value that does not start with lunacal_ is treated as an access token from the MCP sign-in, not as an API key. An unknown token fails with the same 401.

The account cannot use the API

Status: 403 Message: API access requires a Tier 4 or higher plan. Please upgrade to use the API. The key itself is valid, but the account is below Tier 4 and does not have API access turned on. Upgrade the plan, or ask Lunacal to enable API access for that user. Create booking and cancel booking do not return this status. They accept the key and continue. Every other route on the introduction does return it.

The body does not match the route

Status: 400 The message names the problem. Two cases you will see often:
  • Cancel booking, unknown uid: Booking not found
  • A required field is missing or the wrong type: the message includes the field path, for example filters.status on list bookings
Read the message, fix that field, and send the request again. Do not assume every invalid body uses the same sentence.

Lunacal could not finish the call

Status: 500 The message for a body that is not valid JSON is Unexpected error, please reach out for our customer support. Other unexpected failures use the same status with their own message. If this happens on a call that creates or changes something, list the resource before you retry. The first attempt may have succeeded.