Skip to main content

Update step

Use this request to update a step's delivery times. This request replaces the entire delivery_times object. Any existing values not included in the request will be removed.

Only campaigns with a status of DRAFT or EDITED can be updated. To change the campaign status to EDITED use the /make_editable endpoint.

Request

Endpoint

PATCH https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}/steps/{step_id}

You can fetch the step_id and version_id using the GET /campaigns structure endpoint.

Headers

x-api-key: {YOUR_API_KEY}
Content-type: application/json

For details on how to authenticate your requests, please see the authentication guide.

Body

The request body is the delivery time object. Below is a simplified example that would overwrite the current settings and configure the campaign to be sent on two specific days.

{
"delivery_time": {
"WEDNESDAY": [
{
"from": "09:00",
"to": "17:00"
}
],
"THURSDAY": [
{
"from": "09:00",
"to": "11:00"
},
{
"from": "14:00",
"to": "16:00"
}
]
}
}

Body schema

The delivery_time object defines the time intervals during which email messages can be sent. You can assign up to three time intervals to a single day. The timezone will follow the settings of the timezone and prospect_timezone of the campaign configuration.

FieldTypeDefaultRequiredDescription
MONDAY...SUNDAYarray[object]-YesArray of time windows for each day. Maximum 3 windows per day, at least one day must be present. The valid keys are the days of the week: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
└─[].fromstring-YesStart time in "HH:mm" format (24-hour)
└─[].tostring-YesEnd time in "HH:mm" format (24-hour)

Request sample

Update step delivery times

curl --request PATCH "https://api.woodpecker.co/rest/v2/campaigns/{campaign_id}/steps/{step_id}" \
--header "Content-Type: application/json" \
--header "x-api-key: {YOUR_API_KEY}" \
--data '{
"delivery_time": {
"WEDNESDAY": [
{
"from": "09:00",
"to": "17:00"
}
],
"THURSDAY": [
{
"from": "09:00",
"to": "11:00"
},
{
"from": "14:00",
"to": "16:00"
}
]
}
}'

Response

Response examples

The campaign has been updated. A full campaign payload will be returned.