When you make an API call you may receive an error message in response. Either there is something wrong with your request or something went wrong on our end. Errors respond with an error code and JSON that contains a more precise message, description and API code.

List of SparkPost API Error Codes are as follows

CODESTATUS NAMEDESCRIPTIONSUGGESTED ACTION
400Bad RequestThere is a problem with your request.Check your request follows the API documentation and uses correct syntax.
401UnauthorizedYou don’t have the needed authorization to make the request.Make sure you are using a valid API key with the necessary permissions for your request.
403ForbiddenThe server understood the request but refused to fulfill it.See if your SparkPost plan includes the resource you are requesting and your API key has the necessary premissions.
404Not FoundThe server couldn’t find the requested file.Change your request URL to match a valid API endpoint.
405Method Not AllowedThe resource does not have the specified method. (e.g. PUT on transmissions)Change the method to follow the documentation for the resource.
409ConflictA conflict arose from your request. (e.g. user already exists with that email)Modify the payload to clear the conflict.
413Request Entity Too LargeThe size of the request exceeds the limit.Check the documented limit for the API and reduce the size of the request.
415Unsupported Media TypeThe request is not in a supported format.Check that your Content-Type header is a supported type and that your request adheres to the documentation.
420Exceed Sending LimitYou exceeded your daily, monthly, or sandbox sending limit.Check that you are within the limits of your SparkPost plan. If you are using the sandbox domain, then you’ll need to add a sending domain to continue.
422Unprocessable EntityThe request was syntactically correct but failed due to semantic errors.Make sure that your request includes all of the required fields and your data is valid.
429Too Many RequestsYou sent too many requests in a given time period.Wait 1 to 5 seconds before making another request. Heavier usage patterns may require a more sophisticated and incremental backoff strategy.
500Internal Server ErrorSomething went wrong on our end.Try the request again later. If the error does not resolve, check our status page for service updates. You can also contact Support from the app [EU] if your issue persists.
503Service UnavailableWe are experiencing higher than normal levels of traffic.Try the request again later.

Visit https://developers.sparkpost.com/api/#header-error-table

Contact ccs.rentacoder (at) gmail (dot) com if you want Classic ASP or .Net Mail sending Function.