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

# Update Transport Lane

> Update a transport lane and its legs

export const permission_0 = 'element:update'

<Info>Requires permission: **{permission_0}**</Info>


## OpenAPI

````yaml PATCH /v1/transport/lane/{uuid}
openapi: 3.0.1
info:
  title: Variable API
  description: This is the Variable API
  version: 1.1.0
servers:
  - url: https://app.variable.global/api
security:
  - basicAuth: []
  - bearerAuth: []
  - oAuthNoScopes: []
paths:
  /v1/transport/lane/{uuid}:
    parameters:
      - in: path
        name: uuid
        required: true
        description: A lane's `uuid` or `syncId`.
        schema:
          type: string
    patch:
      summary: Edit a transport lane
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransportLane'
      responses:
        '200':
          description: The updated transport lane
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransportLane'
        '401':
          description: ExpiredToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredTokenResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    TransportLane:
      description: >-
        A freight route of one or more ordered legs, sent inline (there is no
        standalone leg endpoint). `name` is synthesized from the first leg's
        origin and the last leg's destination when not set.
      allOf:
        - $ref: '#/components/schemas/BaseNode'
        - type: object
          properties:
            syncId:
              $ref: '#/components/schemas/SyncId'
            totalKm:
              type: number
              readOnly: true
              example: 6042.3
            taxonomy:
              $ref: '#/components/schemas/TaxonomyRef'
            CO2ePerTkm:
              type: string
              readOnly: true
              description: >-
                Carbon intensity in kg CO2e per tonne-kilometre, not an absolute
                total — the total only materialises once cargo weight is applied
                via a transport instance on an activity or input. `"0"` when
                genuinely zero, absent when unknown.
              example: '0.0412'
            legs:
              type: array
              items:
                $ref: '#/components/schemas/TransportLeg'
    ExpiredTokenResponse:
      type: object
      properties:
        message:
          type: string
          example: token expired
    BaseNode:
      allOf:
        - $ref: '#/components/schemas/IDAndName'
        - $ref: '#/components/schemas/CreatedUpdated'
    SyncId:
      type: string
      description: >-
        An identifier to use when syncing data with other systems. [Read
        more](/docs/syncId)
      example: sync123
    TaxonomyRef:
      type: object
      description: A reference to a taxonomy category, including its machine-readable path.
      properties:
        uuid:
          type: string
          format: uuid
        name:
          type: string
          example: Material
        path:
          type: string
          example: material
    TransportLeg:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          description: Identifies an existing leg on update; omit to append a new leg.
        order:
          type: integer
          description: 1-based position of the leg within the lane.
          example: 1
        mode:
          $ref: '#/components/schemas/TransportModeRef'
        origin:
          $ref: '#/components/schemas/TransportLocation'
        destination:
          $ref: '#/components/schemas/TransportLocation'
        distance:
          type: object
          nullable: true
          description: >-
            Per-leg distance. Omit on write to auto-compute from the endpoints;
            set to override; send `null` on update to clear a manual override.
          properties:
            quantity:
              type: number
              example: 18.4
            unit:
              $ref: '#/components/schemas/UnitString'
        CO2ePerTkm:
          type: string
          readOnly: true
          description: >-
            Carbon intensity in kg CO2e per tonne-kilometre. See
            `TransportLane.CO2ePerTkm`.
          example: '0.1083'
    IDAndName:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/UUID'
        name:
          type: string
          example: Name
    CreatedUpdated:
      type: object
      properties:
        created:
          type: string
          description: ISO 8601 date
          example: '2021-01-01T00:00:00.000Z'
        updated:
          type: string
          description: ISO 8601 date
          example: '2021-01-31T23:59:59.000Z'
    TransportModeRef:
      description: >-
        How cargo moves on a leg. Polymorphic — a string is a built-in mode by
        code; an object is a company's custom mode by `uuid` or `code`.
        Round-trips on read in the form it was set.
      oneOf:
        - type: string
          example: truck
        - type: object
          anyOf:
            - required:
                - uuid
            - required:
                - code
          properties:
            uuid:
              type: string
              format: uuid
            code:
              type: string
              example: electric-truck
            name:
              type: string
              example: Electric truck
    TransportLocation:
      type: object
      description: >-
        A leg endpoint — a Location or GeoLocation. On write, reference it by
        `uuid`, `googleMapsId`, or `name` (each matched against existing
        records; resolve unknown free-text addresses via the Geolocation
        endpoints first). Reads expand whichever fields the underlying node has.
      properties:
        uuid:
          type: string
          format: uuid
        googleMapsId:
          type: string
          example: ChIJA4UGSG_xNIgRNBuiWqEV-Y0
        name:
          type: string
          example: Newark, NJ, USA
        countryCode:
          type: string
          example: US
        latitude:
          type: number
          example: 40.7357
        longitude:
          type: number
          example: -74.1724
    UnitString:
      type: string
      example: kg
      description: >-
        The unit code (e.g. kg, lbs, etc.). All unit codes can be found in the
        [List Units](/api-reference/v1/unit/get) endpoint.
    UUID:
      type: string
      format: uuid
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    oAuthNoScopes:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /auth/token
          scopes: {}

````