Create an alert schedule
POST/projects/{projectId}/entities/{entityId}/alertSchedules
Base URL: https://api.tinkermode.com
Create an alert schedule for this entity.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain the key of a user or service account with permissions to create alert schedules of the entity or a project API key with the admin operation permission.
Path parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
projectId | integer | Yes | The unique ID for a specified project. | |
entityId | string | Yes | Entity ID (unique within project) |
Request body
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
description | string | No | default: "" | Optional description for the alert schedule |
name | string | Yes | The name of the alert schedule | |
timeZone | string | Yes | The time zone to use for the schedule (IANA time zone database format, e.g. 'America/New_York') | |
weeklySchedules | object | Yes | Weekly schedule configuration |
Request example
{
"description": "Standard business hours for weekdays with extended hours on Friday",
"name": "Business Hours Schedule",
"timeZone": "America/New_York",
"weeklySchedules": {
"friday": {
"timeWindows": [
{
"end": "18:00:00",
"start": "09:00:00"
}
]
},
"monday": {
"timeWindows": [
{
"end": "17:00:00",
"start": "09:00:00"
}
]
},
"saturday": {
"timeWindows": [
{
"end": "14:00:00",
"start": "10:00:00"
}
]
},
"sunday": {
"timeWindows": []
},
"thursday": {
"timeWindows": [
{
"end": "17:00:00",
"start": "09:00:00"
}
]
},
"tuesday": {
"timeWindows": [
{
"end": "17:00:00",
"start": "09:00:00"
}
]
},
"wednesday": {
"timeWindows": [
{
"end": "17:00:00",
"start": "09:00:00"
}
]
}
}
}Responses
201 Successfully created a new alert schedule.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
description | string | No | default: "" | Optional description for the alert schedule |
entityId | string | No | Optional entity ID if the schedule is associated with a specific entity | |
name | string | No | The name of the alert schedule | |
projectId | integer | No | The unique identifier for the project the alert rule belongs to | |
timeZone | string | No | The time zone to use for the schedule (IANA time zone database format, e.g. 'America/New_York') | |
weeklySchedules | object | No | Weekly schedule configuration |
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |