viewa/docs
API Reference

Update an area set's corners

PUT
/areas/{id}

Replaces the set's areas and recalculates everything derived from them - for example after a shopper drags a corner. status returns to processing; poll until ready before rendering again. One call covers every edit: send an area's id back to keep it, omit id to add an area, omit the area entirely to remove it, and send the same ids in a different order to reorder. Selections you have stored against an area_ id stay valid as long as you send that id. The same 1-to-20-area bound applies as on create. Only whole sets can be updated: the estimation runs across every area together, so there is no single-area update. If the recalculation fails, the set becomes failed with area_calculation_failed - send another update with adjusted corners, or create a new set.

Authorization

AuthorizationBearer <token>

Publishable key (browser-safe), sent as Authorization: Bearer pk_…. This is the lower API-key tier and is sufficient for browser-safe routes that require the pk tier. Requests using a publishable key are additionally validated against the key's domain allowlist via the Origin header. Used for upload, areas, renders, polling, catalog reads, and history (history additionally requires a visitor token).

In: header

Path Parameters

id*string

An aset_ id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Replaces the set's areas. Send every area you want the set to have, not only the changed ones - an area you omit is removed. Identity comes from id, never from position: send an area's id back to keep it (with whatever corners and name you supply), or omit id to add a new area. Reordering is just sending the same ids in a different order.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PUT "https://example.com/areas/string" \  -H "Content-Type: application/json" \  -d '{    "areas": [      {        "corners": [          [            0.21,            0.3          ],          [            0.78,            0.3          ],          [            0.78,            0.82          ],          [            0.21,            0.82          ]        ]      }    ]  }'
{  "id": "aset_9mK3pQ7wZxN2vC5tBhLr",  "image": "img_7bQ2mR9vXpL4dK1sZeCt",  "status": "processing",  "areas": [    {      "id": "area_4nH8xW2qTvB6yJ0aRmDp",      "name": "Living room window",      "corners": [        [          0.21,          0.3        ],        [          0.78,          0.3        ],        [          0.78,          0.82        ],        [          0.21,          0.82        ]      ],      "measurements": {        "width": 1.42,        "height": 1.08,        "unit": "m"      },      "plane": {        "rotation": [          0,          0,          0        ],        "center": [          0,          0,          0        ]      }    }  ],  "error": {    "code": "occlusion_failed",    "detail": "string"  }}