---
title: "Merged 3D model of every building in a square around a point (async job, emailed)"
description: "Proxy for the Contoor 3D API (`project_res_3D_api`, FastAPI, systemd unit `contoor-3d-api` on the RES box, published at contoor-api-contabo.gisjoe.com). RES adds the RES token, the request allowlist and RES-hosted artifact URLs so one contract and one credential cover parcels and meshes.\n\nExpands `lat`/`lng` ± `radius_m` into a square in LV95, fetches every cadastral footprint inside it, runs the roofer once for the combined area and packages one merged `model.obj` / `model.glb` / `model.city.json` / `model.dxf` plus `manifest.json` into a ZIP. Delivery is asynchronous: the ZIP link is e-mailed to `email` AND exposed on `GET /res_api/3d/jobs/{jobId}` as `downloadUrl` once `state` is `done`. Typical runtime: 1–10 minutes depending on the number of buildings."
---

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

Path: RES API (public) › Building3D

`POST /res_api/3d/building_model/area`

Proxy for the Contoor 3D API (`project_res_3D_api`, FastAPI, systemd unit `contoor-3d-api` on the RES box, published at contoor-api-contabo.gisjoe.com). RES adds the RES token, the request allowlist and RES-hosted artifact URLs so one contract and one credential cover parcels and meshes.

Expands `lat`/`lng` ± `radius_m` into a square in LV95, fetches every cadastral footprint inside it, runs the roofer once for the combined area and packages one merged `model.obj` / `model.glb` / `model.city.json` / `model.dxf` plus `manifest.json` into a ZIP. Delivery is asynchronous: the ZIP link is e-mailed to `email` AND exposed on `GET /res_api/3d/jobs/{jobId}` as `downloadUrl` once `state` is `done`. Typical runtime: 1–10 minutes depending on the number of buildings.

## Authentication

- `ResApiToken`, apiKey, in header, header `token`

## Request body

_Required._

- `lat` (`createBuildingModelArea.lat`; number, required): WGS84 latitude (inside Switzerland).
- `lng` (`createBuildingModelArea.lng`; number, required): WGS84 longitude (inside Switzerland).
- `email` (`createBuildingModelArea.email`; string, required)
  - format `email`
- `radius_m` (`createBuildingModelArea.radius_m`; number, optional): Half-width of the square in metres (75 → 150 m × 150 m).
  - min 1; max 500; default `75`
- `formats` (`createBuildingModelArea.formats`; array<string>, optional): Requested output formats.
  - one of `"cityjson"`, `"obj"`, `"glb"`, `"dxf"`; default `["obj","glb"]`

## Example request

```json
{
  "lat": 47.644176,
  "lng": 9.173799,
  "radius_m": 75,
  "email": "you@example.com",
  "formats": [
    "obj",
    "glb",
    "dxf"
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://res.aireon.ch/res_api/3d/building_model/area \
  --header 'Content-Type: application/json' \
  --header 'token: <token>' \
  --data '
{
  "lat": 47.644176,
  "lng": 9.173799,
  "radius_m": 75,
  "email": "you@example.com",
  "formats": [
    "obj",
    "glb",
    "dxf"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/3d/building_model/area';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', token: '<token>'},
  body: JSON.stringify({
    lat: 47.644176,
    lng: 9.173799,
    radius_m: 75,
    email: 'you@example.com',
    formats: ['obj', 'glb', 'dxf']
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/3d/building_model/area"

payload = {
    "lat": 47.644176,
    "lng": 9.173799,
    "radius_m": 75,
    "email": "you@example.com",
    "formats": ["obj", "glb", "dxf"]
}
headers = {
    "Content-Type": "application/json",
    "token": "<token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 202

Job queued.

#### Example

```json
{
  "jobId": "9d222c6d-893e-4e79-8201-3c9ca16a0f39",
  "state": "queued",
  "statusUrl": "string",
  "message": "string",
  "email": "string",
  "radius_m": 0,
  "formats": [
    "obj",
    "glb"
  ]
}
```

- `jobId` (`createBuildingModelArea.response.202.jobId`; string, required)
  - format `uuid`
- `state` (`createBuildingModelArea.response.202.state`; string, required)
- `statusUrl` (`createBuildingModelArea.response.202.statusUrl`; string, required): RES path to poll.
- `message` (`createBuildingModelArea.response.202.message`; string, optional)
- `email` (`createBuildingModelArea.response.202.email`; string, optional)
- `radius_m` (`createBuildingModelArea.response.202.radius_m`; number, optional)
- `formats` (`createBuildingModelArea.response.202.formats`; array<string>, optional): Requested output formats.
  - one of `"cityjson"`, `"obj"`, `"glb"`, `"dxf"`; default `["obj","glb"]`

### 400

Invalid request.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`createBuildingModelArea.response.400.error`; string, required): Human-readable error description.
- `message` (`createBuildingModelArea.response.400.message`; string, optional): Optional underlying error message.

### 401

Authentication missing or invalid.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`createBuildingModelArea.response.401.error`; string, required): Human-readable error description.
- `message` (`createBuildingModelArea.response.401.message`; string, optional): Optional underlying error message.

### 403

Authenticated but not permitted.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`createBuildingModelArea.response.403.error`; string, required): Human-readable error description.
- `message` (`createBuildingModelArea.response.403.message`; string, optional): Optional underlying error message.

### 502

The 3D service is unreachable or answered with an error (its status and body are relayed in `upstream_status` / `upstream`).

#### Example

```json
{
  "error": "string",
  "upstream_status": 0,
  "upstream": null,
  "detail": "string"
}
```

- `error` (`createBuildingModelArea.response.502.error`; string, optional)
- `upstream_status` (`createBuildingModelArea.response.502.upstream_status`; integer, optional)
- `upstream` (`createBuildingModelArea.response.502.upstream`; unknown, optional)
- `detail` (`createBuildingModelArea.response.502.detail`; string, optional)

### 504

The 3D service did not answer within the proxy timeout.

#### Example

```json
{
  "error": "string",
  "detail": "string"
}
```

- `error` (`createBuildingModelArea.response.504.error`; string, optional)
- `detail` (`createBuildingModelArea.response.504.detail`; string, optional)


Source: https://docs.aireon.ch/res/create-building-model-area/index.md
