Resequence Trip
| Request |
|
| Description |
Changes the visit sequence within a trip. Tasks can be resequenced in-place and, if needed, moved from other trips to the target trip before resequencing. |
| Context |
https://<instance>.optimizemyday.com/omdservices/rs/v1 |
| URL |
/trips/resequence |
| Method |
POST |
| Request Type |
JSON |
| Response Code |
200 when successful, another HTTP status code otherwise |
| Success Response |
A JSON document containing one or more updated trips (target trip and optionally source trips from which tasks were moved), including recalculated cost information. |
| Response Type |
JSON |
| Query Parameter |
Datatype |
Description |
| configId |
String |
The external identifier of the configuration. |
| persist |
Boolean |
Indicates if the changes must be persisted to the database. If omitted, defaults to false. |
| Request Body Field |
Datatype |
Description |
| resourceExternalId |
String |
The external identifier of the resource for the target trip. |
| date |
Date |
The day of the target trip in internal date format (for example yyyy-MM-dd). |
| sequence |
Array |
Ordered list of tasks to place in the trip. |
| sequence[].position |
Integer |
Position in the resulting trip sequence (ascending order). |
| sequence[].taskExternalId |
String |
The external identifier of the task to resequence. |
| sequence[].version |
Integer |
Version value passed by the client. It is accepted by the endpoint and can be used for client-side consistency checks. |
Sample Call
https://sandbox.optimizemyday.com/omdservices/rs/v1/trips/resequence?configId=16167225&persist=true
Sample Request
[
{
"resourceExternalId": "10000024",
"date": "2026-05-19",
"sequence": [
{
"position": 1,
"taskExternalId": "0000108150-1-1-2017-05-11",
"version": 1
},
{
"position": 2,
"taskExternalId": "0000105979-1-1-2017-05-11",
"version": 1
}
]
}
]
Sample Success Response
{
"Result": {
"success": true,
"Trip": [
{
"resource": "10000024",
"day": "2026-05-19",
"Stop": [
{
"task": "0000108150-1-1-2017-05-11",
"positionInTrip": "1"
},
{
"task": "0000105979-1-1-2017-05-11",
"positionInTrip": "2"
}
],
"Cost": {
"costValue": 511312
}
}
]
}
}
Sample Error Response
{
"Result": {
"success": false,
"errorMessage": "Task not found: UNKNOWN-TASK"
}
}