API documentation | API docs for agents | OpenAPI 3.1
POST /api/v1/spot-quotes/{spotQuoteId}/miles/calculate
ark.calculate_spot_quote_miles
Calculates truck route miles for a visible spot quote using stop coordinates and stores total/per-stop mileage.
- Availability
- Expanded preview
- Scopes
loads:write- ARK permissions
canEditLoad- Team visibility
- Required and enforced
- Idempotency-Key
- Required for this write
- Approval
- No MCP approval on REST API-token calls
- Rate limit
- API credential and organization budgets
Parameters
spotQuoteIdpathstringrequired- format: uuid
Idempotency-Keyheaderstringrequired- Required for external write operations.
- min length: 1; max length: 255
Request body
stopsarray<object>requiredStop coordinates ordered by stopIndex. Count must match the persisted stops.
min items: 2; max items: 25
trailerstringmin length: 1; max length: 100
sizestringmin length: 1; max length: 50
dimensionsobjecthazmatbooleanExample request
Shell
curl -X POST 'https://arktms.com/api/v1/spot-quotes/<spotQuoteId>/miles/calculate' \
-H "Authorization: Bearer $ARK_API_TOKEN" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{
"stops": [
{
"lat": -90,
"lng": -180,
"stopIndex": 0
},
{
"lat": -90,
"lng": -180,
"stopIndex": 0
}
]
}'Success response
Calculated spot quote miles
objectstringrequiredokbooleanrequiredapi_versionstringrequiredrequest_idstringrequireddataobjectrequireddata.loadIdstringformat: uuid
data.spotQuoteIdstringformat: uuid
data.totalMilesnumberrequireddata.perStopMilesarray<number>requireddata.durationSecondsintegerrequireddata.typicalDurationSecondsinteger | nullrequireddata.routeParamsHashstringrequireddata.segmentCountintegerrequiredmin: 0
Errors
HTTP 400- Invalid request
HTTP 401- Authentication required
HTTP 403- Permission, scope, team, or entitlement denied
HTTP 404- Resource not found
HTTP 409- Idempotency conflict or in-progress retry