Back to Documentation
Documentation / API Reference / REST API

REST API Documentation

Complete REST API reference for CognexiaAI ERP platform

Base URL

https://api.cognexiaai.com/v1

Authentication

All API requests require authentication using Bearer tokens:

Authorization Header
curl -X GET https://api.cognexiaai.com/v1/crm/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Get API Key: Navigate to Settings → API Keys in your dashboard to generate keys.

CRM Endpoints

List Contacts

GET/crm/contacts
curl -X GET "https://api.cognexiaai.com/v1/crm/contacts?page=1&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200 OK):

{
  "data": [
    {
      "id": "cnt_123",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john@example.com",
      "company": "Acme Corp",
      "createdAt": "2026-01-15T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 100,
    "pages": 2
  }
}

Create Contact

POST/crm/contacts
curl -X POST https://api.cognexiaai.com/v1/crm/contacts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane@example.com",
    "company": "Tech Inc",
    "phone": "+1-555-0123",
    "tags": ["lead", "enterprise"]
  }'

Response (201 Created):

{
  "id": "cnt_124",
  "firstName": "Jane",
  "lastName": "Smith",
  "email": "jane@example.com",
  "company": "Tech Inc",
  "phone": "+1-555-0123",
  "tags": ["lead", "enterprise"],
  "createdAt": "2026-01-29T15:30:00Z"
}

Update Contact

PUT/crm/contacts/:id
curl -X PUT https://api.cognexiaai.com/v1/crm/contacts/cnt_124 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "company": "Tech Industries Inc",
    "tags": ["customer", "enterprise"]
  }'

Delete Contact

DELETE/crm/contacts/:id
curl -X DELETE https://api.cognexiaai.com/v1/crm/contacts/cnt_124 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (204 No Content)

HR Endpoints

GET/hr/employees
List all employees
POST/hr/employees
Create employee
GET/hr/attendance
Get attendance records

Error Responses

400 Bad Request

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Email is required",
    "field": "email"
  }
}

401 Unauthorized

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API key"
  }
}

429 Rate Limit

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests",
    "retryAfter": 60
  }
}

Next Steps