Skip to main content
POST
/
v1
/
flows
cURL
curl --request POST \
  --url https://cloud.nrai.io/api/v1/flows \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "displayName": "<string>",
  "projectId": "<string>",
  "folderId": "<string>",
  "folderName": "<string>",
  "metadata": {}
}
'
import requests

url = "https://cloud.nrai.io/api/v1/flows"

payload = {
"displayName": "<string>",
"projectId": "<string>",
"folderId": "<string>",
"folderName": "<string>",
"metadata": {}
}
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({
displayName: '<string>',
projectId: '<string>',
folderId: '<string>',
folderName: '<string>',
metadata: {}
})
};

fetch('https://cloud.nrai.io/api/v1/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://cloud.nrai.io/api/v1/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([
'displayName' => '<string>',
'projectId' => '<string>',
'folderId' => '<string>',
'folderName' => '<string>',
'metadata' => [

]
]),
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://cloud.nrai.io/api/v1/flows"

payload := strings.NewReader("{\n \"displayName\": \"<string>\",\n \"projectId\": \"<string>\",\n \"folderId\": \"<string>\",\n \"folderName\": \"<string>\",\n \"metadata\": {}\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://cloud.nrai.io/api/v1/flows")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"displayName\": \"<string>\",\n \"projectId\": \"<string>\",\n \"folderId\": \"<string>\",\n \"folderName\": \"<string>\",\n \"metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://cloud.nrai.io/api/v1/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 \"displayName\": \"<string>\",\n \"projectId\": \"<string>\",\n \"folderId\": \"<string>\",\n \"folderName\": \"<string>\",\n \"metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "created": "<string>",
  "updated": "<string>",
  "projectId": "<string>",
  "externalId": "<string>",
  "status": "ENABLED",
  "version": {
    "id": "<string>",
    "created": "<string>",
    "updated": "<string>",
    "flowId": "<string>",
    "displayName": "<string>",
    "trigger": {
      "name": "<string>",
      "valid": true,
      "displayName": "<string>",
      "type": "PIECE_TRIGGER",
      "settings": {
        "propertySettings": {},
        "pieceName": "<string>",
        "pieceVersion": "<string>",
        "input": {},
        "sampleData": {
          "sampleDataFileId": "<string>",
          "sampleDataInputFileId": "<string>",
          "lastTestDate": "<string>"
        },
        "customLogoUrl": "<string>",
        "triggerName": "<string>"
      },
      "nextAction": "<unknown>"
    },
    "valid": true,
    "agentIds": [
      "<string>"
    ],
    "state": "LOCKED",
    "connectionIds": [
      "<string>"
    ],
    "updatedBy": "<string>",
    "schemaVersion": "<string>",
    "backupFiles": {}
  },
  "folderId": "<string>",
  "publishedVersionId": "<string>",
  "metadata": {},
  "triggerSource": {
    "schedule": {
      "type": "CRON_EXPRESSION",
      "cronExpression": "<string>",
      "timezone": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Use your api key generated from the admin console

Body

application/json
displayName
string
required
projectId
string
required
folderId
string
folderName
string
metadata
object

Response

201 - application/json

Default Response

id
string
required
created
string
required
updated
string
required
projectId
string
required
externalId
string
required
status
required
Available options:
ENABLED
version
object
required
folderId
string | null
publishedVersionId
string | null
metadata
object | null
triggerSource
object