POST /resources/wrappers/generate
Generate a new AI-powered wrapper for sustainability indicators. The wrapper will be created asynchronously - the endpoint returns immediately with wrapper details, while code generation and execution happen in the background via a message queue.Authentication
This endpoint requires authentication. Include your API key in the request headers.Request Body
Type of data source. Must be one of:
API- REST API endpointCSV- CSV fileXLSX- Excel file
Source-specific configuration. The structure varies based on
source_type.Indicator metadata describing the sustainability metric.
Automatically create a resource for this wrapper
Response
Unique identifier for the generated wrapper
Associated resource ID (if auto_create_resource is true)
The indicator metadata from the request
Type of data source (API, CSV, or XLSX)
Source-specific configuration
Generated wrapper code (null during generation)
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
ISO 8601 timestamp of completion (null if not completed)
Current status:
pending, generating, creating_resource, executing, stopped, completed, or errorError message if status is
errorArray of execution log messages
ISO 8601 timestamp of last health check
ISO 8601 timestamp of last data transmission
Number of data points processed
Type-specific monitoring information
Current execution phase:
historical or continuousNewest data point timestamp ever sent (for resumable execution)
Oldest data point timestamp ever sent (for resumable execution)
Result of the last execution (if available)
Example Request
cURL
Example Response
Error Responses
400 Bad Request
Invalid wrapper generation request. Common causes:
- Missing required fields
- Invalid source_type value
- File not found for CSV/XLSX sources
- Invalid configuration parameters
External service error during wrapper generation:
- Connection error to external services
- Timeout communicating with dependencies
- Database unavailable