# MatterPak Upload

The VPS Map Creation API accepts a POST request to /v1/vps/map with a JSON payload containing map metadata and Matterport authentication.

## Create a VPS Map using MatterPak

> Creates a new VPS map from a Matterport space using MatterPak.\
> \
> \*\*Authentication Options:\*\*\
> You can authenticate with Matterport using one of two methods:\
> 1\. \*\*OAuth Token\*\*: Use \`oauthToken\` in the metadata\
> 2\. \*\*Client Credentials\*\*: Use both \`clientId\` and \`clientSecret\` in the metadata\
> \
> \*\*Process Flow:\*\*\
> 1\. Submit map creation request with Matterport space ID and credentials\
> 2\. System fetches the MatterPak from Matterport using provided credentials\
> 3\. Map is processed in the cloud (no file upload required)\
> 4\. Map becomes available for VPS queries when processing completes\
> \
> \*\*Note:\*\* The map name will be automatically truncated to 30 characters if longer.<br>

```json
{"openapi":"3.0.0","info":{"title":"VPS Map Creation API - MatterPak","version":"1.0.0"},"servers":[{"url":"https://api.multiset.ai","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Standard Authorization header using the Bearer scheme.\n\nYou can obtain a bearer token by:\n1. Authenticating through /v1/auth/login endpoint\n2. Using M2M (Machine-to-Machine) credentials via /v1/m2m/token endpoint\n\nExample: \"Authorization: Bearer {your-jwt-token}\"\n"}},"schemas":{"CreateMatterPakMapRequest":{"type":"object","required":["mapName","coordinates","source"],"properties":{"mapName":{"type":"string","description":"Name of the VPS map (will be truncated to 30 characters if longer).\nShould be descriptive and unique to help identify the map.\n","minLength":3,"maxLength":255},"coordinates":{"type":"object","description":"Geographic coordinates where the map is located","required":["latitude","longitude","altitude"],"properties":{"latitude":{"type":"number","format":"double","minimum":-90,"maximum":90,"description":"Latitude in decimal degrees"},"longitude":{"type":"number","format":"double","minimum":-180,"maximum":180,"description":"Longitude in decimal degrees"},"altitude":{"type":"number","format":"double","description":"Altitude in meters above sea level"}}},"heading":{"type":"number","format":"double","minimum":0,"maximum":360,"description":"Optional heading/orientation in degrees (0-360)"},"source":{"type":"object","description":"Source configuration for the MatterPak map","required":["provider","fileType","coordinateSystem","processType","metadata"],"properties":{"provider":{"type":"string","enum":["matterport"],"description":"Must be \"matterport\" for MatterPak maps"},"fileType":{"type":"string","enum":["matterpak"],"description":"Must be \"matterpak\" for MatterPak maps"},"coordinateSystem":{"type":"string","enum":["RHS","LHS"],"description":"Coordinate system used by the map:\n- RHS: Right-Hand Coordinate System\n- LHS: Left-Hand Coordinate System\n"},"processType":{"type":"string","enum":["cloud"],"description":"Must be \"cloud\" for MatterPak maps (processed server-side)"},"metadata":{"type":"object","description":"Matterport authentication and space information.\nYou must provide either:\n1. spaceId + oauthToken, OR\n2. spaceId + clientId + clientSecret\n","required":["spaceId"],"properties":{"spaceId":{"type":"string","description":"Matterport space ID (model ID) to create the VPS map from.\nYou can get this from the Matterport API or dashboard.\n"},"oauthToken":{"type":"string","description":"Matterport OAuth token for authentication.\nUse this OR clientId/clientSecret (not both).\n"},"clientId":{"type":"string","description":"Matterport Client ID for authentication.\nMust be used together with clientSecret.\n"},"clientSecret":{"type":"string","description":"Matterport Client Secret for authentication.\nMust be used together with clientId.\n"}},"oneOf":[{"required":["spaceId","oauthToken"]},{"required":["spaceId","clientId","clientSecret"]}]}}}}},"CreateMapResponse":{"type":"object","properties":{"message":{"type":"string","description":"Success message"},"mapId":{"type":"string","description":"Unique identifier for the created map"},"status":{"type":"string","enum":["processing","active","failed"],"description":"Current processing status of the map"},"mapName":{"type":"string","description":"Name of the created map"},"estimatedProcessingTime":{"type":"string","description":"Estimated time for map processing to complete"}},"required":["message","mapId","status","mapName"]},"Error":{"type":"object","properties":{"error":{"type":"string","description":"A message detailing the error"},"code":{"type":"integer","description":"Error code (optional)"}},"required":["error"]}}},"paths":{"/v1/vps/map":{"post":{"summary":"Create a VPS Map using MatterPak","description":"Creates a new VPS map from a Matterport space using MatterPak.\n\n**Authentication Options:**\nYou can authenticate with Matterport using one of two methods:\n1. **OAuth Token**: Use `oauthToken` in the metadata\n2. **Client Credentials**: Use both `clientId` and `clientSecret` in the metadata\n\n**Process Flow:**\n1. Submit map creation request with Matterport space ID and credentials\n2. System fetches the MatterPak from Matterport using provided credentials\n3. Map is processed in the cloud (no file upload required)\n4. Map becomes available for VPS queries when processing completes\n\n**Note:** The map name will be automatically truncated to 30 characters if longer.\n","tags":["VPS Maps"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMatterPakMapRequest"}}}},"responses":{"201":{"description":"Map creation request submitted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMapResponse"}}}},"400":{"description":"Bad request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Missing or invalid authentication token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden - Matterport authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
