API response is JSON formatted and it has Content-Type: application/json header.

HTTP status codes

MailerLite uses standard HTTP response codes.

HTTP codeDescription
200OKThe request succeeded.
201CreatedThe request was fulfilled and resulted in a new resource being created.
204No ContentThe server fulfilled the request but does not need to return an entity-body, i.e. when resource is deleted.
400Bad RequestThe request could not be understood by the server due to malformed syntax.
401UnauthorizedThe request requires user authentication.
404Not FoundThe server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
500Internal Server ErrorThe server encountered an unexpected condition which prevented it from fulfilling the request.

Response with error

Every error has the structure described below.

ParameterTypeDescription
errorObjectObject that contains data about error
error.codeIntegerOptional Code of error
error.messageStringReadable message about the error occurred
{
  "error": {
    "code": 123,
    "message": "Group not found"
  }
}

API error codes

Error codeMessageDescription
1UnauthorizedAPI key is required and is not provided
2Endpoint not foundThe endpoint you are trying to use is non-existing
302API-Key UnauthorizedYou are trying to use an invalid API key to authorize
429Too many requestsYou reached the API rate limit