Customize error responses

To help your users better understand the error messages they may potentially encounter while making requests to your registered APIs, you can customize the response bodies, status codes, and headers of selected errors.

Try the API: You can also complete this task by using the API Endpoints API. Run the Update error response settings and Update an error response operations. Learn more about Akamai’s APIs.

How to

  1. On the API Definitions page, in the Registered APIs section, click the ellipsis icon () associated with the API configuration you want to customize error responses for.
  2. From the menu, select Manage versions.
  3. In the Version history panel, click the ellipsis icon () associated with the API configuration version you want to customize error responses for.
  4. From the list of delivery options, select Error response customization.
  5. On the Error response customization page, find an error response that you want to customize.
    For error descriptions, see Error response customization (beta).
  6. Set the Override default response switch of that response to Yes.
  7. In the Status code field, enter the status code to be associated with the response.
    For guidance on status codes, see status code definitions.
  8. In the Body field, enter the description that you want to return in case of the error.
    Note: Ensure that the format of the description properly reflects the content-type. For example, in case of a JSON body format, enclose the text in curly brackets ({}).
  9. In the Headers section, specify the Content-Type header to match the content-type of the response.
  10. Optional: Click the plus sign to specify an additional header to be included in the response.
  11. Click Save.