Authentication & Security

Authentication

The ekko REST API is served over HTTPS and follows standard security practices. Requests use resource-oriented URLs, accept JSON-encoded bodies, return JSON responses, and follow conventional HTTP verbs and status codes.

All requests require an API key, which you generate in ekkoHub. Pass the key in the X-Api-Key header on every call:

X-Api-Key: YOUR_API_KEY

Your API key is validated on each request to ensure only authorised access.

⚠️

Keep your API keys safe:

  • Store them securely (for example, in environment variables or a secrets manager)
  • Never expose them in client-side code or public repositories
  • Rotate them regularly on ekko Hub

Error handling

The ekko API uses standard HTTP status codes to indicate success or failure.

ErrorDescription
401 UnauthorisedInvalid or missing X-Api-Key
400 Bad RequestMissing or incorrect parameters
404 Not foundResource not found
500 Internal Server ErrorAn unexpected error on ekko’s side

Error responses include structured details to help you debug:

FieldDescriptionType
statusCodeHTTP status codeInteger
nameSpecific name of the errorString
messageGeneral description of the errorString
detailsAdditional context (validation errors, constraints)Object
details.messageList of validation error messagesArray of strings
details.errorMore specific error categoryString
pathThe endpoint path that failedString
requestIdUnique reference ID for tracing the requestString
timestampWhen the request occurredString

Example errors:

{
    "error": {
        "statusCode": 400,
        "message": "Bad Request Exception",
        "errorName": "BadRequestException",
        "details": {
            "message": [
                "amount.value must be a positive number",
                "amount.value should not be empty",
                "amount.value must be a number conforming to the specified constraints"
            ],
            "error": "Bad Request",
            "statusCode": 400
        },
        "path": "/v2.5/impact_calculator",
        "requestId": "7AkD3H",
        "timestamp": "2025-09-09T16:51:00.789Z"
    }
}
{
    "error": {
        "statusCode": 404,
        "message": "Carbon data not found for MCC: 54992 and country: GBR",
        "errorName": "_NotFoundException",
        "details": "Carbon data not found for MCC: 54992 and country: GBR",
        "path": "/v2.5/impact_calculator",
        "requestId": "qnYFPF",
        "timestamp": "2025-09-09T16:52:10.413Z"
    }
}


IP allowlisting

For additional security, you can restrict access to ekko endpoints using IP allowlisting.

  1. Log into ekko Hub
  2. Go to Console → IP allowlisting
  3. Add one or more IP addresses, ranges, or CIDR blocks
  4. Enable allowlisting using the toggle at the top

Once enabled, only requests from approved IPs will be accepted.

For more detail, see the section on ekko Hub.