Skip to main content
POST
/
v1
/
organizations
/
{organization_id}
/
flows
Create a flow
curl --request POST \
  --url https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": {
    "en-EN": "Daily Backup Flow",
    "es-ES": "Daily Copy Process"
  },
  "description": {
    "en-EN": "Automated daily backup process",
    "es-ES": "Automated Daily Backup Process"
  },
  "type": "workspace",
  "detection_only": false,
  "cooldown_minutes": 60,
  "enabled": false,
  "init_text": {
    "en-EN": "Starting backup process...",
    "es-ES": "Starting copy process..."
  },
  "ok_text": {
    "en-EN": "Backup completed successfully",
    "es-ES": "Copy Completed Successfully"
  },
  "ko_text": {
    "en-EN": "Backup failed. Please check logs.",
    "es-ES": "Copy failed. Check the logs."
  },
  "target": {
    "type": "workspaces",
    "ids": [
      "507f1f77bcf86cd799439012",
      "507f1f77bcf86cd799439013"
    ]
  },
  "microservice_id": "507f1f77bcf86cd799439014",
  "conditions": [
    {
      "condition_type_id": "507f1f77bcf86cd799439015",
      "operator": "gt",
      "compare_to": "80",
      "check_every": 300
    }
  ]
}
'
import requests

url = "https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows"

payload = {
"name": {
"en-EN": "Daily Backup Flow",
"es-ES": "Daily Copy Process"
},
"description": {
"en-EN": "Automated daily backup process",
"es-ES": "Automated Daily Backup Process"
},
"type": "workspace",
"detection_only": False,
"cooldown_minutes": 60,
"enabled": False,
"init_text": {
"en-EN": "Starting backup process...",
"es-ES": "Starting copy process..."
},
"ok_text": {
"en-EN": "Backup completed successfully",
"es-ES": "Copy Completed Successfully"
},
"ko_text": {
"en-EN": "Backup failed. Please check logs.",
"es-ES": "Copy failed. Check the logs."
},
"target": {
"type": "workspaces",
"ids": ["507f1f77bcf86cd799439012", "507f1f77bcf86cd799439013"]
},
"microservice_id": "507f1f77bcf86cd799439014",
"conditions": [
{
"condition_type_id": "507f1f77bcf86cd799439015",
"operator": "gt",
"compare_to": "80",
"check_every": 300
}
]
}
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({
name: {'en-EN': 'Daily Backup Flow', 'es-ES': 'Daily Copy Process'},
description: {
'en-EN': 'Automated daily backup process',
'es-ES': 'Automated Daily Backup Process'
},
type: 'workspace',
detection_only: false,
cooldown_minutes: 60,
enabled: false,
init_text: {'en-EN': 'Starting backup process...', 'es-ES': 'Starting copy process...'},
ok_text: {
'en-EN': 'Backup completed successfully',
'es-ES': 'Copy Completed Successfully'
},
ko_text: {
'en-EN': 'Backup failed. Please check logs.',
'es-ES': 'Copy failed. Check the logs.'
},
target: {
type: 'workspaces',
ids: ['507f1f77bcf86cd799439012', '507f1f77bcf86cd799439013']
},
microservice_id: '507f1f77bcf86cd799439014',
conditions: [
{
condition_type_id: '507f1f77bcf86cd799439015',
operator: 'gt',
compare_to: '80',
check_every: 300
}
]
})
};

