Crear operaciones
Crea una o varias operaciones en base al alcance y objetivos enviados.
Tipos de operación disponibles actualmente: execute_microservice, delete_workspaces, shutdown_workspaces y restart_workspaces.
Devuelve los recursos de operación creados con el mismo contrato canónico de consulta por id.
Compatibilidad de parámetros para execute_microservice
payload.parameters solo aplica a ejecuciones de microservicios PowerShell en Windows y solo está soportado en dispositivos con el nuevo agente instalado.
Los valores enviados en payload.parameters se transmiten como texto (string). La interpretación de tipos depende de la definición de parámetros y del parseo implementado en el script del microservicio.
Para ese contexto, tipos de datos de los parámetros recomendados:
string,integer,double,decimalydatetime.- Para
doubleydecimal, use notación con punto decimal (.). - Para
datetime, use formato ISO 8601 (por ejemplo:2026-07-09T10:30:00Z). - Al ejecutarse en el destino, los valores
datetimepueden representarse en hora local. - La ejecución correcta también depende de la calidad y validaciones del script.
curl --request POST \
--url https://api.flexxible.net/v2/organizations/{organization_id}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": {
"ids": [
"<string>"
]
},
"expiration_in_seconds": 42600,
"payload": {}
}
'import requests
url = "https://api.flexxible.net/v2/organizations/{organization_id}/operations"
payload = {
"target": { "ids": ["<string>"] },
"expiration_in_seconds": 42600,
"payload": {}
}
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({target: {ids: ['<string>']}, expiration_in_seconds: 42600, payload: {}})
};
fetch('https://api.flexxible.net/v2/organizations/{organization_id}/operations', 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.flexxible.net/v2/organizations/{organization_id}/operations",
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([
'target' => [
'ids' => [
'<string>'
]
],
'expiration_in_seconds' => 42600,
'payload' => [
]
]),
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.flexxible.net/v2/organizations/{organization_id}/operations"
payload := strings.NewReader("{\n \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\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.flexxible.net/v2/organizations/{organization_id}/operations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flexxible.net/v2/organizations/{organization_id}/operations")
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 \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"organization_id": "<string>",
"description": "<string>",
"status": "finished",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"microservice_id": "<string>",
"flow_id": "<string>",
"remote_support": {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"type": "<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>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}Autorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parámetros de ruta
24^[0-9a-f]{24}$Cuerpo
Respuesta
Operaciones creadas correctamente.
1Show child attributes
Show child attributes
curl --request POST \
--url https://api.flexxible.net/v2/organizations/{organization_id}/operations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": {
"ids": [
"<string>"
]
},
"expiration_in_seconds": 42600,
"payload": {}
}
'import requests
url = "https://api.flexxible.net/v2/organizations/{organization_id}/operations"
payload = {
"target": { "ids": ["<string>"] },
"expiration_in_seconds": 42600,
"payload": {}
}
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({target: {ids: ['<string>']}, expiration_in_seconds: 42600, payload: {}})
};
fetch('https://api.flexxible.net/v2/organizations/{organization_id}/operations', 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.flexxible.net/v2/organizations/{organization_id}/operations",
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([
'target' => [
'ids' => [
'<string>'
]
],
'expiration_in_seconds' => 42600,
'payload' => [
]
]),
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.flexxible.net/v2/organizations/{organization_id}/operations"
payload := strings.NewReader("{\n \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\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.flexxible.net/v2/organizations/{organization_id}/operations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flexxible.net/v2/organizations/{organization_id}/operations")
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 \"target\": {\n \"ids\": [\n \"<string>\"\n ]\n },\n \"expiration_in_seconds\": 42600,\n \"payload\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"organization_id": "<string>",
"description": "<string>",
"status": "finished",
"created_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"microservice_id": "<string>",
"flow_id": "<string>",
"remote_support": {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"type": "<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>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": "<string>"
}
}