Skip to main content
POST
/
v1
/
workflows
Creates a workflow
curl --request POST \
  --url https://api.rootly.com/v1/workflows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '
{
  "data": {
    "type": "workflows",
    "attributes": {
      "name": "<string>",
      "description": "<string>",
      "command": "<string>",
      "command_feedback_enabled": true,
      "wait": "<string>",
      "repeat_every_duration": "<string>",
      "repeat_condition_duration_since_first_run": "<string>",
      "repeat_condition_number_of_repeats": 123,
      "continuously_repeat": true,
      "repeat_on": [],
      "enabled": true,
      "locked": true,
      "position": 123,
      "workflow_group_id": "<string>",
      "trigger_params": {
        "trigger_type": "incident",
        "triggers": [
          "<string>"
        ],
        "incident_visibilities": [
          true
        ],
        "incident_kinds": [],
        "incident_statuses": [],
        "incident_inactivity_duration": "<string>",
        "incident_condition": "ALL",
        "incident_condition_visibility": "ANY",
        "incident_condition_kind": "IS",
        "incident_condition_status": "ANY",
        "incident_condition_sub_status": "ANY",
        "incident_condition_environment": "ANY",
        "incident_condition_severity": "ANY",
        "incident_condition_incident_type": "ANY",
        "incident_condition_incident_roles": "ANY",
        "incident_condition_service": "ANY",
        "incident_condition_functionality": "ANY",
        "incident_condition_group": "ANY",
        "incident_condition_cause": "ANY",
        "incident_condition_label": "ANY",
        "incident_condition_label_use_regexp": false,
        "incident_labels": [
          "<string>"
        ],
        "incident_post_mortem_condition_cause": "ANY",
        "incident_conditional_inactivity": "IS"
      },
      "environment_ids": [
        "<string>"
      ],
      "severity_ids": [
        "<string>"
      ],
      "incident_type_ids": [
        "<string>"
      ],
      "incident_role_ids": [
        "<string>"
      ],
      "service_ids": [
        "<string>"
      ],
      "functionality_ids": [
        "<string>"
      ],
      "group_ids": [
        "<string>"
      ],
      "cause_ids": [
        "<string>"
      ],
      "sub_status_ids": [
        "<string>"
      ]
    }
  }
}
'
import requests

url = "https://api.rootly.com/v1/workflows"

payload = { "data": {
"type": "workflows",
"attributes": {
"name": "<string>",
"description": "<string>",
"command": "<string>",
"command_feedback_enabled": True,
"wait": "<string>",
"repeat_every_duration": "<string>",
"repeat_condition_duration_since_first_run": "<string>",
"repeat_condition_number_of_repeats": 123,
"continuously_repeat": True,
"repeat_on": [],
"enabled": True,
"locked": True,
"position": 123,
"workflow_group_id": "<string>",
"trigger_params": {
"trigger_type": "incident",
"triggers": ["<string>"],
"incident_visibilities": [True],
"incident_kinds": [],
"incident_statuses": [],
"incident_inactivity_duration": "<string>",
"incident_condition": "ALL",
"incident_condition_visibility": "ANY",
"incident_condition_kind": "IS",
"incident_condition_status": "ANY",
"incident_condition_sub_status": "ANY",
"incident_condition_environment": "ANY",
"incident_condition_severity": "ANY",
"incident_condition_incident_type": "ANY",
"incident_condition_incident_roles": "ANY",
"incident_condition_service": "ANY",
"incident_condition_functionality": "ANY",
"incident_condition_group": "ANY",
"incident_condition_cause": "ANY",
"incident_condition_label": "ANY",
"incident_condition_label_use_regexp": False,
"incident_labels": ["<string>"],
"incident_post_mortem_condition_cause": "ANY",
"incident_conditional_inactivity": "IS"
},
"environment_ids": ["<string>"],
"severity_ids": ["<string>"],
"incident_type_ids": ["<string>"],
"incident_role_ids": ["<string>"],
"service_ids": ["<string>"],
"functionality_ids": ["<string>"],
"group_ids": ["<string>"],
"cause_ids": ["<string>"],
"sub_status_ids": ["<string>"]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'workflows',
attributes: {
name: '<string>',
description: '<string>',
command: '<string>',
command_feedback_enabled: true,
wait: '<string>',
repeat_every_duration: '<string>',
repeat_condition_duration_since_first_run: '<string>',
repeat_condition_number_of_repeats: 123,
continuously_repeat: true,
repeat_on: [],
enabled: true,
locked: true,
position: 123,
workflow_group_id: '<string>',
trigger_params: {
trigger_type: 'incident',
triggers: ['<string>'],
incident_visibilities: [true],
incident_kinds: [],
incident_statuses: [],
incident_inactivity_duration: '<string>',
incident_condition: 'ALL',
incident_condition_visibility: 'ANY',
incident_condition_kind: 'IS',
incident_condition_status: 'ANY',
incident_condition_sub_status: 'ANY',
incident_condition_environment: 'ANY',
incident_condition_severity: 'ANY',
incident_condition_incident_type: 'ANY',
incident_condition_incident_roles: 'ANY',
incident_condition_service: 'ANY',
incident_condition_functionality: 'ANY',
incident_condition_group: 'ANY',
incident_condition_cause: 'ANY',
incident_condition_label: 'ANY',
incident_condition_label_use_regexp: false,
incident_labels: ['<string>'],
incident_post_mortem_condition_cause: 'ANY',
incident_conditional_inactivity: 'IS'
},
environment_ids: ['<string>'],
severity_ids: ['<string>'],
incident_type_ids: ['<string>'],
incident_role_ids: ['<string>'],
service_ids: ['<string>'],
functionality_ids: ['<string>'],
group_ids: ['<string>'],
cause_ids: ['<string>'],
sub_status_ids: ['<string>']
}
}
})
};