fetch('https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows', 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.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows",
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([
'name' => [
'en-EN' => 'Daily Backup Flow',
'es-ES' => 'Daily Copy Process'
],
'description' => [
'en-EN' => 'Automated daily backup process',
'es-ES' => 'Automated Daily Backup Process'
],
'type' => 'workspace',
'detection_only' => false,
'cooldown_minutes' => 60,
'enabled' => false,
'init_text' => [
'en-EN' => 'Starting backup process...',
'es-ES' => 'Starting copy process...'
],
'ok_text' => [
'en-EN' => 'Backup completed successfully',
'es-ES' => 'Copy Completed Successfully'
],
'ko_text' => [
'en-EN' => 'Backup failed. Please check logs.',
'es-ES' => 'Copy failed. Check the logs.'
],
'target' => [
'type' => 'workspaces',
'ids' => [
'507f1f77bcf86cd799439012',
'507f1f77bcf86cd799439013'
]
],
'microservice_id' => '507f1f77bcf86cd799439014',
'conditions' => [
[
'condition_type_id' => '507f1f77bcf86cd799439015',
'operator' => 'gt',
'compare_to' => '80',
'check_every' => 300
]
]
]),
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.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows"

payload := strings.NewReader("{\n \"name\": {\n \"en-EN\": \"Daily Backup Flow\",\n \"es-ES\": \"Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Automated daily backup process\",\n \"es-ES\": \"Automated Daily Backup Process\"\n },\n \"type\": \"workspace\",\n \"detection_only\": false,\n \"cooldown_minutes\": 60,\n \"enabled\": false,\n \"init_text\": {\n \"en-EN\": \"Starting backup process...\",\n \"es-ES\": \"Starting copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Backup completed successfully\",\n \"es-ES\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Backup failed. Please check logs.\",\n \"es-ES\": \"Copy failed. Check the logs.\"\n },\n \"target\": {\n \"type\": \"workspaces\",\n \"ids\": [\n \"507f1f77bcf86cd799439012\",\n \"507f1f77bcf86cd799439013\"\n ]\n },\n \"microservice_id\": \"507f1f77bcf86cd799439014\",\n \"conditions\": [\n {\n \"condition_type_id\": \"507f1f77bcf86cd799439015\",\n \"operator\": \"gt\",\n \"compare_to\": \"80\",\n \"check_every\": 300\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.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {\n \"en-EN\": \"Daily Backup Flow\",\n \"es-ES\": \"Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Automated daily backup process\",\n \"es-ES\": \"Automated Daily Backup Process\"\n },\n \"type\": \"workspace\",\n \"detection_only\": false,\n \"cooldown_minutes\": 60,\n \"enabled\": false,\n \"init_text\": {\n \"en-EN\": \"Starting backup process...\",\n \"es-ES\": \"Starting copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Backup completed successfully\",\n \"es-ES\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Backup failed. Please check logs.\",\n \"es-ES\": \"Copy failed. Check the logs.\"\n },\n \"target\": {\n \"type\": \"workspaces\",\n \"ids\": [\n \"507f1f77bcf86cd799439012\",\n \"507f1f77bcf86cd799439013\"\n ]\n },\n \"microservice_id\": \"507f1f77bcf86cd799439014\",\n \"conditions\": [\n {\n \"condition_type_id\": \"507f1f77bcf86cd799439015\",\n \"operator\": \"gt\",\n \"compare_to\": \"80\",\n \"check_every\": 300\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows")

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 \"name\": {\n \"en-EN\": \"Daily Backup Flow\",\n \"es-ES\": \"Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Automated daily backup process\",\n \"es-ES\": \"Automated Daily Backup Process\"\n },\n \"type\": \"workspace\",\n \"detection_only\": false,\n \"cooldown_minutes\": 60,\n \"enabled\": false,\n \"init_text\": {\n \"en-EN\": \"Starting backup process...\",\n \"es-ES\": \"Starting copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Backup completed successfully\",\n \"es-ES\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Backup failed. Please check logs.\",\n \"es-ES\": \"Copy failed. Check the logs.\"\n },\n \"target\": {\n \"type\": \"workspaces\",\n \"ids\": [\n \"507f1f77bcf86cd799439012\",\n \"507f1f77bcf86cd799439013\"\n ]\n },\n \"microservice_id\": \"507f1f77bcf86cd799439014\",\n \"conditions\": [\n {\n \"condition_type_id\": \"507f1f77bcf86cd799439015\",\n \"operator\": \"gt\",\n \"compare_to\": \"80\",\n \"check_every\": 300\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "507f1f77bcf86cd799439011"
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}
{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}

Authorizations

Authorization
string
header
required

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

Headers

Accept-Language
enum<string>
default:es-ES

Language code for text fields supporting multiple languages. When creating or updating resources, this specifies the language for the provided text values. When retrieving resources, this determines which language variant the multilingual text fields return. Accepted values: 'en-EN' (English), 'es-ES' (Spanish), 'pt-BR' (Portuguese), 'ca-ES' (Catalan), 'eu-ES' (Basque). The default is 'es-ES' if not provided.

Available options:
en-EN,
es-ES,
pt-BR,
ca-ES,
eu-ES

Path Parameters

organization id
string
required

The unique identifier of the organization

Maximum string length: 24
Pattern: ^[0-9a-f]{24}$

Body

application/json
name
object
required

Flow name. Requires at least one language key; each value must be between 1 and 512 characters.

description
object
required

Flow description. Requires at least one language key; each value must be between 1 and 512 characters.

type
enum<string>
required
Available options:
session,
workspace
detection_only
boolean
required
cooldown_minutes
number
required

Waiting time in minutes. Must be between 10 and 1440.

Required range: 10 <= x <= 1440
target
object
required
microservice_id
string
required
Maximum string length: 24
Pattern: ^[0-9a-f]{24}$
conditions
object[]
required
enabled
boolean
default:false

If true, the flow is enabled upon creation (requires valid conditions, microservice, and target). If omitted or false, a disabled flow is created.

init_text
object

Initial text message. Omitted if not needed. When provided, requires at least one language key; each value must be between 1 and 512 characters.

ok_text
object

Success text message. Omitted if not needed. When provided, requires at least one language key; each value must be between 1 and 512 characters.

ko_text
object

Error text message. Omitted if not needed. When provided, requires at least one language key; each value must be between 1 and 512 characters.

Response

Flow successfully created. The response contains the created resource.

Flow detail as returned by GET flow by id. Organization is implied by the route /v1/organizations/{organization_id}/flows/{flow_id}. Target workspaces/groups are normalized in target.ids (hexadecimal strings of MongoDB ObjectId).

id
string
required
Maximum string length: 24
Pattern: ^[0-9a-f]{24}$
created_at
string<date-time>
required
name
string
required

Resolved to Accept-Language when multilingual

description
string
required

Resolved to Accept-Language when multilingual

type
enum<string>
required
Available options:
session,
workspace
version
number
required
detection_only
boolean
required
cooldown_minutes
number
required

Waiting time in minutes

enabled
boolean
required
target
object
required

Execution destination: type selects the scope; ids list Workspace _id values, Workspace group _id values, or Reporting Group _id (empty when type is ALL_WORKSPACES)

conditions
object[]

Omitted or empty when the flow has no conditions

trigger
string | null
microservice_id
string | null

Linked microservice ID when present

init_text
string | null

Resolved to Accept-Language when multilingual

ok_text
string | null

Resolved to Accept-Language when multilingual

ko_text
string | null

Resolved to Accept-Language when multilingual

execution_metrics
object | null

Present when metrics are calculated for this flow