---
url: /apidocs/asset_environment.md
---
## Environment API

Environment API is mentioned to provide an alternative for environment assets.

Environment resources could be uploaded by any user. Anyone can use his own private environment or public environments provided by other users.

Environments available in all networks.

| Endpoint | Method | Description |
|-----|-----|-----|
| [/api/v0/asset/upload/environment/link](#direct-environment-resource-upload-to-google-bucket-get-upload-link-) | webRequest | Direct environment resource upload to Google bucket (get upload link) |
| [/api/v0/asset/upload/environment/link/complete](#direct-environment-resource-upload-to-google-bucket-complete-upload-link-) | webRequest | Direct environment resource upload to Google bucket (complete upload link) |
| [/api/v0/asset/environment/{id}](#get-environment-resource-data) | webRequest | Get environment resource data |
| [/api/v0/asset/environment/url/{id}](#get-environment-resource-url) | webRequest | Get environment resource url |
| [/api/v0/asset/environment/thumbnail/{size}/{id}](#get-environment-thumbnail-data) | webRequest | Get environment thumbnail data |
| [/api/v0/asset/environment/thumbnail/url/{size}/{id}](#get-environment-thumbnail-url) | webRequest | Get environment thumbnail url |
| [asset:createEnvironment](#create-environment) | websocket | Create environment |
| [asset:deleteEnvironment](#delete-environment) | websocket | Delete environment |
| [asset:updateEnvironment](#update-environment) | websocket | Update environment |
| [asset:searchEnvironments](#search-environments) | websocket | Search environments |
| [asset:environmentCreated](#environment-created-event) | websocketEvent | Environment created event |
| [asset:environmentResourceUploaded](#environment-resource-uploaded-event) | websocketEvent | Environment resource uploaded event |

### Direct environment resource upload to Google bucket (get upload link)

**HTTP Method:** POST

**Path:** /api/v0/asset/upload/environment/link

**Description:** Direct upload gives possibility to upload files directly from a client to a storage bucket. It consist of next steps:

1. Client asks the server for upload link. The server initializes an upload session and returns a link which could be used for upload.

2. Client [uploads a file to Google bucket](https://cloud.google.com/storage/docs/json_api/v1/how-tos/resumable-upload#upload-resumable).

3. Client [sends upload complete acknowledgment to the server](#direct-environment-resource-upload-to-google-bucket-complete-upload-link).

**Request:**

**Response:**

### Direct environment resource upload to Google bucket (complete upload link)

**HTTP Method:** POST

**Path:** /api/v0/asset/upload/environment/link/complete

**Description:** See [direct upload to Google bucket](#direct-environment-resource-upload-to-google-bucket-get-upload-link).

**Request:**

**Response:**

### Get environment resource data

**HTTP Method:** GET

**Path:** /api/v0/asset/environment/{id}

**Request:**

**Response:**

### Get environment resource url

**HTTP Method:** GET

**Path:** /api/v0/asset/environment/url/{id}

**Request:**

**Response:**

### Get environment thumbnail data

**HTTP Method:** GET

**Path:** /api/v0/asset/environment/thumbnail/{size}/{id}

**Request:**

**Response:**

### Get environment thumbnail url

**HTTP Method:** GET

**Path:** /api/v0/asset/environment/thumbnail/url/{size}/{id}

**Request:**

**Response:**

### Create environment

**Method:** websocket

**Endpoint:** asset:createEnvironment

**Description:** Api creates environment resource which could be used instead of environment asset.

By default, environment status will be `private`, as it couldn't become public while resource is not uploaded.

Resource behaviourType should be on of: `image/environment-360`, `video/environment-360`, `image/environment-cubemap`.

**Request:**

**Response:**

### Delete environment

**Method:** websocket

**Endpoint:** asset:deleteEnvironment

**Description:** Api deletes environment. Only admin user can delete environment of other user.

**Request:**

**Response:**

### Update environment

**Method:** websocket

**Endpoint:** asset:updateEnvironment

**Description:** Api updates environment.

Environment status can be one of:

* `private` - available only for environment owner
* `pending` - admin will review environment in order to make it make public
* `public`  - available for all users system-wide

Actual resource should be uploaded before changing status from `private` to something else. Only admin user can set environment status to `public`.

**Request:**

**Response:**

### Search environments

**Method:** websocket

**Endpoint:** asset:searchEnvironments

**Description:** Api returns list of environments.

Status could be one of:

* `own`     - return environments owned by user
* `pending` - return pending environments (only for admins)
* `public`  - return all public environments

Content types could be combination of:

* `image/environment-360`
* `image/environment-cubemap`
* `video/environment-360`

**Request:**

**Response:**

### Environment created event

**Event:** asset:environmentCreated

**Data:**

### Environment resource uploaded event

**Event:** asset:environmentResourceUploaded

**Data:**

## Models

#### Resource

#### Resource Origin

#### Geolocation

#### Dimensions

#### Resource Data Audio

#### Resource Data Video

#### Resource Data Amazon

#### Resource Data Imdb

#### Resource Data Youtube

#### Resource Data Vimeo

#### Resource Data Pinterest

#### Resource Data Pixabay

#### Resource Data Facebook

#### Resource Data Remote Url

#### Live Stream Data

#### AI Generation Data

#### Resource Data Directory

#### Google Drive

#### Channel Data

#### Enrichment Data

#### Programmatic Action with children

#### Programmatic Action
