Overview
This endpoint allows users to either run a new insight on a selected Area of Interest (AOI) or get an estimate of the cost associated with that insight. By specifying processing blocks, input datasets, and metadata, users can configure customized geospatial analyses. Dry Run: Setting the estimate flag to true lets users preview the cost without executing the operation. This endpoint is crucial for initiating insights or assessing their resource requirements within the Pixxel platform.
-
Method:
POST -
Endpoint:
/v0/aoi/{aoi_id}/insights - Operation: Create a new insight or estimate its cost.
- 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
Path Parameters
The path parameter aoi_id is used to specify the Area of Interest on which the insight is to be created or costed. It is essential to target the right geospatial context for processing and ensures that insight operations are scoped to a valid AOI within the platform.
| Name | Type | Required | Description |
|---|---|---|---|
aoi_id | string | Yes | ID of the AOI to run the insight on |
Request Body
The request body defines the configuration for the insight. It includes the processing block, the required input asset IDs, optional metadata, and an optional flag for cost estimation. The flexibility allows either simulation of cost or actual insight generation depending on the use case.
| Name | Type | Required | Description |
|---|---|---|---|
project_id | string | No | ID of the project under which the insight will be created |
name | string | No | Human-readable name for the insight |
block | object | Yes | Describes the processing block to use for generating the insight |
input | []object | Yes | Array of input objects. See Data Types for details on structure and how to populate values. |
metadata | object | No | Additional metadata as key-value pairs |
estimate | boolean | No | If true, returns cost estimate instead of creating an insight |
Response
A 200 OK response is returned when the estimate flag is true, indicating the computed cost of executing the insight. A 201 Created response indicates successful creation of the insight with a confirmation message and the insight ID. Both responses confirm the request was processed without errors.
- Returned when the estimate flag is set to true. Provides the cost of executing the insight.
- Returned when the insight is created with the estimate flag set to false.
How to use the Endpoint
- Get the Block’s Input Schema: Use the List Blocks API to get the input structure for your chosen block. See Data Types for details on how to populate the input values.
-
Construct your Request:
Copy the input structure from the block spec and add
valueorstac_urlfor each input. Set estimate to true to fetch cost or false to run the insight. Set the Authorization header with your token and replace aoi_id in the URL. -
Send the Request:
Make a POST request to
https://api.pixxel.space/v0/aoi/{aoi_id}/insights. Include your request body and authorization header. - Examine the Response: If estimate is true, you’ll receive the cost estimate. If false, the response will confirm insight creation with an ID and message. Handle errors by checking status codes and structured error responses.