fetch('https://api.rootly.com/v1/workflows', 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.rootly.com/v1/workflows",
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([
'data' => [
'type' => 'workflows',
'attributes' => [
'name' => '<string>',
'description' => '<string>',
'command' => '<string>',
'command_feedback_enabled' => true,
'wait' => '<string>',
'repeat_every_duration' => '<string>',
'repeat_condition_duration_since_first_run' => '<string>',
'repeat_condition_number_of_repeats' => 123,
'continuously_repeat' => true,
'repeat_on' => [

],
'enabled' => true,
'locked' => true,
'position' => 123,
'workflow_group_id' => '<string>',
'trigger_params' => [
'trigger_type' => 'incident',
'triggers' => [
'<string>'
],
'incident_visibilities' => [
true
],
'incident_kinds' => [

],
'incident_statuses' => [

],
'incident_inactivity_duration' => '<string>',
'incident_condition' => 'ALL',
'incident_condition_visibility' => 'ANY',
'incident_condition_kind' => 'IS',
'incident_condition_status' => 'ANY',
'incident_condition_sub_status' => 'ANY',
'incident_condition_environment' => 'ANY',
'incident_condition_severity' => 'ANY',
'incident_condition_incident_type' => 'ANY',
'incident_condition_incident_roles' => 'ANY',
'incident_condition_service' => 'ANY',
'incident_condition_functionality' => 'ANY',
'incident_condition_group' => 'ANY',
'incident_condition_cause' => 'ANY',
'incident_condition_label' => 'ANY',
'incident_condition_label_use_regexp' => false,
'incident_labels' => [
'<string>'
],
'incident_post_mortem_condition_cause' => 'ANY',
'incident_conditional_inactivity' => 'IS'
],
'environment_ids' => [
'<string>'
],
'severity_ids' => [
'<string>'
],
'incident_type_ids' => [
'<string>'
],
'incident_role_ids' => [
'<string>'
],
'service_ids' => [
'<string>'
],
'functionality_ids' => [
'<string>'
],
'group_ids' => [
'<string>'
],
'cause_ids' => [
'<string>'
],
'sub_status_ids' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+json"
],
]);

$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.rootly.com/v1/workflows"

payload := strings.NewReader("{\n \"data\": {\n \"type\": \"workflows\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"command_feedback_enabled\": true,\n \"wait\": \"<string>\",\n \"repeat_every_duration\": \"<string>\",\n \"repeat_condition_duration_since_first_run\": \"<string>\",\n \"repeat_condition_number_of_repeats\": 123,\n \"continuously_repeat\": true,\n \"repeat_on\": [],\n \"enabled\": true,\n \"locked\": true,\n \"position\": 123,\n \"workflow_group_id\": \"<string>\",\n \"trigger_params\": {\n \"trigger_type\": \"incident\",\n \"triggers\": [\n \"<string>\"\n ],\n \"incident_visibilities\": [\n true\n ],\n \"incident_kinds\": [],\n \"incident_statuses\": [],\n \"incident_inactivity_duration\": \"<string>\",\n \"incident_condition\": \"ALL\",\n \"incident_condition_visibility\": \"ANY\",\n \"incident_condition_kind\": \"IS\",\n \"incident_condition_status\": \"ANY\",\n \"incident_condition_sub_status\": \"ANY\",\n \"incident_condition_environment\": \"ANY\",\n \"incident_condition_severity\": \"ANY\",\n \"incident_condition_incident_type\": \"ANY\",\n \"incident_condition_incident_roles\": \"ANY\",\n \"incident_condition_service\": \"ANY\",\n \"incident_condition_functionality\": \"ANY\",\n \"incident_condition_group\": \"ANY\",\n \"incident_condition_cause\": \"ANY\",\n \"incident_condition_label\": \"ANY\",\n \"incident_condition_label_use_regexp\": false,\n \"incident_labels\": [\n \"<string>\"\n ],\n \"incident_post_mortem_condition_cause\": \"ANY\",\n \"incident_conditional_inactivity\": \"IS\"\n },\n \"environment_ids\": [\n \"<string>\"\n ],\n \"severity_ids\": [\n \"<string>\"\n ],\n \"incident_type_ids\": [\n \"<string>\"\n ],\n \"incident_role_ids\": [\n \"<string>\"\n ],\n \"service_ids\": [\n \"<string>\"\n ],\n \"functionality_ids\": [\n \"<string>\"\n ],\n \"group_ids\": [\n \"<string>\"\n ],\n \"cause_ids\": [\n \"<string>\"\n ],\n \"sub_status_ids\": [\n \"<string>\"\n ]\n }\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.rootly.com/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"workflows\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"command_feedback_enabled\": true,\n \"wait\": \"<string>\",\n \"repeat_every_duration\": \"<string>\",\n \"repeat_condition_duration_since_first_run\": \"<string>\",\n \"repeat_condition_number_of_repeats\": 123,\n \"continuously_repeat\": true,\n \"repeat_on\": [],\n \"enabled\": true,\n \"locked\": true,\n \"position\": 123,\n \"workflow_group_id\": \"<string>\",\n \"trigger_params\": {\n \"trigger_type\": \"incident\",\n \"triggers\": [\n \"<string>\"\n ],\n \"incident_visibilities\": [\n true\n ],\n \"incident_kinds\": [],\n \"incident_statuses\": [],\n \"incident_inactivity_duration\": \"<string>\",\n \"incident_condition\": \"ALL\",\n \"incident_condition_visibility\": \"ANY\",\n \"incident_condition_kind\": \"IS\",\n \"incident_condition_status\": \"ANY\",\n \"incident_condition_sub_status\": \"ANY\",\n \"incident_condition_environment\": \"ANY\",\n \"incident_condition_severity\": \"ANY\",\n \"incident_condition_incident_type\": \"ANY\",\n \"incident_condition_incident_roles\": \"ANY\",\n \"incident_condition_service\": \"ANY\",\n \"incident_condition_functionality\": \"ANY\",\n \"incident_condition_group\": \"ANY\",\n \"incident_condition_cause\": \"ANY\",\n \"incident_condition_label\": \"ANY\",\n \"incident_condition_label_use_regexp\": false,\n \"incident_labels\": [\n \"<string>\"\n ],\n \"incident_post_mortem_condition_cause\": \"ANY\",\n \"incident_conditional_inactivity\": \"IS\"\n },\n \"environment_ids\": [\n \"<string>\"\n ],\n \"severity_ids\": [\n \"<string>\"\n ],\n \"incident_type_ids\": [\n \"<string>\"\n ],\n \"incident_role_ids\": [\n \"<string>\"\n ],\n \"service_ids\": [\n \"<string>\"\n ],\n \"functionality_ids\": [\n \"<string>\"\n ],\n \"group_ids\": [\n \"<string>\"\n ],\n \"cause_ids\": [\n \"<string>\"\n ],\n \"sub_status_ids\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rootly.com/v1/workflows")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"workflows\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"command_feedback_enabled\": true,\n \"wait\": \"<string>\",\n \"repeat_every_duration\": \"<string>\",\n \"repeat_condition_duration_since_first_run\": \"<string>\",\n \"repeat_condition_number_of_repeats\": 123,\n \"continuously_repeat\": true,\n \"repeat_on\": [],\n \"enabled\": true,\n \"locked\": true,\n \"position\": 123,\n \"workflow_group_id\": \"<string>\",\n \"trigger_params\": {\n \"trigger_type\": \"incident\",\n \"triggers\": [\n \"<string>\"\n ],\n \"incident_visibilities\": [\n true\n ],\n \"incident_kinds\": [],\n \"incident_statuses\": [],\n \"incident_inactivity_duration\": \"<string>\",\n \"incident_condition\": \"ALL\",\n \"incident_condition_visibility\": \"ANY\",\n \"incident_condition_kind\": \"IS\",\n \"incident_condition_status\": \"ANY\",\n \"incident_condition_sub_status\": \"ANY\",\n \"incident_condition_environment\": \"ANY\",\n \"incident_condition_severity\": \"ANY\",\n \"incident_condition_incident_type\": \"ANY\",\n \"incident_condition_incident_roles\": \"ANY\",\n \"incident_condition_service\": \"ANY\",\n \"incident_condition_functionality\": \"ANY\",\n \"incident_condition_group\": \"ANY\",\n \"incident_condition_cause\": \"ANY\",\n \"incident_condition_label\": \"ANY\",\n \"incident_condition_label_use_regexp\": false,\n \"incident_labels\": [\n \"<string>\"\n ],\n \"incident_post_mortem_condition_cause\": \"ANY\",\n \"incident_conditional_inactivity\": \"IS\"\n },\n \"environment_ids\": [\n \"<string>\"\n ],\n \"severity_ids\": [\n \"<string>\"\n ],\n \"incident_type_ids\": [\n \"<string>\"\n ],\n \"incident_role_ids\": [\n \"<string>\"\n ],\n \"service_ids\": [\n \"<string>\"\n ],\n \"functionality_ids\": [\n \"<string>\"\n ],\n \"group_ids\": [\n \"<string>\"\n ],\n \"cause_ids\": [\n \"<string>\"\n ],\n \"sub_status_ids\": [\n \"<string>\"\n ]\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "type": "workflows",
    "attributes": {
      "name": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>",
      "slug": "<string>",
      "description": "<string>",
      "command": "<string>",
      "command_feedback_enabled": true,
      "wait": "<string>",
      "repeat_every_duration": "<string>",
      "repeat_condition_duration_since_first_run": "<string>",
      "repeat_condition_number_of_repeats": 123,
      "continuously_repeat": true,
      "repeat_on": [],
      "enabled": true,
      "locked": true,
      "position": 123,
      "workflow_group_id": "<string>",
      "trigger_params": {
        "trigger_type": "incident",
        "triggers": [
          "<string>"
        ],
        "incident_visibilities": [
          true
        ],
        "incident_kinds": [],
        "incident_statuses": [],
        "incident_inactivity_duration": "<string>",
        "incident_condition": "ALL",
        "incident_condition_visibility": "ANY",
        "incident_condition_kind": "IS",
        "incident_condition_status": "ANY",
        "incident_condition_sub_status": "ANY",
        "incident_condition_environment": "ANY",
        "incident_condition_severity": "ANY",
        "incident_condition_incident_type": "ANY",
        "incident_condition_incident_roles": "ANY",
        "incident_condition_service": "ANY",
        "incident_condition_functionality": "ANY",
        "incident_condition_group": "ANY",
        "incident_condition_cause": "ANY",
        "incident_condition_label": "ANY",
        "incident_condition_label_use_regexp": false,
        "incident_labels": [
          "<string>"
        ],
        "incident_post_mortem_condition_cause": "ANY",
        "incident_conditional_inactivity": "IS"
      },
      "environment_ids": [
        "<string>"
      ],
      "severity_ids": [
        "<string>"
      ],
      "incident_type_ids": [
        "<string>"
      ],
      "incident_role_ids": [
        "<string>"
      ],
      "service_ids": [
        "<string>"
      ],
      "functionality_ids": [
        "<string>"
      ],
      "group_ids": [
        "<string>"
      ],
      "cause_ids": [
        "<string>"
      ],
      "sub_status_ids": [
        "<string>"
      ]
    }
  },
  "included": [
    {
      "id": "<string>",
      "type": "<string>",
      "attributes": {},
      "relationships": {}
    }
  ]
}
{
"errors": [
{
"title": "<string>",
"status": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}
{
"errors": [
{
"title": "<string>",
"status": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/vnd.api+json
data
object
required

Response

ignores alert field conditions in create request

data
object
required
included
object[]