Skip to main content
PUT
/
v1
/
organizations
/
{organization_id}
/
flows
/
{flow_id}
Update a flow
curl --request PUT \
  --url https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows/{flow_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": {
    "en-EN": "Daily Copy Flow Updated",
    "es-ES": "Updated Daily Copy Process"
  },
  "description": {
    "en-EN": "Updated Automated Daily Copy Process",
    "es-ES": "Updated Automated Copy Process"
  },
  "detection_only": false,
  "cooldown_minutes": 120,
  "enabled": true,
  "init_text": {
    "en-EN": "Starting updated copy process...",
    "es-ES": "Starting updated copy process..."
  },
  "ok_text": {
    "en-EN": "Copy Completed Successfully"
  },
  "ko_text": {
    "en-EN": "Copy failed. Please check the logs."
  },
  "target": {
    "type": "workspaces",
    "ids": [
      "507f1f77bcf86cd799439012",
      "507f1f77bcf86cd799439013"
    ]
  },
  "microservice_id": "507f1f77bcf86cd799439014",
  "conditions": [
    {
      "condition_type_id": "507f1f77bcf86cd799439015",
      "operator": "gte",
      "compare_to": "90",
      "period": null,
      "check_every": 600
    }
  ]
}
'
import requests

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

payload = {
"name": {
"en-EN": "Daily Copy Flow Updated",
"es-ES": "Updated Daily Copy Process"
},
"description": {
"en-EN": "Updated Automated Daily Copy Process",
"es-ES": "Updated Automated Copy Process"
},
"detection_only": False,
"cooldown_minutes": 120,
"enabled": True,
"init_text": {
"en-EN": "Starting updated copy process...",
"es-ES": "Starting updated copy process..."
},
"ok_text": { "en-EN": "Copy Completed Successfully" },
"ko_text": { "en-EN": "Copy failed. Please check the logs." },
"target": {
"type": "workspaces",
"ids": ["507f1f77bcf86cd799439012", "507f1f77bcf86cd799439013"]
},
"microservice_id": "507f1f77bcf86cd799439014",
"conditions": [
{
"condition_type_id": "507f1f77bcf86cd799439015",
"operator": "gte",
"compare_to": "90",
"period": None,
"check_every": 600
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: {'en-EN': 'Daily Copy Flow Updated', 'es-ES': 'Updated Daily Copy Process'},
description: {
'en-EN': 'Updated Automated Daily Copy Process',
'es-ES': 'Updated Automated Copy Process'
},
detection_only: false,
cooldown_minutes: 120,
enabled: true,
init_text: {
'en-EN': 'Starting updated copy process...',
'es-ES': 'Starting updated copy process...'
},
ok_text: {'en-EN': 'Copy Completed Successfully'},
ko_text: {'en-EN': 'Copy failed. Please check the logs.'},
target: {
type: 'workspaces',
ids: ['507f1f77bcf86cd799439012', '507f1f77bcf86cd799439013']
},
microservice_id: '507f1f77bcf86cd799439014',
conditions: [
{
condition_type_id: '507f1f77bcf86cd799439015',
operator: 'gte',
compare_to: '90',
period: null,
check_every: 600
}
]
})
};

fetch('https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows/{flow_id}', 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/{flow_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => [
'en-EN' => 'Daily Copy Flow Updated',
'es-ES' => 'Updated Daily Copy Process'
],
'description' => [
'en-EN' => 'Updated Automated Daily Copy Process',
'es-ES' => 'Updated Automated Copy Process'
],
'detection_only' => false,
'cooldown_minutes' => 120,
'enabled' => true,
'init_text' => [
'en-EN' => 'Starting updated copy process...',
'es-ES' => 'Starting updated copy process...'
],
'ok_text' => [
'en-EN' => 'Copy Completed Successfully'
],
'ko_text' => [
'en-EN' => 'Copy failed. Please check the logs.'
],
'target' => [
'type' => 'workspaces',
'ids' => [
'507f1f77bcf86cd799439012',
'507f1f77bcf86cd799439013'
]
],
'microservice_id' => '507f1f77bcf86cd799439014',
'conditions' => [
[
'condition_type_id' => '507f1f77bcf86cd799439015',
'operator' => 'gte',
'compare_to' => '90',
'period' => null,
'check_every' => 600
]
]
]),
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/{flow_id}"

