import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.incidents.create({
description: "Service outage in region X",
startDatetime: new Date("2023-10-01T08:00:00Z"),
resolutionDatetime: new Date("2023-10-01T12:00:00Z"),
impactCategory: "High",
sessionsImpacted: 1500,
markdown: "**Incident Details**",
organizationId: 123,
subOrganizationId: 456,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
from syllable_sdk.utils import parse_datetime
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.incidents.create(request={
"description": "Service outage in region X",
"start_datetime": parse_datetime("2023-10-01T08:00:00Z"),
"resolution_datetime": parse_datetime("2023-10-01T12:00:00Z"),
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"organization_id": 123,
"sub_organization_id": 456,
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/incidents/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"description": "Service outage in region X",
"start_datetime": "2023-10-01T08:00:00Z",
"resolution_datetime": "2023-10-01T12:00:00Z",
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"organization_id": 123,
"sub_organization_id": 456,
"sub_organization": "SubOrg A"
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Service outage in region X',
start_datetime: '2023-10-01T08:00:00Z',
resolution_datetime: '2023-10-01T12:00:00Z',
impact_category: 'High',
sessions_impacted: 1500,
markdown: '**Incident Details**',
organization_id: 123,
sub_organization_id: 456,
sub_organization: 'SubOrg A'
})
};
fetch('https://api.syllable.cloud/api/v1/incidents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syllable.cloud/api/v1/incidents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Service outage in region X',
'start_datetime' => '2023-10-01T08:00:00Z',
'resolution_datetime' => '2023-10-01T12:00:00Z',
'impact_category' => 'High',
'sessions_impacted' => 1500,
'markdown' => '**Incident Details**',
'organization_id' => 123,
'sub_organization_id' => 456,
'sub_organization' => 'SubOrg A'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/incidents/"
payload := strings.NewReader("{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.syllable.cloud/api/v1/incidents/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/incidents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}"
response = http.request(request)
puts response.read_body{
"description": "Service outage in region X",
"start_datetime": "2023-10-01T08:00:00Z",
"resolution_datetime": "2023-10-01T12:00:00Z",
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"id": 1,
"last_updated_by": "user@mail.com",
"organization_id": 123,
"sub_organization_id": 456,
"sub_organization": "SubOrg A",
"created_at": "2023-10-01T08:00:00Z",
"updated_at": "2023-10-01T08:00:00Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Incident
Create a new incident
import { SyllableSDK } from "syllable-sdk";
const syllableSDK = new SyllableSDK({
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});
async function run() {
const result = await syllableSDK.incidents.create({
description: "Service outage in region X",
startDatetime: new Date("2023-10-01T08:00:00Z"),
resolutionDatetime: new Date("2023-10-01T12:00:00Z"),
impactCategory: "High",
sessionsImpacted: 1500,
markdown: "**Incident Details**",
organizationId: 123,
subOrganizationId: 456,
});
console.log(result);
}
run();import os
from syllable_sdk import SyllableSDK
from syllable_sdk.utils import parse_datetime
with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:
res = ss_client.incidents.create(request={
"description": "Service outage in region X",
"start_datetime": parse_datetime("2023-10-01T08:00:00Z"),
"resolution_datetime": parse_datetime("2023-10-01T12:00:00Z"),
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"organization_id": 123,
"sub_organization_id": 456,
})
# Handle response
print(res)curl --request POST \
--url https://api.syllable.cloud/api/v1/incidents/ \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"description": "Service outage in region X",
"start_datetime": "2023-10-01T08:00:00Z",
"resolution_datetime": "2023-10-01T12:00:00Z",
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"organization_id": 123,
"sub_organization_id": 456,
"sub_organization": "SubOrg A"
}
'const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Service outage in region X',
start_datetime: '2023-10-01T08:00:00Z',
resolution_datetime: '2023-10-01T12:00:00Z',
impact_category: 'High',
sessions_impacted: 1500,
markdown: '**Incident Details**',
organization_id: 123,
sub_organization_id: 456,
sub_organization: 'SubOrg A'
})
};
fetch('https://api.syllable.cloud/api/v1/incidents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syllable.cloud/api/v1/incidents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Service outage in region X',
'start_datetime' => '2023-10-01T08:00:00Z',
'resolution_datetime' => '2023-10-01T12:00:00Z',
'impact_category' => 'High',
'sessions_impacted' => 1500,
'markdown' => '**Incident Details**',
'organization_id' => 123,
'sub_organization_id' => 456,
'sub_organization' => 'SubOrg A'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.syllable.cloud/api/v1/incidents/"
payload := strings.NewReader("{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Syllable-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.syllable.cloud/api/v1/incidents/")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.syllable.cloud/api/v1/incidents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Service outage in region X\",\n \"start_datetime\": \"2023-10-01T08:00:00Z\",\n \"resolution_datetime\": \"2023-10-01T12:00:00Z\",\n \"impact_category\": \"High\",\n \"sessions_impacted\": 1500,\n \"markdown\": \"**Incident Details**\",\n \"organization_id\": 123,\n \"sub_organization_id\": 456,\n \"sub_organization\": \"SubOrg A\"\n}"
response = http.request(request)
puts response.read_body{
"description": "Service outage in region X",
"start_datetime": "2023-10-01T08:00:00Z",
"resolution_datetime": "2023-10-01T12:00:00Z",
"impact_category": "High",
"sessions_impacted": 1500,
"markdown": "**Incident Details**",
"id": 1,
"last_updated_by": "user@mail.com",
"organization_id": 123,
"sub_organization_id": 456,
"sub_organization": "SubOrg A",
"created_at": "2023-10-01T08:00:00Z",
"updated_at": "2023-10-01T08:00:00Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Request model to create a service incident.
Description of the service incident
"Service outage in region X"
Start time of the incident
"2023-10-01T08:00:00Z"
Resolution time of the incident
"2023-10-01T12:00:00Z"
Category of the impact
"High"
Number of sessions impacted
1500
Detailed markdown description of the incident
"**Incident Details**"
The ID of the organization
123
The ID of the sub-organization
456
The name of the sub-organization (DEPRECATED)
"SubOrg A"
Response
Successful Response
Response model for service incident operations.
Description of the service incident
"Service outage in region X"
Start time of the incident
"2023-10-01T08:00:00Z"
Resolution time of the incident
"2023-10-01T12:00:00Z"
Category of the impact
"High"
Number of sessions impacted
1500
Detailed markdown description of the incident
"**Incident Details**"
The ID of the incident to update
1
The email of the user who last updated the incident
"user@mail.com"
The ID of the organization
123
The ID of the sub-organization
456
The name of the sub-organization (DEPRECATED)
"SubOrg A"
Creation time of the incident
"2023-10-01T08:00:00Z"
Last update time of the incident
"2023-10-01T08:00:00Z"

