API Documentation

Welcome to the Env API. Our RESTful API provides programmatic access to environmental data, carbon tracking, compliance reporting, and sustainability analytics. Build integrations, automate ESG workflows, and power your green technology stack.

Tip: Base URL for all endpoints: https://api.env.com/v1. All requests must use HTTPS.

Authentication

Env uses Bearer token authentication. Include your API key in the Authorization header of every request.

curl -X GET https://api.env.com/v1/organizations/my-org\n  -H "Authorization: Bearer sk_live_51HG3k9..."\n  -H "Content-Type: application/json"
const response = await fetch('https://api.env.com/v1/organizations/my-org', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer sk_live_51HG3k9...',
    'Content-Type': 'application/json'
  }
});
const data = await response.json();
import requests

headers = {
    "Authorization": "Bearer sk_live_51HG3k9...",
    "Content-Type": "application/json"
}

response = requests.get(
    "https://api.env.com/v1/organizations/my-org",
    headers=headers
)
data = response.json()
Note: Never expose your secret API keys in client-side code. Use server-side proxies or restricted environment keys for frontend applications.

Carbon Footprint

Retrieve, calculate, and track carbon emissions across your organization's operations and supply chain.

GET /v1/carbon-footprint/{org_id}

Fetch the comprehensive carbon footprint report for a specific organization, broken down by Scope 1, 2, and 3 emissions.

Parameters

NameTypeDescription
org_idstringYour unique organization identifier
start_datedateStart of reporting period (YYYY-MM-DD)
end_datedateEnd of reporting period
scopestringFilter by scope: 1, 2, 3, or all

Example Request

curl -X GET "https://api.env.com/v1/carbon-footprint/org_123?start_date=2024-01-01&end_date=2024-12-31&scope=all" \
  -H "Authorization: Bearer YOUR_API_KEY"
response = requests.get(
    "https://api.env.com/v1/carbon-footprint/org_123",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={
        "start_date": "2024-01-01",
        "end_date": "2024-12-31",
        "scope": "all"
    }
)

Example Response

{
  "org_id": "org_123",
  "period": {
    "start": "2024-01-01",
    "end": "2024-12-31"
  },
  "total_co2e_tons": 14520.8,
  "breakdown": {
    "scope_1": {
      "tons": 3200.5,
      "percentage": 22.04,
      "sources": ["natural_gas", "fleet_vehicles"]
    },
    "scope_2": {
      "tons": 4100.2,
      "percentage": 28.24,
      "sources": ["grid_electricity"]
    },
    "scope_3": {
      "tons": 7220.1,
      "percentage": 49.72,
      "sources": ["business_travel", "supply_chain", "waste"]
    }
  },
  "status": "verified",
  "methodology": "GHG_Protocol_2023"
}

Rate Limits

To ensure platform stability, API requests are rate-limited based on your subscription tier.

HeaderDescription
X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the window resets
Warning: Exceeding rate limits returns a 429 Too Many Requests status. Implement exponential backoff in your integrations.

Error Handling

Env uses standard HTTP status codes and returns detailed JSON error objects.

CodeMeaningAction
400Bad RequestCheck request body and parameters
401UnauthorizedVerify your API key or token
403ForbiddenInsufficient permissions for resource
404Not FoundResource or endpoint doesn't exist
429Too Many RequestsSlow down and implement backoff
500Server ErrorTemporary issue. Retry after delay
{
  "error": {
    "code": "invalid_api_key",
    "message": "The provided API key is invalid or expired.",
    "status": 401,
    "request_id": "req_8f3k29d0s82"
  }
}

SDKs & Libraries

Accelerate development with official Env SDKs for popular languages and frameworks.

npm install @env/sdk
pip install env-py
gem install env-ruby

Visit our GitHub repository → for full SDK documentation, examples, and community support.