Skip to main content
PATCH
/
milestone
/
{milestone_id}
Patch Milestone
curl --request PATCH \
  --url https://api.pathstack.io/milestone/{milestone_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "device_id": "<string>",
  "start_point": {
    "latitude": 0,
    "longitude": 0
  },
  "end_point": {
    "latitude": 0,
    "longitude": 0
  },
  "start_time": "2023-11-07T05:31:56Z",
  "end_time": "2023-11-07T05:31:56Z",
  "webhook_url": "<string>",
  "webhook_enabled": true
}
'
{
  "data": {
    "device_id": "<string>",
    "start_point": {
      "latitude": 0,
      "longitude": 0
    },
    "end_point": {
      "latitude": 0,
      "longitude": 0
    },
    "start_time": "<string>",
    "end_time": "<string>",
    "id": "<string>",
    "tenant_id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "status": "trip_not_started",
    "webhook_url": "<string>",
    "webhook_error_count": 0,
    "last_webhook_error": "<string>",
    "last_webhook_error_at": "<string>",
    "webhook_enabled": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string<date>
default:2024-03-27

Path Parameters

milestone_id
string<uuid>
required

ID of the Milestone to be updated

Body

application/json

Details for Milestone Update

device_id
string<uuid4> | null
status
enum<string> | null
Available options:
trip_not_started,
trip_in_progress,
trip_ended
start_point

Coordinate parses Latitude and Longitude.

You can use the Coordinate data type for storing coordinates. Coordinates can be defined using one of the following formats:

  1. Tuple: (Latitude, Longitude). For example: (41.40338, 2.17403) or (Decimal('41.40338'), Decimal('2.17403')).
  2. Coordinate instance: Coordinate(latitude=Latitude, longitude=Longitude).
from decimal import Decimal
from pydantic import BaseModel

from pydantic_extra_types.coordinate import Coordinate


class Location(BaseModel):
coordinate: Coordinate


# Using float values
location1 = Location(coordinate=(41.40338, 2.17403))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)

# Using Decimal values
location2 = Location(coordinate=(Decimal('41.40338'), Decimal('2.17403')))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
end_point
Coordinate · object

Coordinate parses Latitude and Longitude.

You can use the Coordinate data type for storing coordinates. Coordinates can be defined using one of the following formats:

  1. Tuple: (Latitude, Longitude). For example: (41.40338, 2.17403) or (Decimal('41.40338'), Decimal('2.17403')).
  2. Coordinate instance: Coordinate(latitude=Latitude, longitude=Longitude).
from decimal import Decimal
from pydantic import BaseModel

from pydantic_extra_types.coordinate import Coordinate


class Location(BaseModel):
coordinate: Coordinate


# Using float values
location1 = Location(coordinate=(41.40338, 2.17403))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)

# Using Decimal values
location2 = Location(coordinate=(Decimal('41.40338'), Decimal('2.17403')))
# > coordinate=Coordinate(latitude=41.40338, longitude=2.17403)
start_time
string<date-time> | null
end_time
string<date-time> | null
webhook_url
string<uri> | null
Required string length: 1 - 2083
webhook_enabled
boolean | null

Response

Successful Response

data
Milestone · object
required

Successful response payload