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

# Add a site to default site list on order

> Add a `Site` to the default_site list for an `Order`, given a particular 'WaypointType'.

Note: The underlying site grouping will be created automatically when the first 
site is added for a given order. 



## OpenAPI

````yaml /api-reference/openapi.json put /v1/orders/{order-id}/default_sites/{waypoint-type}/{site-id}
openapi: 3.0.3
info:
  title: Horizon API V1
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: >-
    This is the Version 1 implementation.


    When in doubt we default to the practices outlined
    [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)
  license:
    name: Private
    url: https://tread.io
servers:
  - description: production
    url: https://api.tread-horizon.com
security:
  - bearerAuth: []
tags:
  - name: Projects
  - name: Orders
  - name: Loads
  - name: Jobs
  - name: JobAssignments
  - name: ApprovalAssignments
  - name: Equipment
  - name: FuelSurcharges
  - name: Materials
  - name: Accounts
  - name: Tickets
  - name: Users
  - name: Sites
  - name: Companies
  - name: Departments
  - name: Rates
  - name: Services
  - name: EquipmentType
  - name: FileAttachments
  - name: MaterialType
  - name: LineItemType
  - name: DriverStateEvent
  - name: Authentication
  - name: IamRoles
  - name: Typeaheads
  - name: Integrations
  - name: Reflection
  - name: LoadCycles
  - name: AddOns
  - name: ServiceClass
  - name: Invoices
  - name: JobSummaries
  - name: LoadSummaries
  - name: CompanyShares
  - name: UserDevicePermission
  - name: Drivers
  - name: Settlements
  - name: LocationHistories
  - name: Telematics
  - name: OmniReports
  - name: DriverDays
  - name: Agave
  - name: AddOnCharges
  - name: ResourceUsageLogs
  - name: ResourceScopes
  - name: TravelledDistances
  - name: MaterialRates
  - name: CompanyDayJobStats
  - name: KMLFiles
  - name: AutoAddOnAssignments
  - name: SiteRateSchedules
  - name: TwilioIntegrations
  - name: Foremen
  - name: AccountExternalTruckIdentifier
  - name: GeofenceTriggers
  - name: Labels
  - name: Compliance
  - name: ComplianceDocuments
paths:
  /v1/orders/{order-id}/default_sites/{waypoint-type}/{site-id}:
    parameters:
      - schema:
          type: string
        name: order-id
        in: path
        required: true
        description: Order id
      - schema:
          type: string
          enum:
            - pickup
            - drop_off
        name: waypoint-type
        in: path
        required: true
        description: Waypoint type
      - schema:
          type: string
        name: site-id
        in: path
        required: true
        description: Site id
      - $ref: '#/components/parameters/Accept-Language'
    put:
      tags:
        - Sites
        - Orders
      summary: Add a site to default site list on order
      description: >-
        Add a `Site` to the default_site list for an `Order`, given a particular
        'WaypointType'.


        Note: The underlying site grouping will be created automatically when
        the first 

        site is added for a given order. 
      operationId: put-v1-orders-order-id-default_sites-waypoint-type-site-id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/Site-Read-Nested'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      deprecated: true
