New: Terraform Provider & Linux Private Checkpoints. See more.

  1. Support
  2. Knowledge base
  3. Synthetic Monitoring
  4. API Monitoring
  5. Multi-step monitoring
  6. Set up multi-step API response
  7. Multi-step API Maximum number of attempts

Multi-step API Maximum number of attempts

If you’re new to Multi-step APIs, we recommend that you read the Multi-step API monitoring and Multi-step API Response articles for an overview of their core functions and key features.

This article provides information on how the maximum number of attempts work and how they help verify API responses and ensure expected behavior.

Maximum number of attempts

There are situations when an API request may require additional time to complete its process before returning a successful response. For example, when uploading a file, the API might initially respond with {"result":"processing"} in the JSON body to indicate that the operation is still in progress. Once the processing is complete, the API returns {"result":"success"}. In scenarios like this, you can configure the monitor to continue polling the API until it returns a success response.

There are also times when your APIs may behave unexpectedly due to unforeseen circumstances or external issues like downtime and connectivity. These situations aren’t considered errors, simply retrying the steps may resolve the issue.

The Maximum number of attempts allows the monitor to continue checking the step at regular intervals until the desired outcome is achieved or the attempt limit is reached. Enabling this option instructs the monitor to retry the step if one or more assertions fail. You can set up to a maximum of 50 retry attempts, with a minimum of two since the initial request already counts as the first attempt.

You can also specify a wait time between attempts to control the delay between executing the previous attempt and the next. This must be set between 500 ms and 30,000 ms, with a default duration of 1,000 ms.

Once you’ve enabled the option for a step, the monitor will retry the step until either the maximum number of retries is reached or every assertion passes. At that point, the monitor will proceed as normal, executing the rest of the steps in order. If the maximum number of retries is reached, and still at least one assertion fails, the monitor will report an error in the monitor log.

Note: Setting the retry attempts does not affect the cost of Multi-step API (MSA) monitors. The credits remain the same no matter how many retry attempts were used.
By using the Uptrends website, you consent to the use of cookies in accordance with our Cookie Policy.