The Noonlight API uses conventional HTTP status codes to indicate success or failure. Responses with a status code starting with 4xx or 5xx can be considered as failed. The API returns errors in JSON format in following structure:

{
  "code": 400,
  "message": "Bad Request",
  "details": "A required field is missing"
}

📘

Developer-friendly API

Noonlight attempts to provide a developer-friendly API, hence sometimes you can find a hint on how to fix an error right in its details (like in the example above).

AttributesDescription
codeThe HTTP status code of error returned. Can be: 2xx, 4xx or 5xx
keyFor API object errors, a short string from amongst those listed below describing the kind of error that occurred
messageA human-readable message providing short description about the error
detailsA human-readable message providing more details about the error
KeyDescription
resource_not_foundEntity with provided id does not exist
invalid_payloadA request body is invalid and cannot be processed
alarm_canceledThe alarm has already been canceled and can no longer be modified