Authentication & API Basics

The Env API uses API keys to authenticate requests. You can manage your API keys in the Env Dashboard under Settings → API Keys. All API requests must be made over HTTPS.

Important: Keep your API keys secret. Never expose them in client-side code or public repositories. Use environment variables to store them securely.

Authentication Flow

To authenticate your requests, include your API key in the Authorization header using the Bearer scheme:

HTTP
GET /v2/emissions HTTP/1.1
Host: api.env.io
Authorization: Bearer sk_env_live_4f8a9c2d1e7b6f5a3c9d8e7f6a5b4c3d
Content-Type: application/json
Accept: application/json

Installing the SDK

The official Env SDKs provide a convenient wrapper around the REST API. Install the package for your environment:

bash
# Using pip (Python)
pip install env-sdk

# Using npm (Node.js)
npm install @env/sdk

# Using yarn
yarn add @env/sdk

Core Endpoints

The Env API is organized around REST principles. All endpoints follow the /v2/ versioning scheme.

Method Endpoint Description
GET /v2/emissions Retrieve carbon emission data across scopes
POST /v2/emissions/submit Submit new emission data points
GET /v2/compliance/reports List generated ESG compliance reports
POST /v2/optimization/suggestions Request AI-powered reduction recommendations
Rate Limits: API requests are limited to 1,000 requests per minute for standard plans, and 5,000 requests per minute for enterprise plans. Exceeding limits returns 429 Too Many Requests.

Error Handling

Env uses standard HTTP status codes to indicate success or failure of requests. Error responses include a JSON body with details:

json
{
  "error": {
    "type": "invalid_api_key",
    "message": "The provided API key does not exist or has been revoked.",
    "code": 401,
    "documentation_url": "https://docs.env.io/errors/invalid_api_key"
  }
}

Common Status Codes

  • 200 OK — Request succeeded
  • 400 Bad Request — Invalid parameters or malformed JSON
  • 401 Unauthorized — Missing or invalid API key
  • 403 Forbidden — Insufficient permissions for requested resource
  • 404 Not Found — Resource does not exist
  • 429 Too Many Requests — Rate limit exceeded
  • 500 Internal Server Error — Something went wrong on Env's end