Env API Documentation

Interact programmatically with Env's sustainability platform. Track emissions, generate compliance reports, and analyze ESG metrics across your organization.

Base URL

https://api.env.io/v1

Authentication

All API requests require authentication via Bearer token. Include your API key in the Authorization header.

# Authenticate & fetch emissions data curl -X GET https://api.env.io/v1/emissions \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -H "Content-Type: application/json"
// Node.js / Fetch API const response = await fetch('https://api.env.io/v1/emissions', { headers: { 'Authorization': `Bearer ${YOUR_API_KEY}`, 'Content-Type': 'application/json' } }); const data = await response.json();
# Python / Requests import requests headers = { "Authorization": f"Bearer {YOUR_API_KEY}", "Content-Type": "application/json" } response = requests.get("https://api.env.io/v1/emissions", headers=headers) data = response.json()

Get Emissions Data

GET /emissions

Retrieve carbon emission records across Scope 1, 2, and 3 for your organization.

ParameterTypeDescription
scopestringFilter by scope: 1, 2, or all
from_datestringISO 8601 start date (e.g., 2024-01-01)
to_datestringISO 8601 end date
limitintegerMax records to return (default: 50, max: 200)

Generate Sustainability Report

POST /reports/generate

Create a standardized ESG or carbon compliance report. Returns a task ID for asynchronous processing.

curl -X POST https://api.env.io/v1/reports/generate \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -H "Content-Type: application/json" \\ -d '{"type": "ESG_GRI", "year": 2024, "include_audits": true}'
const payload = { type: 'ESG_GRI', year: 2024, include_audits: true }; const res = await fetch('https://api.env.io/v1/reports/generate', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify(payload) });
payload = { "type": "ESG_GRI", "year": 2024, "include_audits": True } response = requests.post( "https://api.env.io/v1/reports/generate", headers=headers, json=payload )
202 Accepted
{ "task_id": "task_8f3k29d1", "status": "processing", "estimated_completion": "2024-11-15T14:30:00Z", "webhook_url": null }

ESG Metrics

GET /organizations/{id}/metrics

Retrieve real-time ESG performance indicators including energy efficiency, water usage, waste diversion rates, and compliance scores.

Error Handling

Env uses standard HTTP status codes. Errors return a JSON body with a descriptive message.

CodeMeaningResolution
400Bad RequestValidate request parameters and payload structure.
401UnauthorizedCheck API key validity and expiration.
403ForbiddenEnsure your API tier has access to this endpoint.
429Rate LimitedWait before retrying. Check Retry-After header.
500Server ErrorTransient issue. Retry with exponential backoff.

Rate Limits

API requests are limited based on your plan tier. Limits are applied per API key.

  • Starter: 100 requests / minute
  • Professional: 1,000 requests / minute
  • Enterprise: Custom limits & dedicated throughput

Current rate limit status is returned in response headers:

X-RateLimit-Limit: 1000\nX-RateLimit-Remaining: 842\nX-RateLimit-Reset: 1700000000

Webhooks

Configure webhook endpoints to receive real-time notifications for report generation completion, compliance deadline reminders, and emission threshold alerts.

Webhook payloads include a signature header (X-Env-Signature) for verification.