HTTP Status Codes


Edgecom APIs use standard HTTP status codes and a consistent error response format across all products.

HTTP Status Codes

CodeTypeDescription
200OKRequest succeeded
400Bad RequestInvalid parameters — e.g. end before start, or missing required field
401UnauthorizedMissing or invalid API key / JWT token
404Not FoundThe requested resource does not exist
429Too Many RequestsRate limit exceeded — slow down and retry
500Internal Server ErrorUnexpected server error. Contact support if this persists

Error Response Format

All errors across pTrack, DRMS, and dataTrack return the same JSON structure:

{
  "error": {
    "code": "bad_request",
    "message": "end must be after start",
    "details": {}
  }
}
FieldDescription
codeMachine-readable identifier — use this for programmatic error handling
messageHuman-readable description — useful for logging and debugging
detailsOptional object with additional context, e.g. field-level validation errors

Common 400 Errors

Most 400 Bad Request errors from pTrack involve datetime parameters:

# ❌ end is before start
?start=2026-07-02T00:00:00-05:00&end=2026-07-01T00:00:00-05:00

# ❌ Missing required parameter (end is required)
?start=2026-07-01T00:00:00-05:00

# ❌ Invalid resolution value
?resolution=15m  # valid values: hourly, five_minute

# ✅ Correct
?start=2026-07-01T00:00:00-05:00&end=2026-07-02T00:00:00-05:00&resolution=hourly

Rate Limiting

If you exceed the allowed request rate, the API returns 429 Too Many Requests. Implement exponential backoff when retrying:

import time, requests

def fetch_with_retry(url, headers, max_retries=4):
    for attempt in range(max_retries):
        r = requests.get(url, headers=headers)
        if r.status_code == 429:
            time.sleep(2 ** attempt)  # 1s, 2s, 4s, 8s
            continue
        return r
    raise Exception("Rate limit exceeded after retries")
📬

Need a higher rate limit? Contact us at [email protected]