# Map Version

These endpoints let you create a Map Version, add additional scans to it, switch which scan is active, and tear the version down. See [Map Versioning](/basics/map-versioning.md) for the concepts behind these calls.

{% hint style="warning" %}
To whitelist your domain, follow: [Configuring Allowed Domains (CORS)](/basics/credentials/configuring-allowed-domains-cors.md)
{% endhint %}

{% hint style="info" %}
**Codes used in these APIs**

* **Version Code** (e.g. `MVER_W6NTBJ0ALVUN`), identifies a Map Version. Returned when you create one.
* **Map Code** (e.g. `MAP_BTTE1MOXYVT8`), identifies an individual map. Used as the base, target, or active map.
  {% endhint %}

## Endpoints

### Create Map Version

Creates a new Map Version. The `sourceMapCode` becomes the **base map**, its coordinate frame becomes the version's frame, and your content layer should be authored against it. The `targetMapCode` is added as the first additional version.

The response is `202 Accepted`, the VPS computes the rigid transform asynchronously. Poll **Get Map Version** until the target map's status flips from `computing` to `ready`.

**Constraints:**

* Both maps must be in your account.
* Neither map can already belong to a Map Version.
* `sourceMapCode` and `targetMapCode` must differ.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version" method="post" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

### Get Map Version

Returns the full state of a Map Version: every scan in it, each scan's per-map `relativePose`, the current active map, and processing status.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version/{versionCode}" method="get" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

### Add Map to Map Version

Adds a new scan to an existing Map Version. The transform is computed against the **currently active map** in the version (not the original base). This is what lets you keep adding fresh scans over time without alignment quality decaying back to the original capture.

**Constraints:**

* The target map must be in your account and must not already belong to a Map Version.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version/{versionCode}/maps" method="post" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

### Activate Map in Version

Switches which map in the version is **active**. After this call, VPS queries against the base map's `mapCode` are silently routed to the activated map, and the returned pose is transformed back into the base map's coordinate frame.

**Constraints:**

* The given map must already be part of this version.
* The given map must be in `ready` status, you cannot activate a map whose alignment is still `computing` or `failed`.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version/{versionCode}/activate" method="put" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

***

### Remove Map from Version

Removes a single scan from a Map Version. The map itself is not deleted, only its association with the version.

**Constraints:**

* You cannot remove the base map of the version.
* You cannot remove the currently active map. Activate a different map first, then remove this one.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version/{versionCode}/maps/{targetMapCode}" method="delete" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

***

### Delete Map Version

Deletes the Map Version and clears the version association from every map in it. The maps themselves are kept.

{% openapi src="/files/raC9U46pEdVX4vbsnwnn" path="/map-version/{versionCode}" method="delete" %}
[map-version-api.yaml](https://3163433004-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FokTDI7QVY04Zvb1pQ8Ry%2Fuploads%2Fgit-blob-5ecbac0f3faf16aa5d0b75d50d904c1fcdc151be%2Fmap-version-api.yaml?alt=media)
{% endopenapi %}

## Status values

| Status      | Meaning                                                                                         |
| ----------- | ----------------------------------------------------------------------------------------------- |
| `computing` | VPS is computing the transform between this scan and the version's source map.                  |
| `ready`     | Transform is computed. The map can be set as active.                                            |
| `failed`    | The VPS could not align this scan. Inspect `failureReason` on the **Get Map Version** response. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.multiset.ai/basics/rest-api-docs/map-version.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
