> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pathstack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch Milestone

> Modifies an existing milestone.



## OpenAPI

````yaml openapi_2024-03-27 patch /milestone/{milestone_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: '2024-03-27'
servers:
  - url: https://api.pathstack.io
    description: PathStack production environment
security: []
paths:
  /milestone/{milestone_id}:
    patch:
      tags:
        - Milestones
      summary: Patch Milestone
      description: Modifies an existing milestone.
      operationId: patch_milestone_milestone__milestone_id__patch
      parameters:
        - name: milestone_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Milestone id
            description: ID of the Milestone to be updated
          description: ID of the Milestone to be updated
        - name: x-api-version
          in: header
          required: false
          schema:
            type: string
            format: date
            default: '2024-03-27'
            title: X-Api-Version
          examples:
            default:
              value: '2024-03-27'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MilestoneUpdate'
              title: Milestone
              description: Details for Milestone Update
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Success_Milestone_'
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                        title: Error code
                      message:
                        type: string
                        example: Invalid JWT format
                        title: Error message
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 401
                        title: Error code
                      message:
                        type: string
                        example: >-
                          Authentication header is missing, or token is
                          invalid/expired.
                        title: Error message
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 403
                        title: Error code
                      message:
                        type: string
                        example: You do not have access to this resource
                        title: Error message
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 404
                        title: Error code
                      message:
                        type: string
                        example: Unknown milestone id <uuid>
                        title: Error message
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 422
                        title: Error code
                      message:
                        type: string
                        example: Field required
                        title: Error message
                      loc:
                        items:
                          anyOf:
                            - type: string
                            - type: integer
                        type: array
                        title: Location
                      msg:
                        type: string
                        title: Message
                      type:
                        type: string
                        title: Error Type
          description: Unprocessable Entity
      security:
        - JWTBearer: []
components:
  schemas:
    MilestoneUpdate:
      properties:
        device_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Device Id
        status:
          anyOf:
            - $ref: '#/components/schemas/MilestoneStatusEnum'
            - type: 'null'
        start_point:
          anyOf:
            - $ref: '#/components/schemas/Coordinate'
            - prefixItems:
                - anyOf:
                    - type: number
                    - type: string
                      pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
                - anyOf:
                    - type: number
                    - type: string
                      pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
              type: array
              maxItems: 2
              minItems: 2
            - type: string
            - type: 'null'
          title: Start Point
        end_point:
          anyOf:
            - $ref: '#/components/schemas/Coordinate'
            - type: 'null'
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Time
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Time
        webhook_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Webhook Url
        webhook_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Webhook Enabled
      type: object
      title: MilestoneUpdate
    Success_Milestone_:
      properties:
        data:
          $ref: '#/components/schemas/Milestone'
          description: Successful response payload
      type: object
      required:
        - data
      title: Success[Milestone]
    MilestoneStatusEnum:
      type: string
      enum:
        - trip_not_started
        - trip_in_progress
        - trip_ended
      title: MilestoneStatusEnum
    Coordinate:
      properties:
        latitude:
          anyOf:
            - type: number
              maximum: 90
              minimum: -90
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Latitude
        longitude:
          anyOf:
            - type: number
              maximum: 180
              minimum: -180
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Longitude
      type: object
      required:
        - latitude
        - longitude
      title: Coordinate
      description: >-
        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)`.


        ```py

        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)

        ```
    Milestone:
      properties:
        device_id:
          type: string
          format: uuid4
          title: Device Id
        status:
          $ref: '#/components/schemas/MilestoneStatusEnum'
          default: trip_not_started
        start_point:
          $ref: '#/components/schemas/Coordinate'
          title: Start Point
        end_point:
          $ref: '#/components/schemas/Coordinate'
        start_time:
          type: string
          title: Start Time
        end_time:
          type: string
          title: End Time
        webhook_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Webhook Url
        id:
          type: string
          format: uuid4
          title: Id
        tenant_id:
          type: string
          format: uuid4
          title: Tenant Id
        webhook_error_count:
          type: integer
          title: Webhook Error Count
          default: 0
        last_webhook_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Webhook Error
        last_webhook_error_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Webhook Error At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        webhook_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Webhook Enabled
      type: object
      required:
        - device_id
        - start_point
        - end_point
        - start_time
        - end_time
        - id
        - tenant_id
        - created_at
        - updated_at
      title: Milestone
  securitySchemes:
    JWTBearer:
      type: http
      scheme: bearer

````