Templates API Reference

Get all page templates

Endpoint:

GET /v1/:page_id/templates?page=:page&per_page=:per_page
  • The default page number is 1.
  • The default per_page number is 50 and the maximum is 100 items per page.

Example response:

[
{
"id": "cl9mq0ah50646mpvlmbrvf979",
"type": "MAINTENANCE",
"name": "Some Template",
"nameTranslationId": null,
"message": "",
"messageTranslationId": null,
"messageHtml": "",
"messageHtmlTranslationId": null,
"status": "NOTSTARTEDYET",
"notify": true,
"createdAt": "2022-10-24T11:53:46.505Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFromStatuspage": false,
"deletedAt": null,
"components": [],
"translations": {
"name": null,
"message": null
}
},
{
"id": "cl9ranzrn0040xovluqicus6h",
"type": "INCIDENT",
"name": "Some Template 2",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-10-27T16:43:09.394Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFromStatuspage": false,
"deletedAt": null,
"components": [
{
"id": "cl9rbadkx0024lhvlicjbe304",
"status": "OPERATIONAL",
"componentId": "cl9fzgipf14075qjvljphlnwkk",
"templateId": "cl9ranzrn0040xovluqicus6h",
"importedFromStatuspage": false
}
],
"translations": {
"name": null,
"message": null
}
}
]

Get a template

Endpoint:

GET /v1/:page_id/templates/:template_id

Example response:

{
"id": "cl9mq0ah50646mpvlmbrvf979",
"type": "MAINTENANCE",
"name": "Some Template",
"nameTranslationId": null,
"message": "",
"messageTranslationId": null,
"messageHtml": "",
"messageHtmlTranslationId": null,
"status": "NOTSTARTEDYET",
"notify": true,
"createdAt": "2022-10-24T11:53:46.505Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFromStatuspage": false,
"deletedAt": null,
"components": [],
"translations": {
"name": null,
"message": null
}
}

Add an template

Endpoint:

POST /v1/:page_id/templates

Example request:

{
"subdomain": "some-subdomain",
"type": "INCIDENT",
"name": "Test template",
"message": "We're currently investigating an issue with the Website",
"status": "INVESTIGATING",
"notify": true,
"components": [
{
"id": "cl9fzgipf14075qjvljphlnwkk",
"status": "OPERATIONAL"
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

Example response:

{
"id": "cl9xobpoe00614tvldhh90t0w",
"type": "INCIDENT",
"name": "Test template",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-11-01T03:52:08.126Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFromStatuspage": false,
"deletedAt": null,
"components": [],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

Update template

Endpoint:

PUT /v1/:page_id/templates/:template_id

Example request:

{
"type": "INCIDENT",
"name": "Test template 2",
"message": "We're currently investigating an issue with the Website",
"status": "INVESTIGATING",
"notify": true,
"components": [
{
"id": "cl9fzgipf14075qjvljphlnwkk",
"status": "OPERATIONAL"
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

Example response:

{
"id": "cl9ranzrn0040xovluqicus6h",
"type": "INCIDENT",
"name": "Test template 2",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-10-27T16:43:09.394Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFromStatuspage": false,
"deletedAt": null,
"components": [
{
"id": "cl9xockck01654tvlwfn7vbaz",
"status": "OPERATIONAL",
"componentId": "cl9fzgipf14075qjvljphlnwkk",
"templateId": "cl9ranzrn0040xovluqicus6h",
"importedFromStatuspage": false
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

Delete template

Endpoint:

DELETE /v1/:page_id/templates/:template_id

Example response:

{
"id": "cl9ra5iu20023bxvlu1x8bqj6",
"name": "Test template",
"message": "We're currently investigating an issue with the Website",
"createdAt": "2022-10-27T16:28:47.642Z",
"site": {
"id": "cl9fzgilx14063qjvl5oqdtxtg"
}
}