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

trailerstring

min length: 1; max length: 100

sizestring

min length: 1; max length: 50

hazmatboolean

Example 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

objectstringrequired
okbooleanrequired
api_versionstringrequired
request_idstringrequired
dataobjectrequired
data.loadIdstring

format: uuid

data.spotQuoteIdstring

format: uuid

data.totalMilesnumberrequired
data.perStopMilesarray<number>required
data.durationSecondsintegerrequired
data.typicalDurationSecondsinteger | nullrequired
data.routeParamsHashstringrequired
data.segmentCountintegerrequired

min: 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