components:
  parameters:
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: >-
        The Accept-Language request HTTP header indicates the natural language
        and locale that the client prefers. 
  schemas:
    Site-Read-Nested:
      title: Site-Read-Nested
      x-stoplight:
        id: rt6xqxsfzf4iv
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - type: object
          required:
            - name
            - lat
            - lon
            - full_address
            - routable
          properties:
            name:
              type: string
              x-stoplight:
                id: 7r0x7wicrvwyy
            lat:
              type: string
              x-stoplight:
                id: cr6y5v0hdl5oo
              nullable: true
            lon:
              type: string
              x-stoplight:
                id: f23mkvamncbuw
              nullable: true
            address:
              $ref: '#/components/schemas/Address-Read-Nested'
            full_address:
              type: string
              x-stoplight:
                id: uxixxnmgfi47i
              nullable: true
            routable:
              type: boolean
              x-stoplight:
                id: uobfxkm0hujhv
            next_billion_geofence:
              $ref: '#/components/schemas/NextBillionGeofence-Read'
        - $ref: '#/components/schemas/Discardable'
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
        - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    Address-Read-Nested:
      title: Address-Read-Nested
      x-stoplight:
        id: cvym2dzuo375q
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Address-Read'
    NextBillionGeofence-Read:
      title: NextBillionGeofence-Read
      x-stoplight:
        id: 60y0z4bb3pu6m
      allOf:
        - $ref: '#/components/schemas/Identifier'
        - $ref: '#/components/schemas/Geofence-Data'
    Discardable:
      title: Discardable
      x-stoplight:
        id: 46axlb8u5wjay
      type: object
      required:
        - discarded_at
      properties:
        discarded_at:
          type: string
          x-stoplight:
            id: cy8t6fecoyxbo
          format: date-time
          nullable: true
      additionalProperties: false
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
    Address-Read:
      title: Address-Read
      x-stoplight:
        id: v1mcd2qgns2tf
      type: object
      required:
        - thoroughfare
        - premise
        - locality
        - administrative_area
        - postal_code
        - country
        - lat
        - lon
        - place_id
      properties:
        thoroughfare:
          type: string
          x-stoplight:
            id: 8wrr7qkc9ilqn
        premise:
          type: string
          x-stoplight:
            id: z4jth408out1q
          nullable: true
        locality:
          type: string
          x-stoplight:
            id: kfby6wqpgvxbz
        administrative_area:
          type: string
          x-stoplight:
            id: c9bkrloxf4t8d
        postal_code:
          type: string
          x-stoplight:
            id: 7zq51k1mof3o3
        country:
          type: string
          x-stoplight:
            id: iydw9q619ya01
          pattern: ^[A-Z]{2}
          example: US
          minLength: 2
          maxLength: 2
        lat:
          type: string
          x-stoplight:
            id: kqu1qtf9rivh1
          description: |-
            latitude of the `Address`. 

            Must be a stringified number between -90 and 90 inclusive.

            Required if `lon` is present.
          nullable: true
        lon:
          type: string
          x-stoplight:
            id: oly2yabkzpk9g
          description: |-
            longitude of the `Address`. 

            Must be a stringified number between -180 and 180 inclusive.

            Required if `lat` is present.
          nullable: true
        place_id:
          type: string
          x-stoplight:
            id: im1fdq7qqxdij
          description: NextBillion placeID
          nullable: true
      additionalProperties: false
    Geofence-Data:
      title: Geofence-Data
      x-stoplight:
        id: ay73k76oae8gm
      type: object
      properties:
        id:
          type: string
          format: uuid
          x-stoplight:
            id: m9n8p7q6r5s4t
          description: NextBillionGeofence ID
        geofence:
          type: object
          x-stoplight:
            id: bo67u046r1ibk
          required:
            - name
            - type
          properties:
            id:
              type: string
              x-stoplight:
                id: nm2o97jli2zqm
              format: uuid
              description: NextBillion Geofence ID
            name:
              type: string
              x-stoplight:
                id: x5sp8wq8d2ack
            type:
              type: string
              x-stoplight:
                id: d91rv1gbtfkm0
              description: '`circle` or `polygon`'
            geojson:
              type: object
              x-stoplight:
                id: vk7dx7ipdbuxa
              required:
                - type
                - coordinates
              properties:
                type:
                  type: string
                  x-stoplight:
                    id: 65qatpxdox3e9
                  description: type should be `Polygon`
                coordinates:
                  type: array
                  x-stoplight:
                    id: 3an8g587wblcs
                  description: >-
                    This should be an enclosed polygon.


                    Example format:

                    [[[-118.226140484,34.048200454],[-118.22616052,34.046872766],[-118.226198738,34.04952736],[-118.226140484,34.048200454]]]
                  items:
                    x-stoplight:
                      id: 2kltvjxl5xks6
                    type: array
                    items:
                      x-stoplight:
                        id: k93dt39dghru4
                      type: array
                      items: {}
            circle_center:
              type: object
              x-stoplight:
                id: 6xr3h683f7cl9
              required:
                - lat
                - lon
              properties:
                lat:
                  type: number
                  x-stoplight:
                    id: y70xc1ptapv1g
                lon:
                  type: number
                  x-stoplight:
                    id: uy3twrpcueq9m
            circle_radius:
              type: number
              x-stoplight:
                id: qrnq301sqfl3d
            tag:
              x-stoplight:
                id: debfy3x1l48zc
              enum:
                - pickup
                - loading
                - drop_off
                - unloading
                - check_in
                - scaling
                - ticketing
              deprecated: true
        moving_geofence:
          type: boolean
          x-stoplight:
            id: y15533dbr62js
          default: false
        tag:
          $ref: '#/components/schemas/GeofenceTag'
        geofence_type:
          $ref: '#/components/schemas/NullableGeofenceType'
      additionalProperties: false
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
        - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          x-stoplight:
            id: tg10dt7s0l6bw
          properties:
            error_type:
              type: string
              x-stoplight:
                id: wvq8c0qsym4hz
          required:
            - error_type
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - errors
          properties:
            errors:
              type: array
              x-stoplight:
                id: m4ul9vcq2deh6
              items:
                $ref: '#/components/schemas/ModelError-Item'
    GeofenceTag:
      title: GeofenceTag
      x-stoplight:
        id: anytkmb3ydi6c
      enum:
        - scaling
        - site
        - loading
        - unloading
        - check_in
        - ticketing
    NullableGeofenceType:
      title: NullableGeofenceType
      x-stoplight:
        id: ii94t82oqh5xo
      allOf:
        - $ref: '#/components/schemas/GeofenceType'
      nullable: true
      type: string
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
        - model
        - field
        - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
    GeofenceType:
      title: GeofenceType
      x-stoplight:
        id: geahowr9r8ly1
      nullable: true
      enum:
        - moving
        - circle
        - polygon
      readOnly: true
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-Response'
            type: object
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthenticatedError-Response'
            type: object
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ModelError-Response'
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````