payload := strings.NewReader("{\n \"name\": {\n \"en-EN\": \"Daily Copy Flow Updated\",\n \"es-ES\": \"Updated Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Updated Automated Daily Copy Process\",\n \"es-ES\": \"Updated Automated Copy Process\"\n },\n \"detection_only\": false,\n \"cooldown_minutes\": 120,\n \"enabled\": true,\n \"init_text\": {\n \"en-EN\": \"Starting updated copy process...\",\n \"es-ES\": \"Starting updated copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Copy failed. Please 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\": \"gte\",\n \"compare_to\": \"90\",\n \"period\": null,\n \"check_every\": 600\n }\n ]\n}")

req, _ := http.NewRequest("PUT", 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.put("https://api.staging.flxwvdexternal.com/v1/organizations/{organization_id}/flows/{flow_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {\n \"en-EN\": \"Daily Copy Flow Updated\",\n \"es-ES\": \"Updated Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Updated Automated Daily Copy Process\",\n \"es-ES\": \"Updated Automated Copy Process\"\n },\n \"detection_only\": false,\n \"cooldown_minutes\": 120,\n \"enabled\": true,\n \"init_text\": {\n \"en-EN\": \"Starting updated copy process...\",\n \"es-ES\": \"Starting updated copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Copy failed. Please 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\": \"gte\",\n \"compare_to\": \"90\",\n \"period\": null,\n \"check_every\": 600\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {\n \"en-EN\": \"Daily Copy Flow Updated\",\n \"es-ES\": \"Updated Daily Copy Process\"\n },\n \"description\": {\n \"en-EN\": \"Updated Automated Daily Copy Process\",\n \"es-ES\": \"Updated Automated Copy Process\"\n },\n \"detection_only\": false,\n \"cooldown_minutes\": 120,\n \"enabled\": true,\n \"init_text\": {\n \"en-EN\": \"Starting updated copy process...\",\n \"es-ES\": \"Starting updated copy process...\"\n },\n \"ok_text\": {\n \"en-EN\": \"Copy Completed Successfully\"\n },\n \"ko_text\": {\n \"en-EN\": \"Copy failed. Please 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\": \"gte\",\n \"compare_to\": \"90\",\n \"period\": null,\n \"check_every\": 600\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "name": "<string>",
  "description": "<string>",
  "version": 123,
  "detection_only": true,
  "cooldown_minutes": 123,
  "enabled": true,
  "target": {
    "ids": [
      "<string>"
    ]
  },
  "conditions": [
    {
      "condition_type_id": "<string>",
      "metric": "<string>",
      "operator": "<string>",
      "compare_to": "<string>",
      "check_every": 123,
      "period": 123
    }
  ],
  "trigger": "<string>",
  "microservice_id": "<string>",
  "init_text": "<string>",
  "ok_text": "<string>",
  "ko_text": "<string>",
  "execution_metrics": {
    "targeted_workspaces": 123,
    "evaluations_per_day": 123,
    "possible_executions_per_day": 123,
    "total_possible_executions_per_day": 123
  }
}
{
"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}$
flow_id
string
required

Unique identifier for the flow to update

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

Body

application/json
name
object
required

Flow name. At least one language key is required; each value between 1 and 512 characters.

description
object
required

Flow description. At least one language key is required; each value between 1 and 512 characters.

detection_only
boolean
required
cooldown_minutes
number
required

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

Required range: 10 <= x <= 1440
enabled
boolean
required

Indicates if the flow is enabled. PUT expects a complete definition; this field is required.

init_text
object | null
required

Initial text message. Mandatory in PUT. Send null to clear; otherwise, an object with at least one language key; each value between 1 and 512 characters.

ok_text
object | null
required

Success text message. Mandatory in PUT. Send null to clear; otherwise, object with at least one language key; each value between 1 and 512 characters.

ko_text
object | null
required

Error text message. Mandatory in PUT. Send null to clear; otherwise, an object with at least one language key; each value between 1 and 512 characters.

target
object
required
microservice_id
string
required
Maximum string length: 24
Pattern: ^[0-9a-f]{24}$
conditions
object[]
required

Response

Flow updated successfully. The response contains the updated 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