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

# Update Location

> Update a Location's metadata

Use this API to update a Location's metadata.

# Endpoint

`POST https://api.velt.dev/v1/organizations/documents/locations/update`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="apiKey" type="string" required>
      Your API key
    </ParamField>

    <ParamField body="authToken" type="string" required>
      Your Auth Token
    </ParamField>

    <ParamField body="organizationId" type="string">
      Organization ID. Provide the organizationId if you are using Organizations feature.
    </ParamField>

    <ParamField body="documentId" type="string" required>
      Document ID
    </ParamField>

    <ParamField body="migrate" type="object" required>
      <Expandable title="properties">
        <ParamField body="oldLocation" type="object" required>
          The current location object
        </ParamField>

        <ParamField body="newLocation" type="object" required>
          The updated location object
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="merge" type="boolean">
      When true, merges new location fields with existing ones. When false, completely replaces the old location object.
      Default: false
    </ParamField>
  </Expandable>
</ParamField>

## **Example Request**

```JSON theme={null}
{
  "data": {
    "apiKey": "YOUR_API_KEY",
    "authToken": "YOUR_AUTH_TOKEN",
    "documentId": "YOUR_DOCUMENT_ID",
    "migrate": {
      "oldLocation": {
        "id": "scene_1",
        "locationName": "Untitled scene"
      },
      "newLocation": {
        "id": "scene_1",
        "locationName": "White scene"
      }
    },
    "merge": true
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "status": "success",
    "message": "Location updated.",
    "data": null
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "status": "success",
      "message": "Location updated.",
      "data": null
    }
  }
  ```
</ResponseExample>
