Workflows
Create workflow
Creates a new workflow with the provided data.
POST
/
api
/
workflows
Create workflow
curl --request POST \
--url https://{baseUrl}/api/v1/api/workflows \
--header 'Content-Type: application/json' \
--data '
{
"name": "Group Workflow",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": [
"<string>"
],
"schedule": [
{
"cron": "0 2 * * 1"
}
],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
}
}
}
}
'import requests
url = "https://{baseUrl}/api/v1/api/workflows"
payload = {
"name": "Group Workflow",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": ["<string>"],
"schedule": [{ "cron": "0 2 * * 1" }],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": ["<string>"]
}
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Group Workflow',
content: {
jobs: {},
name: '<string>',
on: {
target: ['<string>'],
schedule: [{cron: '0 2 * * 1'}],
assetsAdded: {windowMinutes: 720, maxAssets: 2500.5, targetTypes: ['<string>']}
}
}
})
};
fetch('https://{baseUrl}/api/v1/api/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{baseUrl}/api/v1/api/workflows"
payload := strings.NewReader("{\n \"name\": \"Group Workflow\",\n \"content\": {\n \"jobs\": {},\n \"name\": \"<string>\",\n \"on\": {\n \"target\": [\n \"<string>\"\n ],\n \"schedule\": [\n {\n \"cron\": \"0 2 * * 1\"\n }\n ],\n \"assetsAdded\": {\n \"windowMinutes\": 720,\n \"maxAssets\": 2500.5,\n \"targetTypes\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": [
"<string>"
],
"schedule": [
{
"cron": "0 2 * * 1"
}
],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
}
}
},
"filePath": "<string>",
"isCanDelete": true,
"isCanEdit": true
}请求体
application/json
⌘I
Create workflow
curl --request POST \
--url https://{baseUrl}/api/v1/api/workflows \
--header 'Content-Type: application/json' \
--data '
{
"name": "Group Workflow",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": [
"<string>"
],
"schedule": [
{
"cron": "0 2 * * 1"
}
],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
}
}
}
}
'import requests
url = "https://{baseUrl}/api/v1/api/workflows"
payload = {
"name": "Group Workflow",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": ["<string>"],
"schedule": [{ "cron": "0 2 * * 1" }],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": ["<string>"]
}
}
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Group Workflow',
content: {
jobs: {},
name: '<string>',
on: {
target: ['<string>'],
schedule: [{cron: '0 2 * * 1'}],
assetsAdded: {windowMinutes: 720, maxAssets: 2500.5, targetTypes: ['<string>']}
}
}
})
};
fetch('https://{baseUrl}/api/v1/api/workflows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{baseUrl}/api/v1/api/workflows"
payload := strings.NewReader("{\n \"name\": \"Group Workflow\",\n \"content\": {\n \"jobs\": {},\n \"name\": \"<string>\",\n \"on\": {\n \"target\": [\n \"<string>\"\n ],\n \"schedule\": [\n {\n \"cron\": \"0 2 * * 1\"\n }\n ],\n \"assetsAdded\": {\n \"windowMinutes\": 720,\n \"maxAssets\": 2500.5,\n \"targetTypes\": [\n \"<string>\"\n ]\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"content": {
"jobs": {},
"name": "<string>",
"on": {
"target": [
"<string>"
],
"schedule": [
{
"cron": "0 2 * * 1"
}
],
"assetsAdded": {
"windowMinutes": 720,
"maxAssets": 2500.5,
"targetTypes": [
"<string>"
]
}
}
},
"filePath": "<string>",
"isCanDelete": true,
"isCanEdit": true
}