Update routing schedule by ID
curl --request PUT \
--url https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": true,
"periode": "daily",
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [
{
"time": [
"08:00"
]
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}"
payload = {
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": True,
"periode": "daily",
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [{ "time": ["08:00"] }]
}
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({
configurationId: '65c3a1b2c3d4e5f600000009',
name: 'Morning Routing Jakarta',
autoDispatch: true,
periode: 'daily',
startTime: '2026-09-10 00:00',
endTime: '2026-12-31 23:59',
schedules: [{time: ['08:00']}]
})
};
fetch('https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}', 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/routing/schedule/{scheduleId}",
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([
'configurationId' => '65c3a1b2c3d4e5f600000009',
'name' => 'Morning Routing Jakarta',
'autoDispatch' => true,
'periode' => 'daily',
'startTime' => '2026-09-10 00:00',
'endTime' => '2026-12-31 23:59',
'schedules' => [
[
'time' => [
'08:00'
]
]
]
]),
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/routing/schedule/{scheduleId}"
payload := strings.NewReader("{\n \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\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/routing/schedule/{scheduleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}")
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 \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Update success.",
"data": {
"_id": "66f0a1b2c3d4e5f600000001",
"organizationId": "65a1b2c3d4e5f60000000001",
"hubId": "65b2c3d4e5f6000000000002",
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": true,
"periode": "daily",
"frequency": null,
"interval": null,
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [
{
"time": [
"08:00"
]
}
],
"timeSchedules": [
"08:00"
],
"isDeleted": false,
"createdBy": "[email protected]",
"createdTime": "2026-09-09T10:00:00+00:00",
"updatedTime": "2026-09-09T10:00:00+00:00"
}
}{
"status": false,
"message": "Configuration not found",
"failedCode": "sched-033"
}{
"status": false,
"message": "Access denied. You do not have permission for edit routing schedule. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"message": "The configuration id field is required.",
"errors": {
"configurationId": [
"The configuration id field is required."
],
"name": [
"The name field is required."
],
"periode": [
"The periode field is required."
]
},
"failedCode": "sched-001"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Routing Schedule
Update routing schedule by ID
Replaces a routing schedule. Send the whole schedule, exactly as you would to create it; every required field is required again here. To change one field only, use PATCH /routing/schedule/ instead.
Requires the edit/routing-schedule permission.
PUT
/
routing
/
schedule
/
{scheduleId}
Update routing schedule by ID
curl --request PUT \
--url https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": true,
"periode": "daily",
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [
{
"time": [
"08:00"
]
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}"
payload = {
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": True,
"periode": "daily",
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [{ "time": ["08:00"] }]
}
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({
configurationId: '65c3a1b2c3d4e5f600000009',
name: 'Morning Routing Jakarta',
autoDispatch: true,
periode: 'daily',
startTime: '2026-09-10 00:00',
endTime: '2026-12-31 23:59',
schedules: [{time: ['08:00']}]
})
};
fetch('https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}', 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/routing/schedule/{scheduleId}",
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([
'configurationId' => '65c3a1b2c3d4e5f600000009',
'name' => 'Morning Routing Jakarta',
'autoDispatch' => true,
'periode' => 'daily',
'startTime' => '2026-09-10 00:00',
'endTime' => '2026-12-31 23:59',
'schedules' => [
[
'time' => [
'08:00'
]
]
]
]),
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/routing/schedule/{scheduleId}"
payload := strings.NewReader("{\n \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\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/routing/schedule/{scheduleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/routing/schedule/{scheduleId}")
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 \"configurationId\": \"65c3a1b2c3d4e5f600000009\",\n \"name\": \"Morning Routing Jakarta\",\n \"autoDispatch\": true,\n \"periode\": \"daily\",\n \"startTime\": \"2026-09-10 00:00\",\n \"endTime\": \"2026-12-31 23:59\",\n \"schedules\": [\n {\n \"time\": [\n \"08:00\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Update success.",
"data": {
"_id": "66f0a1b2c3d4e5f600000001",
"organizationId": "65a1b2c3d4e5f60000000001",
"hubId": "65b2c3d4e5f6000000000002",
"configurationId": "65c3a1b2c3d4e5f600000009",
"name": "Morning Routing Jakarta",
"autoDispatch": true,
"periode": "daily",
"frequency": null,
"interval": null,
"startTime": "2026-09-10 00:00",
"endTime": "2026-12-31 23:59",
"schedules": [
{
"time": [
"08:00"
]
}
],
"timeSchedules": [
"08:00"
],
"isDeleted": false,
"createdBy": "[email protected]",
"createdTime": "2026-09-09T10:00:00+00:00",
"updatedTime": "2026-09-09T10:00:00+00:00"
}
}{
"status": false,
"message": "Configuration not found",
"failedCode": "sched-033"
}{
"status": false,
"message": "Access denied. You do not have permission for edit routing schedule. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"message": "The configuration id field is required.",
"errors": {
"configurationId": [
"The configuration id field is required."
],
"name": [
"The name field is required."
],
"periode": [
"The periode field is required."
]
},
"failedCode": "sched-001"
}{
"status": false,
"message": "Internal server error, please contact [email protected]."
}Path Parameters
Body
application/json
startTime and endTime are required for every periode except byDate. frequency and interval are required when periode is custom.