Do not determine last input as final destination

Hi Team,
I am using where i provide say 5 locations. I only want the API to take the first input as start location , but do not want to take the last input as final destination. Rather let the API decide the shortest path for all 5 locations. Is it possible

The last location of your input will be the final destination by default. If you wish to arrive at your departure location you’ll need to add it twice, at the beginning and at the end of your input.

Thanks for reply. But then it considers arrival location also doing optimization.
Input : 1,4,2,3(index based in distance)
Optimized output or expected: 1,2,3,4
Output: 1,2,4,3

When input is : 1,4,2,3,1
Output is : 1,2,4,3,1(since 3 is near 1)

Really value your time . But just checking if there is any flag which will not consider destination and just give me a one way path 1,2,3,4

One way path is not supported, there is no flag you can use.

The (suboptimal) workaround is indeed to determine the farthest location and make it the last item in your input.