Overview
This endpoint lets users create a new visulaization over an AOI using specified index and assets. It requires a JSON request body with fields like aoi_id, index_id, and src_asset_id. Once created, the API returns the visualization object with a 201 Created status. API key authentication is mandatory. Errors for invalid input or duplication are returned with appropriate codes and messages.
-
Method:
POST -
URL:
/v0/aois/{aoi_id}/visualizations - Operation: Create a new visualization oven an AOI
- Authentication Required: Yes
Authorization
You need the api key which you can get from the API tab in Organization Settings. The api key is required in almost all the commands
Body
You need the following fields in Body :
| Field | Type | Required | Description |
|---|---|---|---|
index_id | string | ✅ | ID of the Index to be visualized |
src_asset_id | array of string | ✅ | ID of the assets of AOI to be included in visualization |
Path Parameters
This endpoint require aoi_id as the only path parameter.
| Name | Type | Required | Description |
|---|---|---|---|
aoi_id | string | Yes | Unique ID of the AOI |
Response
The response for this endpoint confirms successful visualization creation with a 201 Created status. It returns detailed information about the visualization, including its ID, area, bands, expression, geometry, and timestamps. If there’s an error, such as missing fields or duplication, a structured error message with relevant status code is returned.Please refer to the table below for explaination of the fields in the response:
| Name | Type | Description |
|---|---|---|
aoi_id | array of string | Unique ID of the AOI |
created_at | string | Timestamp when the visualization was created (ISO 8601 format) |
expression | string | Mathematical expression applied using the selected bands |
expression_type | string | Type of the expression (e.g., “index”, “formula”) |
id | string | Unique identifier of the visualization |
index_id | string | Unique ID of the AOI |
index_name | string | Human-readable name of the index |
progress | string | Details of progress in visualization creation |
rescale | number | Min and max range used to normalize or rescale the output values |
status | string | Status of the visualization(“creating”, “success”, “failed”, “partial_success”) |
type | string | Type of formula, usually “custom” for user-defined expressions |
updated_at | string | Timestamp when the visualization was last updated (ISO 8601 format) |
user_id | string | Unique ID of the user |
How to use the endpoint
-
Construct your Request:
Create a JSON object with fields likeaoi_id,index_id, andsrc_asset_id. Make sure all fields are filled correctly as required. -
Send the Request:
Include the JSON body and path parameter in the headers and make a POST request tohttps://api.pixxel.space/v0/aois/{aoi_id}/visualizations. -
Examine the Response:
If successful, the API returns a 201 Created response with the full visualization object, including ID, expression, associated bands, and timestamps. If something is wrong (missing fields, duplicate assets, etc.), you’ll receive a structured error message with a relevant status code.