curl --request POST \
--url https://api.getcortexapp.com/api/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"isRootAction": true,
"name": "<string>",
"outgoingActions": [
"<string>"
],
"schema": {
"headers": {},
"type": "<string>",
"url": "<string>",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {},
"isDraft": true,
"name": "<string>",
"restrictActionCompletionToRunnerUser": true,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": true,
"lastUpdatedAt": "<string>",
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [
{
"id": "<string>"
}
]
}
'import requests
url = "https://api.getcortexapp.com/api/v1/workflows"
payload = {
"actions": [
{
"isRootAction": True,
"name": "<string>",
"outgoingActions": ["<string>"],
"schema": {
"headers": {},
"type": "<string>",
"url": "<string>",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {},
"isDraft": True,
"name": "<string>",
"restrictActionCompletionToRunnerUser": True,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": True,
"lastUpdatedAt": "<string>",
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [{ "id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
isRootAction: true,
name: '<string>',
outgoingActions: ['<string>'],
schema: {
headers: {},
type: '<string>',
url: '<string>',
integrationAlias: '<string>',
payload: '<string>',
targetHost: '<string>'
},
slug: '<string>'
}
],
filter: {},
isDraft: true,
name: '<string>',
restrictActionCompletionToRunnerUser: true,
tag: '<string>',
variables: [{slug: '<string>', defaultValue: {}, description: '<string>'}],
createdAt: '<string>',
description: '<string>',
failedRunResponseTemplate: '<string>',
iconTag: '<string>',
isRunnableViaApi: true,
lastUpdatedAt: '<string>',
runResponseTemplate: '<string>',
runRestrictionPolicies: [{id: '<string>'}]
})
};
fetch('https://api.getcortexapp.com/api/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.getcortexapp.com/api/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([
'actions' => [
[
'isRootAction' => true,
'name' => '<string>',
'outgoingActions' => [
'<string>'
],
'schema' => [
'headers' => [
],
'type' => '<string>',
'url' => '<string>',
'integrationAlias' => '<string>',
'payload' => '<string>',
'targetHost' => '<string>'
],
'slug' => '<string>'
]
],
'filter' => [
],
'isDraft' => true,
'name' => '<string>',
'restrictActionCompletionToRunnerUser' => true,
'tag' => '<string>',
'variables' => [
[
'slug' => '<string>',
'defaultValue' => [
],
'description' => '<string>'
]
],
'createdAt' => '<string>',
'description' => '<string>',
'failedRunResponseTemplate' => '<string>',
'iconTag' => '<string>',
'isRunnableViaApi' => true,
'lastUpdatedAt' => '<string>',
'runResponseTemplate' => '<string>',
'runRestrictionPolicies' => [
[
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.getcortexapp.com/api/v1/workflows"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getcortexapp.com/api/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcortexapp.com/api/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/json'
request.body = "{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"actions": [
{
"isRootAction": true,
"name": "<string>",
"outgoingActions": [
"<string>"
],
"schema": {
"headers": {},
"httpMethod": "GET",
"type": "<string>",
"url": "<string>",
"integration": "AzureDevops",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {
"type": "GLOBAL"
},
"isDraft": true,
"name": "<string>",
"restrictActionCompletionToRunnerUser": true,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"type": "STRING",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"createdBy": {
"name": "Cristina Buenahora",
"email": "cristina@cortex.io"
},
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": true,
"lastUpdatedAt": "<string>",
"lastUpdatedBy": {
"name": "Cristina Buenahora",
"email": "cristina@cortex.io"
},
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [
{
"id": "<string>",
"type": "USER"
}
]
}{
"message": "<string>",
"type": "INTEGRATION_MISSING",
"details": "<string>",
"errorCode": "<string>",
"gatewayHttpStatus": 123,
"httpStatus": 123,
"requestId": "<string>"
}{
"message": "<string>",
"type": "INTEGRATION_MISSING",
"details": "<string>",
"errorCode": "<string>",
"gatewayHttpStatus": 123,
"httpStatus": 123,
"requestId": "<string>"
}{
"status": 429,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"instance": "<string>",
"retryAfter": 1
}Create or update workflow
Create or update new workflow.
API key must have the Edit workflows permission.
Note: If a workflow with the same tag already exists, it will be updated.
curl --request POST \
--url https://api.getcortexapp.com/api/v1/workflows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"isRootAction": true,
"name": "<string>",
"outgoingActions": [
"<string>"
],
"schema": {
"headers": {},
"type": "<string>",
"url": "<string>",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {},
"isDraft": true,
"name": "<string>",
"restrictActionCompletionToRunnerUser": true,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": true,
"lastUpdatedAt": "<string>",
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [
{
"id": "<string>"
}
]
}
'import requests
url = "https://api.getcortexapp.com/api/v1/workflows"
payload = {
"actions": [
{
"isRootAction": True,
"name": "<string>",
"outgoingActions": ["<string>"],
"schema": {
"headers": {},
"type": "<string>",
"url": "<string>",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {},
"isDraft": True,
"name": "<string>",
"restrictActionCompletionToRunnerUser": True,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": True,
"lastUpdatedAt": "<string>",
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [{ "id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
isRootAction: true,
name: '<string>',
outgoingActions: ['<string>'],
schema: {
headers: {},
type: '<string>',
url: '<string>',
integrationAlias: '<string>',
payload: '<string>',
targetHost: '<string>'
},
slug: '<string>'
}
],
filter: {},
isDraft: true,
name: '<string>',
restrictActionCompletionToRunnerUser: true,
tag: '<string>',
variables: [{slug: '<string>', defaultValue: {}, description: '<string>'}],
createdAt: '<string>',
description: '<string>',
failedRunResponseTemplate: '<string>',
iconTag: '<string>',
isRunnableViaApi: true,
lastUpdatedAt: '<string>',
runResponseTemplate: '<string>',
runRestrictionPolicies: [{id: '<string>'}]
})
};
fetch('https://api.getcortexapp.com/api/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.getcortexapp.com/api/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([
'actions' => [
[
'isRootAction' => true,
'name' => '<string>',
'outgoingActions' => [
'<string>'
],
'schema' => [
'headers' => [
],
'type' => '<string>',
'url' => '<string>',
'integrationAlias' => '<string>',
'payload' => '<string>',
'targetHost' => '<string>'
],
'slug' => '<string>'
]
],
'filter' => [
],
'isDraft' => true,
'name' => '<string>',
'restrictActionCompletionToRunnerUser' => true,
'tag' => '<string>',
'variables' => [
[
'slug' => '<string>',
'defaultValue' => [
],
'description' => '<string>'
]
],
'createdAt' => '<string>',
'description' => '<string>',
'failedRunResponseTemplate' => '<string>',
'iconTag' => '<string>',
'isRunnableViaApi' => true,
'lastUpdatedAt' => '<string>',
'runResponseTemplate' => '<string>',
'runRestrictionPolicies' => [
[
'id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/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.getcortexapp.com/api/v1/workflows"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.getcortexapp.com/api/v1/workflows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getcortexapp.com/api/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/json'
request.body = "{\n \"actions\": [\n {\n \"isRootAction\": true,\n \"name\": \"<string>\",\n \"outgoingActions\": [\n \"<string>\"\n ],\n \"schema\": {\n \"headers\": {},\n \"type\": \"<string>\",\n \"url\": \"<string>\",\n \"integrationAlias\": \"<string>\",\n \"payload\": \"<string>\",\n \"targetHost\": \"<string>\"\n },\n \"slug\": \"<string>\"\n }\n ],\n \"filter\": {},\n \"isDraft\": true,\n \"name\": \"<string>\",\n \"restrictActionCompletionToRunnerUser\": true,\n \"tag\": \"<string>\",\n \"variables\": [\n {\n \"slug\": \"<string>\",\n \"defaultValue\": {},\n \"description\": \"<string>\"\n }\n ],\n \"createdAt\": \"<string>\",\n \"description\": \"<string>\",\n \"failedRunResponseTemplate\": \"<string>\",\n \"iconTag\": \"<string>\",\n \"isRunnableViaApi\": true,\n \"lastUpdatedAt\": \"<string>\",\n \"runResponseTemplate\": \"<string>\",\n \"runRestrictionPolicies\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"actions": [
{
"isRootAction": true,
"name": "<string>",
"outgoingActions": [
"<string>"
],
"schema": {
"headers": {},
"httpMethod": "GET",
"type": "<string>",
"url": "<string>",
"integration": "AzureDevops",
"integrationAlias": "<string>",
"payload": "<string>",
"targetHost": "<string>"
},
"slug": "<string>"
}
],
"filter": {
"type": "GLOBAL"
},
"isDraft": true,
"name": "<string>",
"restrictActionCompletionToRunnerUser": true,
"tag": "<string>",
"variables": [
{
"slug": "<string>",
"type": "STRING",
"defaultValue": {},
"description": "<string>"
}
],
"createdAt": "<string>",
"createdBy": {
"name": "Cristina Buenahora",
"email": "cristina@cortex.io"
},
"description": "<string>",
"failedRunResponseTemplate": "<string>",
"iconTag": "<string>",
"isRunnableViaApi": true,
"lastUpdatedAt": "<string>",
"lastUpdatedBy": {
"name": "Cristina Buenahora",
"email": "cristina@cortex.io"
},
"runResponseTemplate": "<string>",
"runRestrictionPolicies": [
{
"id": "<string>",
"type": "USER"
}
]
}{
"message": "<string>",
"type": "INTEGRATION_MISSING",
"details": "<string>",
"errorCode": "<string>",
"gatewayHttpStatus": 123,
"httpStatus": 123,
"requestId": "<string>"
}{
"message": "<string>",
"type": "INTEGRATION_MISSING",
"details": "<string>",
"errorCode": "<string>",
"gatewayHttpStatus": 123,
"httpStatus": 123,
"requestId": "<string>"
}{
"status": 429,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"instance": "<string>",
"retryAfter": 1
}Authorizations
All requests to the Cortex API need to provide an Authorization: Bearer <token> header, where <token> is an API key created in the Settings page of your workspace.
Body
List of actions in the workflow
Show child attributes
Show child attributes
Filter to determine in what entity contexts the workflow can run
- GLOBAL
- ENTITY
Show child attributes
Show child attributes
Whether the workflow is a draft
Name of the workflow
If true, only the user who started the workflow can complete actions. Defaults to false.
Tag of the workflow
List of variable definitions for the workflow
Show child attributes
Show child attributes
The date the workflow was created, in ISO 8601 format
Show child attributes
Show child attributes
Description of the workflow
Template for the response when the workflow run fails
Icon tag for the workflow
Whether the workflow is runnable via the public API
The date the workflow was last updated, in ISO 8601 format
Show child attributes
Show child attributes
Template for the response when the workflow is completed successfully
List of restriction policies for the workflow
Show child attributes
Show child attributes
Response
Workflow created successfully
List of actions in the workflow
Show child attributes
Show child attributes
Filter to determine in what entity contexts the workflow can run
- GLOBAL
- ENTITY
Show child attributes
Show child attributes
Whether the workflow is a draft
Name of the workflow
If true, only the user who started the workflow can complete actions. Defaults to false.
Tag of the workflow
List of variable definitions for the workflow
Show child attributes
Show child attributes
The date the workflow was created, in ISO 8601 format
Show child attributes
Show child attributes
Description of the workflow
Template for the response when the workflow run fails
Icon tag for the workflow
Whether the workflow is runnable via the public API
The date the workflow was last updated, in ISO 8601 format
Show child attributes
Show child attributes
Template for the response when the workflow is completed successfully
List of restriction policies for the workflow
Show child attributes
Show child attributes