API Authentication, Permissions & Error Codes
The ClimeqAI REST API (/api/v1/integrations/*) connects your ERP systems, supply-chain platforms, and smart-meter gateways using sust_... API Keys, scoped permissions, and standard error codes.
1. API Key & X-Api-Key Header
Organization administrators (Owner and Admin) can create dedicated API keys for each integration in the Security Center:
- Key Format: Prefix
sust_followed by 48 random hexadecimal characters (e.g.,sust_8f92a1b4c6d8e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7).
- Secure Storage (SHA-256): The raw key is shown once upon creation; only its SHA-256 hash is stored in the database.
- HTTP Header: Pass the key in the
X-Api-Keyheader on every request:
curl -X POST "https://api.climeqai.com/api/v1/integrations/emissions/calculate" \
-H "X-Api-Key: sust_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sourceType": "Natural Gas",
"quantity": 450,
"unit": "m3",
"region": "TR",
"calculationMethod": "ar6",
"persist": false
}'
2. Permission Scopes
Each API key can be restricted to the specific scopes it needs. Write scopes (*:write) automatically include calculation and read permissions within the same resource family:
| Scope | Authorized Operations | Covered Endpoint Family |
|---|---|---|
| emissions:calculate | Stateless (persist: false) calculations across core, AI mapping, energy, freight, procurement, travel, PCF, CBAM, and cloud carbon | POST /emissions/calculate, /mapping-agent/, /energy/, /freight/, /procurement/, /travel/, /pcf/, /cbam/, /cloud/calculate |
| emissions:write | Saving records to the carbon ledger (persist: true), background queueing (async: true), and smart-meter ingestion | All calculation endpoints (persist: true) + /telemetry/push |
| emissions:read | Retrieving saved emission records, gas breakdowns, audit trails, and blockchain proofs | GET /emissions/{id}, GET /telemetry/ |
| factors:search | Searching emission factors and listing unit types, region codes, and dataset versions | GET /data/search, /data/unit-types, /data/regions, /data/versions |
| private-factors:read | Listing organization-specific private emission factors | GET /private-factors |
| private-factors:write | Creating organization-specific private emission factors | POST /private-factors |
| private-factors:delete | Deleting organization-specific private emission factors | DELETE /private-factors/{id} |
3. Account Isolation & Data License Protection
| Security Layer | Enforced Policy | Violation Response |
|---|---|---|
| Endpoint Isolation | sust_... keys can only access the 31 integration endpoints under /api/v1/integrations/; console endpoints are blocked. | 401 / 403 |
| Account Isolation | Every key is bound to one OrganizationId. Overriding the organization via X-Tenant-Id, ?orgId=, or body fields is rejected. | 403 Forbidden (missing_organization_context) |
| IP Whitelisting | When IP whitelisting is enabled in Security Settings, only requests from approved IPv4/IPv6 ranges are accepted. | 401 Unauthorized |
| Commercial Dataset Masking (factorValueMasked) | For calculation-only commercial datasets (e.g., Ecoinvent, IEA, EXIOBASE), total co2e is returned accurately while raw unit coefficients are masked (factorValueMasked: true). | 200 OK (Masked coefficient) |
[!NOTE]
For security, URLs supplied in
sourceLinkon private emission factors blocklocalhost, loopback, private network subnets (10.x,192.168.x,172.16-31.x), and cloud metadata services (169.254.169.254).
4. Response Format & Error Codes
Every integration endpoint returns a consistent JSON structure (success, data, message, errorCode, errors):
{
"success": false,
"data": null,
"message": "No active emission factor found for selector 'steel_section' in exact region 'FR' (regionFallback=false).",
"errorCode": "no_emission_factors_found",
"errors": []
}
Standard Error Codes (errorCode)
| HTTP Status | errorCode | Meaning & Recommended Client Action |
|---|---|---|
| 400 | invalid_input | Missing required field or non-positive numeric quantity. Validate payload schema before retrying. |
| 400 | batch_limit_exceeded | Batch array exceeds 100 items. Split batch requests into chunks of at most 100 items. |
| 400 / 422 | invalid_unit_type | Supplied unit is incompatible with the selected factor's dimension. Query GET /data/unit-types. |
| 401 | (Auth Failure) | Missing, malformed, expired, or revoked X-Api-Key, or client IP outside organization whitelist. |
| 403 | missing_api_scope | API key lacks the required scope for the target endpoint. |
| 403 | missing_organization_context | Supplied organizationId or X-Tenant-Id mismatches the key's bound organization. |
| 403 | feature_not_entitled | Target module (e.g., CBAM, Private Factors, Blockchain Sealing) requires a higher subscription tier. |
| 403 | quota_exceeded | Monthly persisted emission record quota (MonthlyEmissionRecords) has been reached. |
| 404 / 422 | no_emission_factors_found | No active emission factor matched the selector, region, or year constraints. |
| 404 | resource_not_found | Requested record ID or cloud region does not exist. |
| 422 | license_restricted | Selected factor cannot be used due to dataset license status. |
| 429 | rate_limit_exceeded | Per-key rate limit (60 req/min) or monthly API quota exceeded. Wait for Retry-After (60s) before retrying. |
| 503 | service_unavailable | Downstream calculation engine is temporarily unavailable; retry shortly. |
5. Request Size & Rate Limits
- Max Request Body Size:
1 MB(1,048,576 bytes;256 KBon telemetry ingestion).
- Rate Limit: 60 requests / minute per API key (returns
Retry-After: 60).
- Collection Limits: Maximum 100 items per batch request, 25 legs per intermodal freight route, 50 BOM components per PCF request, and 120 characters per catalog search query.
Platform Guide & Technical Documents
- Smart Invoice and Document Reader
- Carbon Forecasting and Scenario Analysis
- AI Workflow Management
- Supply Chain Risk Monitoring
- VALENQ Engine Mapping & Industry Codes
- Catalog Search, Units & Private Factors
- API Versioning & Changelog
- Energy, Freight, Procurement & Travel APIs
- Product, CBAM, Cloud, IoT & Passport APIs
- OpenAPI, Postman & MCP Server
- Audit Logs User Guide
- Corporate Emission Calculation Methods
- Blockchain Data Sealing and Verification
- Digital Product Passport Guide
- Supported Reporting Standards
- Dashboard User Guide
- Data Quality, Standardization & Version Management
- Decarbonization Pathways User Guide
- Digital Product Passport Workspace
- AI Emission Factor Mapping Methodology
- Emission Factor Library
- Emission Scopes (Scope 1, 2 & 3)
- Validating and Approving Emission Data
- Data Explorer & Carbon Ledger User Guide
- Frequently Asked Questions (FAQ)
- Carbon Accounting & Sustainability Glossary
- Support Center & Help Channels
- Financial Integration & ERP Sync User Guide
- Core & Batch Emission Calculation API
- API Authentication, Permissions & Error Codes
- ERP, Cloud & IoT Connectors
- Webhooks & Signature Verification
- Intelligence & Resilience Hub User Guide
- Organization Invitations
- Methodology Overview
- Mission Control Center User Guide
- Carbon Offset & Environmental Attribute Hub User Guide
- Account Creation and First Steps
- Role and Permission Management (RBAC)
- Team Setup and Organization Management
- Product Carbon Footprint & CBAM Methodology
- Product Impact & LCA Studio User Guide
- Quickstart (Step 1): Generating an API Key
- Quickstart (Step 2): Making Your First Calculation Request
- Quickstart (Step 3): Reviewing, Approving & Anchoring Records
- Reports Hub & AI Report Editor User Guide
- ESG Risk Guardian User Guide
- Security Center
- Data Lineage, Integrity & Independent Auditor Workspace
- Data Security and Encryption
- Identity and Access Management (IAM)
- System & Organization Settings User Guide
- Supply Chain & Value Chain Portal User Guide
- Sustainability & Targets Hub User Guide
- User Management (RBAC)
- Webhook Management