Skip to main content
The EarthCoop REST API gives you programmatic access to the platform’s core features — including the NajmHoda AI assistant, support tickets, geographic hierarchy data, and user notifications. Every response is JSON, and authentication is handled via Bearer tokens passed in the Authorization header.

Base URL

All API endpoints are served under the following base URL:
Replace your-domain.com with your actual EarthCoop deployment host. There is no versioning prefix in the path; routes are mounted directly under /api.

Response Format

Every response body is JSON. Successful responses typically include a top-level success: true field alongside the payload. Collection responses include a data array and a meta object containing pagination details.

Authentication

Protected endpoints require a Bearer token in the Authorization header. See the Authentication page for full details on obtaining and using tokens.
Requests to protected endpoints without a valid token receive a 401 Unauthorized response.

Rate Limiting

Most endpoints have no explicit rate limit beyond standard platform defaults. The escalation endpoint is strictly throttled to prevent abuse: Exceeding the limit returns 429 Too Many Requests. Your client should respect the Retry-After header in that response.
If your integration calls POST /api/najm-hoda/escalate in a loop or on every user action, you will hit the 30 requests/minute ceiling quickly. Cache or debounce calls appropriately.

Error Format

The API uses standard HTTP status codes to signal outcomes. Error bodies are JSON objects with at least a message field, and in validation failures an errors object keyed by field name. Unauthenticated request:
Validation failure (422):

Common HTTP Status Codes

API Sections

Authentication

Learn how to obtain a Bearer token and authenticate every request.

NajmHoda API

AI chat, conversation history, feedback, and escalation endpoints.

Tickets API

Create and manage support tickets, add comments, and download attachments.

Geographic API

Public endpoints for provinces, counties, cities, and the full geographic hierarchy.

Notifications API

Fetch, mark as read, and delete user notifications for projects and investments.