API Overview
HARi CRM exposes a full REST API for integration and automation.
Base URL
Section titled “Base URL”https://<your-workspace>.haricrm.com/apiAuthentication
Section titled “Authentication”All API requests require a Bearer token:
# Logincurl -X POST https://acme.haricrm.com/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "you@company.com", "password": "your-password"}'
# Response{ "access_token": "eyJ...", "refresh_token": "abc...", "expires_in": 3600}
# Use the tokencurl https://acme.haricrm.com/api/records/contact \ -H "Authorization: Bearer eyJ..."API Keys
Section titled “API Keys”For server-to-server integration, create an API key in Settings:
curl https://acme.haricrm.com/api/records/contact \ -H "Authorization: Bearer hari_a1b2c3..."API keys use the hari_ prefix and have the same permissions as the user who created them.
OpenAPI Specification
Section titled “OpenAPI Specification”The full API spec is available at:
GET /api/openapiThis returns the OpenAPI 3.0 JSON with all 233 endpoints documented. Use it with Swagger UI, Postman, or any OpenAPI-compatible tool.
Schema Discovery
Section titled “Schema Discovery”For AI agents and CLI tools:
GET /api/schema/endpointsReturns a condensed map of all endpoints with method, path, summary, and body schema.
Data API (TreeQL)
Section titled “Data API (TreeQL)”CRUD operations on any entity:
# List recordsGET /api/records/{entity}?page=1&page_size=25
# Get one recordGET /api/records/{entity}/{id}
# CreatePOST /api/records/{entity}Body: { "field": "value", ... }
# UpdatePUT /api/records/{entity}/{id}Body: { "field": "new_value" }
# DeleteDELETE /api/records/{entity}/{id}Filtering
Section titled “Filtering”# Single filterGET /api/records/contact?filter=source,eq,website
# Multiple filtersGET /api/records/contact?filter=source,eq,website&filter1=_score,gt,20
# Operators: eq, neq, gt, gte, lt, lte, cs (contains), sw (starts with)Sorting
Section titled “Sorting”GET /api/records/contact?sort=created_at,descIncluding related data
Section titled “Including related data”GET /api/records/contact?include=first_name,last_name,email_address,company_idWebhooks
Section titled “Webhooks”Subscribe to events for real-time notifications:
# SubscribePOST /api/webhooks/subscribe{ "target_url": "https://hooks.zapier.com/...", "entity": "contact", "event": "post_save"}
# Events: pre_save, post_save, pre_delete, post_deleteRate Limits
Section titled “Rate Limits”- Authenticated requests: 300/minute
- Login attempts: 5 per email per 15 minutes
- Bulk operations: 20/minute