Response
API response is JSON formatted and it has Content-Type: application/json
header.
HTTP status codes
MailerLite uses standard HTTP response codes.
HTTP code | Description | |
---|---|---|
200 | OK | The request succeeded. |
201 | Created | The request was fulfilled and resulted in a new resource being created. |
204 | No Content | The server fulfilled the request but does not need to return an entity-body, i.e. when resource is deleted. |
400 | Bad Request | The request could not be understood by the server due to malformed syntax. |
401 | Unauthorized | The request requires user authentication. |
404 | Not Found | The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. |
500 | Internal Server Error | The server encountered an unexpected condition which prevented it from fulfilling the request. |
Response with error
Every error has the structure described below.
Parameter | Type | Description |
---|---|---|
error | Object | Object that contains data about error |
error.code | Integer | Optional Code of error |
error.message | String | Readable message about the error occurred |
{
"error": {
"code": 123,
"message": "Group not found"
}
}
API error codes
Error code | Message | Description |
---|---|---|
1 | Unauthorized | API key is required and is not provided |
2 | Endpoint not found | The endpoint you are trying to use is non-existing |
302 | API-Key Unauthorized | You are trying to use an invalid API key to authorize |
429 | Too many requests | You reached the API rate limit |
Updated over 3 years ago