> ## 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 Location

> Update a location

export const permission_0 = 'element:update'

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


## OpenAPI

````yaml PATCH /v1/location/{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/location/{uuid}:
    parameters:
      - in: path
        name: uuid
        required: true
        description: A location's `uuid` or `syncId`.
        schema:
          type: string
    patch:
      summary: Update a location
      description: >
        Partial update — only the fields you send change. Send `geoLocation:
        null` to detach the

        anchored point. `ownerCompany` is immutable and cannot be changed here.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditLocation'
      responses:
        '200':
          description: The updated location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Location'
        '400':
          description: >-
            Invalid request — e.g. a blank `name`, an invalid `type`, or an
            unknown `geoLocation`.
        '401':
          description: ExpiredToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredTokenResponse'
        '404':
          description: >-
            No location with that `uuid` or `syncId` is accessible to your
            account (it is neither your company's nor an unclaimed supplier's
            that you registered it for).
      security:
        - bearerAuth: []
components:
  schemas:
    EditLocation:
      type: object
      description: >
        A partial update — only the fields you send change. `ownerCompany` is
        immutable after create and

        is not accepted here.
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - factory
            - warehouse
            - office
            - port
            - other
        address1:
          type: string
        address2:
          type: string
        postCode:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
        geoLocation:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/LocationGeoLocationRef'
          description: >-
            A geolocation reference to anchor the site, or `null` to detach the
            current point.
    Location:
      type: object
      description: >
        A named company site (factory / warehouse / office / port / other),
        optionally anchored to a

        geolocation for coordinates. Products, activities, and transport legs
        reference these internally

        as a physical origin / destination / location.
      properties:
        uuid:
          type: string
          format: uuid
        name:
          type: string
          example: Tokyo factory
        type:
          type: string
          enum:
            - factory
            - warehouse
            - office
            - port
            - other
          example: factory
        owner:
          allOf:
            - $ref: '#/components/schemas/IDAndName'
          description: >-
            The company that owns the site — your own company, or an unclaimed
            supplier you registered it for.
        address1:
          type: string
          example: 1-1 Marunouchi
        address2:
          type: string
        postCode:
          type: string
          example: 100-0005
        city:
          type: string
          example: Tokyo
        state:
          type: string
        country:
          type: string
          example: Japan
        geoLocation:
          $ref: '#/components/schemas/ApiGeoLocation'
    ExpiredTokenResponse:
      type: object
      properties:
        message:
          type: string
          example: token expired
    LocationGeoLocationRef:
      description: >
        A reference to the geolocation that anchors a site. Provide either an
        existing point's `uuid`,

        or a `googleMapsId` (resolved and persisted on your behalf, like `POST
        /v1/geolocation`).
      oneOf:
        - type: object
          required:
            - uuid
          properties:
            uuid:
              type: string
              format: uuid
        - type: object
          required:
            - googleMapsId
          properties:
            googleMapsId:
              type: string
              example: ChIJA4UGSG_xNIgRNBuiWqEV-Y0
    IDAndName:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/UUID'
        name:
          type: string
          example: Name
    ApiGeoLocation:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          description: >-
            Present only on a persisted geolocation (the POST response); absent
            on search candidates.
        googleMapsId:
          type: string
          example: ChIJA4UGSG_xNIgRNBuiWqEV-Y0
        name:
          type: string
          description: The geocoder's formatted address.
          example: Syracuse, NY, USA
        countryCode:
          type: string
          example: US
        latitude:
          type: number
          example: 43.0481
        longitude:
          type: number
          example: -76.1474
        locationType:
          type: string
          example: APPROXIMATE
    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: {}

````