Skip to content

Add delivery hours

POST
/api/v1/alert-groups
curl --request POST \
--url https://app.hostrepute.com/api/v1/alert-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Business hours", "slug": "business-hours", "timezone": "America/New_York", "schedule": { "mon": { "enabled": true, "start": "08:00", "end": "18:00" }, "tue": { "enabled": true, "start": "08:00", "end": "18:00" }, "wed": { "enabled": true, "start": "08:00", "end": "18:00" }, "thu": { "enabled": true, "start": "08:00", "end": "18:00" }, "fri": { "enabled": true, "start": "08:00", "end": "18:00" }, "sat": { "enabled": false, "start": "08:00", "end": "18:00" }, "sun": { "enabled": false, "start": "08:00", "end": "18:00" } }, "is_default": false, "alert_uuids": [ "01a178db-d7b6-7131-a50c-cb60224dd1cd" ] }'

Add a weekly schedule for alerts. Your plan limits how many sets of delivery hours a team can have.

Needs the alert-group:create ability.

Media typeapplication/json
object
name
required

A name for the delivery hours, up to 255 characters.

string

Example

Business hours
slug

A URL-friendly name, up to 255 characters. Made from the name when you leave it out.

string

Example

business-hours
timezone
required

The IANA timezone the times are in.

string

Example

America/New_York
schedule

The weekly schedule, keyed by day: mon, tue, wed, thu, fri, sat and sun. Each day is {"enabled": true, "start": "HH:MM", "end": "HH:MM"} in 24-hour time, and an enabled day must end after it starts. A day you leave out gets no alerts. Send null to allow alerts at any time.

object

Example

{
"mon": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"tue": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"wed": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"thu": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"fri": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"sat": {
"enabled": false,
"start": "08:00",
"end": "18:00"
},
"sun": {
"enabled": false,
"start": "08:00",
"end": "18:00"
}
}
is_default

Make these the team’s default delivery hours, which new alert channels start in. Defaults to false.

boolean

Example

false
alert_uuids

The UUIDs of the alert channels that follow these hours. List them with GET /api/v1/alerts.

Array<string>

Example

[
"01a178db-d7b6-7131-a50c-cb60224dd1cd"
]
Media typeapplication/json
object
data
object
uuid
string
name
string
slug
string
timezone
string
schedule
object
mon
object
enabled
boolean
start
string
end
string
tue
object
enabled
boolean
start
string
end
string
wed
object
enabled
boolean
start
string
end
string
thu
object
enabled
boolean
start
string
end
string
fri
object
enabled
boolean
start
string
end
string
sat
object
enabled
boolean
start
string
end
string
sun
object
enabled
boolean
start
string
end
string
is_default
boolean
alerts
Array<object>
object
uuid
string
type
string
frequency
string
is_active
boolean
last_sent_at
string
created_at
string
updated_at
string
created_at
string
updated_at
string

Example

{
"data": {
"uuid": "01a178db-d7f2-7120-b4f2-202accb268ce",
"name": "Business hours",
"slug": "business-hours",
"timezone": "America/New_York",
"schedule": {
"mon": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"tue": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"wed": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"thu": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"fri": {
"enabled": true,
"start": "08:00",
"end": "18:00"
},
"sat": {
"enabled": false,
"start": "08:00",
"end": "18:00"
},
"sun": {
"enabled": false,
"start": "08:00",
"end": "18:00"
}
},
"is_default": false,
"alerts": [
{
"uuid": "01a178db-d7b6-7131-a50c-cb60224dd1cd",
"type": "email",
"frequency": "once_on_listed_delisted",
"is_active": true,
"last_sent_at": "2026-10-25T21:31:02.000000Z",
"created_at": "2026-07-15T13:04:51.000000Z",
"updated_at": "2026-07-15T13:04:51.000000Z"
}
],
"created_at": "2026-10-26T15:37:16.000000Z",
"updated_at": "2026-10-26T15:37:16.000000Z"
}
}

Invalid schedule

Media typeapplication/json
object
message
string
errors
object
timezone
Array<string>
schedule.mon.end
Array<string>

Example

{
"message": "The timezone field must be a valid timezone. (and 1 more error)",
"errors": {
"timezone": [
"The timezone field must be a valid timezone."
],
"schedule.mon.end": [
"The end time must be after the start time."
]
}
}