---
title: "Entity Type LODs (representations)"
section: "API Reference"
route: /apientitytypelod
account: {accountId}
bruce_api: https://{accountId}.api.nextspace.host
guardian_api: https://guardian.nextspace.host
---
# Entity Type LODs (representations)

This is continued documentation about Entity LODs (representations) and how you can assign defaults through an Entity Type.

This is a common way to achieve repeated graphics for a large set of records.
For example the same tree model for all trees.

An Entity LOD will override the Entity Type LOD.

You can read about how to manage Client File records and generate download URLs here: [Client and temp files](/apiclientfile).

## Entity Type LOD requests

Below are the basic requests for managing LODs for an Entity Type.

### Get Entity Type LODs

```http
GET https://{accountId}.api.nextspace.host/entityType/{type_id}/lods?group={group_id}
```

**Requires:**

- Account ID: Account ID must be specified in the subdomain of the request url.
- Logged in user auth token: A token for an active user session on the account, sent as "Authorization: Bearer <token>".

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `{accountId}` | path | yes | The account id of the account to perform the request on. |
| `{type_id}` | path | yes | Related Entity Type ID. |
| `group={group_id}` | query | no | Optional Group ID to filter LODs by. Use 'DEFAULT' for ungrouped/default group. |

**Response**

```typescript
interface IResponse {
    Items: {
        // ID of the related Client File record.
        "ClientFile.ID": string;
        // ID of the related Entity record.
        "Entity.ID": string;
        // Entity Type ID of the related Entity Type record.
        "EntityType.ID"?: string;
        // ID of the lod category.
        "LODCategory.Key": string;
        // Level of detail. 0 is the highest.
        Level: number;
        // LOD group within its Entity Type.
        // This is an optional layer of categorization you can apply.
        // Groups are driven by Entity Styling to let you load different LODs based on attribute values./
        // 'DEFAULT' or unset is the default group.
        Group?: string;
    }[];
}
```

**Javascript example**

```javascript
const url = "https://{accountId}.api.nextspace.host/entityType/{type_id}/lods";
const method = "get";
const token = "your-token";
const body = null;

async function doRequest(type, url, body, token) {
    const headers = {
        "Authorization": `Bearer ${token}`,
        "Content-Type": "application/json"
    };
    const options = {
        method: type,
        headers: headers,
        body: body ? JSON.stringify(body) : null
    };
    const res = await fetch(url, options);
    const json = await res.json();
    return json;
}

doRequest(method, url, body, token).then((res) => {
    console.log(res);
}).catch((err) => {
    console.error(err);
});
```

### Create Entity Type LOD

```http
POST https://{accountId}.api.nextspace.host/entityType/{type_id}/lod/{category_key}/{level}?group={group_id}
```

**Requires:**

- Account ID: Account ID must be specified in the subdomain of the request url.
- Logged in user auth token: A token for an active user session on the account, sent as "Authorization: Bearer <token>".
- Power user auth token: A token for an active power user session on the account, sent as "Authorization: Bearer <token>".

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `{accountId}` | path | yes | The account id of the account to perform the request on. |
| `{type_id}` | path | yes | Related Entity Type ID. |
| `{category_key}` | path | yes | LOD Category key to assign the LOD to. |
| `{level}` | path | yes | Level of detail. 0 is the highest. |
| `group={group_id}` | query | no | Optional Group ID. Use 'DEFAULT' for ungrouped/default group. |

**Request body**

```typescript
interface IRequest {
    // ID of the related Client File record.
    "ClientFile.ID": string;
}
```

**Javascript example**

```javascript
const url = "https://{accountId}.api.nextspace.host/entityType/{type_id}/lod/{category_key}/{level}";
const method = "post";
const token = "your-token";
const body = null;

async function doRequest(type, url, body, token) {
    const headers = {
        "Authorization": `Bearer ${token}`,
        "Content-Type": "application/json"
    };
    const options = {
        method: type,
        headers: headers,
        body: body ? JSON.stringify(body) : null
    };
    const res = await fetch(url, options);
    const json = await res.json();
    return json;
}

doRequest(method, url, body, token).then((res) => {
    console.log(res);
}).catch((err) => {
    console.error(err);
});
```

### Delete Entity Type LODs

```http
POST https://{accountId}.api.nextspace.host/entityType/{type_id}/deleteLODs?group={group_id}
```

**Requires:**

- Account ID: Account ID must be specified in the subdomain of the request url.
- Logged in user auth token: A token for an active user session on the account, sent as "Authorization: Bearer <token>".
- Power user auth token: A token for an active power user session on the account, sent as "Authorization: Bearer <token>".

| Parameter | In | Required | Description |
| --- | --- | --- | --- |
| `{accountId}` | path | yes | The account id of the account to perform the request on. |
| `{type_id}` | path | yes | Related Entity Type ID. |
| `group={group_id}` | query | no | Optional Group ID to filter LODs by. Use 'DEFAULT' for ungrouped/default group. |

**Request body**

```typescript
interface IRequest {
    Items: {
        // Key of the related LOD Category.
        "LODCategory.Key": string;
        // Related level of detail.
        "Level": number;
    }[];
}
```

**Javascript example**

```javascript
const url = "https://{accountId}.api.nextspace.host/entityType/{type_id}/deleteLODs";
const method = "post";
const token = "your-token";
const body = null;

async function doRequest(type, url, body, token) {
    const headers = {
        "Authorization": `Bearer ${token}`,
        "Content-Type": "application/json"
    };
    const options = {
        method: type,
        headers: headers,
        body: body ? JSON.stringify(body) : null
    };
    const res = await fetch(url, options);
    const json = await res.json();
    return json;
}

doRequest(method, url, body, token).then((res) => {
    console.log(res);
}).catch((err) => {
    console.error(err);
});
```

---

Urls on this page are resolved for account `{accountId}`.
Site index: https://docs.nextspace.host/llms.txt · whole site in one file: https://docs.nextspace.host/llms-full.txt
Human-readable version of this page: https://docs.nextspace.host/apientitytypelod
