Skip to main content

Overview

The Zarna API is a comprehensive REST API built with FastAPI, providing endpoints for CRM operations, document processing, AI-powered analysis, and external integrations.

Base URL

http://localhost:8000

Authentication

All API endpoints (except /health) require JWT authentication.

Obtaining an Access Token

POST /api/auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "your-password"
}
Response:
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "user": {
    "id": "uuid",
    "email": "user@example.com",
    "name": "John Doe"
  }
}

Using the Token

Include the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN" \
  http://localhost:8000/api/companies

API Structure

The API is organized into logical domains:

CRM

Companies, Contacts, Deals, Interactions, Financials, Notes

File Management

Files, Drive, SharePoint, Egnyte, Basecamp

Communication

Emails, Email Bot, Calendar

AI & Analytics

Reports, Sourcing, Agentic Chat

Request Format

All requests should include:
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

Response Format

Success Response

{
  "id": "uuid",
  "name": "Acme Corp",
  "created_at": "2024-01-15T10:30:00Z"
}

Error Response

{
  "detail": "Company not found"
}

Interactive Documentation

Explore the API interactively:

Next Steps