External API Integrations and Result Tracking
Use a company-restricted service-account key. Both account permissions and key scope must authorize the action. Send Authorization: ApiKey YOUR_KEY or X-Api-Key. Keep keys out of URLs and records. PACT OAuth is configured separately.
The Sustainability API base is /api/sustainability/v1/companies/{companyId}. POST .../activities accepts up to 500 entries in records, and GET .../runs/{runId} retrieves results. Use stable sourceSystem and sourceRecordId. upsert creates or updates and cancel requires a reason. Dates, type, quantity, unit, context, and method inputs follow import rules. identity carries document, line, external transaction, and facility, meter, product, organization, or period details.
For example, submit an electricity record with action upsert, a stable meter reference, dates, 1,000 kWh, quality Measured, context own, and document number. The request creates no factor or approval. For retries, use a stable Idempotency-Key of at most 200 characters and the same payload. Record run ID, replay flag, processed, review, failed and unchanged counts, and individual messages.
| PCF action | Endpoint |
|---|---|
| Supplier draft | POST .../supplier-pcfs |
| Preview study import | POST .../pcf/studies/{studyId}/imports |
| Inspect import | GET .../pcf/imports/{importId}, with the same key |
| Commit import | POST .../pcf/imports/{importId}/commit |
| Published declarations | GET .../pcf/declarations |
| PACT readiness and JSON | GET .../pcf/declarations/{declarationId}/pact |
Writes and reads have separate permissions. Supplier payloads accept one ProductFootprint, an array, or a data envelope. Valid records become drafts. Import preview and commit do not calculate or publish. PACT output requires readiness.
Check key, active account and expiry for authentication, account and key permissions and company for authorization, and per-row messages for validation. Resolve conflicts before retrying and follow service limits. Review linked activities or imports, and correct source-managed data in its source.