Skip to main content
PUT
/
flow-reorder
Re-order flow
curl --request PUT \
  --url https://apiweb.mile.app/api/v3/flow-reorder \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "data": [
    {
      "flowId": "64118c2a2785f33e53375225"
    },
    {
      "doDuplicate": true,
      "flowId": "64118c2a2785f33e53375225",
      "flowName": "Flow Copy"
    },
    {
      "flowId": "6352736c628401059b37a1d1"
    },
    {
      "flowId": "63fd8e69d5d8b97133216e1b"
    },
    {
      "doDelete": true,
      "flowId": "63fd8e69d5d8b97133216e1a"
    }
  ]
}
'
import requests

url = "https://apiweb.mile.app/api/v3/flow-reorder"

payload = { "data": [
{ "flowId": "64118c2a2785f33e53375225" },
{
"doDuplicate": True,
"flowId": "64118c2a2785f33e53375225",
"flowName": "Flow Copy"
},
{ "flowId": "6352736c628401059b37a1d1" },
{ "flowId": "63fd8e69d5d8b97133216e1b" },
{
"doDelete": True,
"flowId": "63fd8e69d5d8b97133216e1a"
}
] }
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({
data: [
{flowId: '64118c2a2785f33e53375225'},
{doDuplicate: true, flowId: '64118c2a2785f33e53375225', flowName: 'Flow Copy'},
{flowId: '6352736c628401059b37a1d1'},
{flowId: '63fd8e69d5d8b97133216e1b'},
{doDelete: true, flowId: '63fd8e69d5d8b97133216e1a'}
]
})
};

fetch('https://apiweb.mile.app/api/v3/flow-reorder', 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://apiweb.mile.app/api/v3/flow-reorder",
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([
'data' => [
[
'flowId' => '64118c2a2785f33e53375225'
],
[
'doDuplicate' => true,
'flowId' => '64118c2a2785f33e53375225',
'flowName' => 'Flow Copy'
],
[
'flowId' => '6352736c628401059b37a1d1'
],
[
'flowId' => '63fd8e69d5d8b97133216e1b'
],
[
'doDelete' => true,
'flowId' => '63fd8e69d5d8b97133216e1a'
]
]
]),
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://apiweb.mile.app/api/v3/flow-reorder"

payload := strings.NewReader("{\n \"data\": [\n {\n \"flowId\": \"64118c2a2785f33e53375225\"\n },\n {\n \"doDuplicate\": true,\n \"flowId\": \"64118c2a2785f33e53375225\",\n \"flowName\": \"Flow Copy\"\n },\n {\n \"flowId\": \"6352736c628401059b37a1d1\"\n },\n {\n \"flowId\": \"63fd8e69d5d8b97133216e1b\"\n },\n {\n \"doDelete\": true,\n \"flowId\": \"63fd8e69d5d8b97133216e1a\"\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://apiweb.mile.app/api/v3/flow-reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": [\n {\n \"flowId\": \"64118c2a2785f33e53375225\"\n },\n {\n \"doDuplicate\": true,\n \"flowId\": \"64118c2a2785f33e53375225\",\n \"flowName\": \"Flow Copy\"\n },\n {\n \"flowId\": \"6352736c628401059b37a1d1\"\n },\n {\n \"flowId\": \"63fd8e69d5d8b97133216e1b\"\n },\n {\n \"doDelete\": true,\n \"flowId\": \"63fd8e69d5d8b97133216e1a\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://apiweb.mile.app/api/v3/flow-reorder")

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 \"data\": [\n {\n \"flowId\": \"64118c2a2785f33e53375225\"\n },\n {\n \"doDuplicate\": true,\n \"flowId\": \"64118c2a2785f33e53375225\",\n \"flowName\": \"Flow Copy\"\n },\n {\n \"flowId\": \"6352736c628401059b37a1d1\"\n },\n {\n \"flowId\": \"63fd8e69d5d8b97133216e1b\"\n },\n {\n \"doDelete\": true,\n \"flowId\": \"63fd8e69d5d8b97133216e1a\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "status": true,
  "code": 200,
  "message": "success re-order index",
  "data": [
    {
      "status": true,
      "code": 200,
      "message": "Success",
      "flow": {
        "orderIndex": 1,
        "version": 32
      }
    },
    {
      "status": true,
      "code": 200,
      "message": "Flow has been created successfully.",
      "flow": {
        "name": "Flow Copy",
        "orderIndex": 2,
        "createdBy": "user@mile.app",
        "updatedBy": "user@mile.app",
        "pages": [
          {
            "id": "page0",
            "enabled": true,
            "components": [
              {
                "component": "input",
                "id": "order",
                "title": "Order",
                "inputType": "string",
                "default": null,
                "routeAs": null,
                "showAs": "title",
                "isRequired": false,
                "visible": true,
                "preValue": null
              }
            ]
          }
        ],
        "configurations": [
          {
            "id": "startTime",
            "adjustment": 0
          },
          {
            "id": "endTime",
            "adjustment": 24
          }
        ],
        "organizationId": "66791b2bf001a712b77b3622",
        "version": 1,
        "updatedTime": "2025-06-19T10:49:31.289000Z",
        "createdTime": "2025-06-19T10:49:31.289000Z",
        "_id": "6853eb3bc3a6b9a8b10567f2"
      }
    },
    {
      "status": true,
      "code": 200,
      "message": "Success",
      "flow": {
        "orderIndex": 3,
        "version": 21
      }
    },
    {
      "status": true,
      "code": 200,
      "message": "Success",
      "flow": {
        "orderIndex": 3,
        "version": 59
      }
    },
    {
      "status": true,
      "code": 200,
      "data": {
        "_id": "63fd8e69d5d8b97133216e1a",
        "name": "Unloading",
        "orderIndex": 4,
        "createdBy": "user@mile.app",
        "updatedBy": "user@mile.app",
        "pages": [
          {
            "id": "page0",
            "enabled": true,
            "components": []
          }
        ],
        "configurations": [
          {
            "id": "startTime",
            "adjustment": 0
          },
          {
            "id": "endTime",
            "adjustment": 24
          }
        ],
        "organizationId": "66791b2bf001a712b77b3622",
        "version": 1,
        "updatedTime": "2025-06-19T10:49:31.289000Z",
        "createdTime": "2025-06-19T10:49:31.289000Z"
      }
    }
  ]
}
{
"status": false,
"message": "Bad request - invalid parameters provided."
}
{
"status": false,
"message": "Internal server error, please contact support@mile.app."
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json
data
object[]
required

List of data flowId. Example: { 'flowId': '64118c2a2785f33e53375225' }

Response

Success

status
boolean

Status of response.

code
integer

Code of API response.

message
string

Message of API response.

data
object

Detail of object flows.