Skip to main content

Why isn't my campaign's sending time frame applied when I trigger a survey via API with a delay?

Written by Alex Bitca

When you trigger a transactional survey through our API (POST /api/v2/survey), you can include an optional delay field. A common question is how this delay interacts with a campaign that has a sending time frame configured (for example, only send between 7 and 8 AM).

How the API delay works

The delay field tells Retently how many days to wait after your API call before sending the survey. A few things to keep in mind:

  • It is counted in whole days. "delay": 7 means 7 days, not 7 hours. There is no hours option for the API field.

  • "delay": 0 sends the survey immediately.

  • The survey is released exactly that many days after your API call, at the same time of day the call was made.

Why the sending time frame is not applied

When you include the delay field in your API request, it acts as an explicit override of the campaign's scheduling, and that includes the sending time frame. The survey goes out exactly delay days after the trigger, at the time of your call, rather than being held for the next sending window. This is the same reason "delay": 0 sends right away.

So if your campaign is set to 7 to 8 AM and you call the API at 3 PM with "delay": 1, the survey will send at roughly 3 PM the next day, not during the 7 to 8 AM window.

How to have the sending time frame respected

If you want Retently to honor the campaign's sending time frame, do not include the delay field in your API request. Instead, configure the delay on the campaign itself:

  1. Open the campaign and go to its Trigger settings.

  2. Under "Delay survey delivery," set your delay.

  3. Enable the sending time frame with your desired window.

When the delay field is omitted from the API call, Retently applies both the campaign delay and the sending time frame, holding the survey until the next sending window opens.

Did this answer your question?