viewa/docs
API Reference

Define areas on an image

POST
/areas

Creates a set of areas on a ready image and starts the work that prepares them for rendering. The response carries the areas with measurements and plane still null: they are estimated in the background job. status stays processing until that finishes - poll GET /areas/{id} until it reaches ready, which is required before a render and is when the measurements appear. Send every area for the image in one call: the estimation runs across the whole set at once. A set holds between 1 and 20 areas.

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

Header Parameters

Idempotency-Key?string

Replaying a create with the same key returns the original set instead of doing the work twice. Scoped to your account.

Lengthlength <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/areas" \  -H "Content-Type: application/json" \  -d '{    "image": "img_7bQ2mR9vXpL4dK1sZeCt",    "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"  }}