API Reference

Complete reference for all API endpoints with examples

Customers

GET/api/v1/customers

Get all customers with pagination

curl -X GET https://your-crm.com/api/v1/customers \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}

Get specific customer by ID

curl -X GET https://your-crm.com/api/v1/customers/123 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/customers

Create new customer

curl -X POST https://your-crm.com/api/v1/customers \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"company": "ACME Corp", "email": "contact@acme.com"}'
PUT/api/v1/customers/{id}

Update existing customer

curl -X PUT https://your-crm.com/api/v1/customers/123 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"company": "ACME Corporation"}'
DELETE/api/v1/customers/{id}

Delete customer

curl -X DELETE https://your-crm.com/api/v1/customers/123 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/contacts

List contacts for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/contacts \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/projects

List projects for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/projects \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/invoices

List invoices for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/invoices \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/estimates

List estimates for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/estimates \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/tickets

List tickets for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/tickets \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/customers/{id}/contracts

List contracts for a customer

curl -X GET https://your-crm.com/api/v1/customers/123/contracts \
  -H "X-API-KEY: pk_your_api_key_here"

Tickets

GET/api/v1/tickets

Get all tickets

curl -X GET https://your-crm.com/api/v1/tickets \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/tickets

Create new ticket

curl -X POST https://your-crm.com/api/v1/tickets \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"subject": "API Issue", "message": "Need help with API integration"}'
GET/api/v1/tickets/{id}

Get ticket details by ID

curl -X GET https://your-crm.com/api/v1/tickets/456 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/tickets/{id}

Update an existing ticket

curl -X PUT https://your-crm.com/api/v1/tickets/456 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"subject": "Updated Subject", "priority": 2}'
DELETE/api/v1/tickets/{id}

Delete a ticket

curl -X DELETE https://your-crm.com/api/v1/tickets/456 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tickets/{id}/replies

List replies for a ticket

curl -X GET https://your-crm.com/api/v1/tickets/456/replies \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tickets/{id}/attachments

List attachments for a ticket

curl -X GET https://your-crm.com/api/v1/tickets/456/attachments \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/tickets/{id}/assign

Assign ticket to a staff member

curl -X POST https://your-crm.com/api/v1/tickets/456/assign \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"staff_id": 5}'
PUT/api/v1/tickets/{id}/status

Update ticket status

curl -X PUT https://your-crm.com/api/v1/tickets/456/status \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status": "resolved"}'
GET/api/v1/tickets/{id}/history

Get ticket activity history

curl -X GET https://your-crm.com/api/v1/tickets/456/history \
  -H "X-API-KEY: pk_your_api_key_here"

Invoices

GET/api/v1/invoices

Get all invoices

curl -X GET https://your-crm.com/api/v1/invoices \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/invoices

Create new invoice

curl -X POST https://your-crm.com/api/v1/invoices \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"customer_id": 123, "total": 1500.00}'
GET/api/v1/invoices/{id}/payments

List payments for an invoice

curl -X GET https://your-crm.com/api/v1/invoices/789/payments \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/invoices/{id}/pdf

Download invoice as PDF

curl -X GET https://your-crm.com/api/v1/invoices/789/pdf \
  -H "X-API-KEY: pk_your_api_key_here" \
  -o invoice.pdf
POST/api/v1/invoices/{id}/send

Send invoice to customer via email

curl -X POST https://your-crm.com/api/v1/invoices/789/send \
  -H "X-API-KEY: pk_your_api_key_here"

Leads

GET/api/v1/leads

List all leads with pagination

curl -X GET https://your-crm.com/api/v1/leads \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/leads

Create a new lead

curl -X POST https://your-crm.com/api/v1/leads \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "John Doe", "email": "john@example.com", "company": "ACME Corp", "source": "website", "status": 1, "assigned": 5}'
GET/api/v1/leads/{id}

Get lead details by ID

curl -X GET https://your-crm.com/api/v1/leads/42 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/leads/{id}

Update an existing lead

curl -X PUT https://your-crm.com/api/v1/leads/42 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status": 2, "company": "ACME Corporation"}'
DELETE/api/v1/leads/{id}

Delete a lead

curl -X DELETE https://your-crm.com/api/v1/leads/42 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/leads/{id}/convert

Convert lead to customer

curl -X POST https://your-crm.com/api/v1/leads/42/convert \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/leads/{id}/activities

List activities for a lead

curl -X GET https://your-crm.com/api/v1/leads/42/activities \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/leads/{id}/notes

List notes for a lead

curl -X GET https://your-crm.com/api/v1/leads/42/notes \
  -H "X-API-KEY: pk_your_api_key_here"

Projects

GET/api/v1/projects

List all projects with pagination

curl -X GET https://your-crm.com/api/v1/projects \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/projects

Create a new project

curl -X POST https://your-crm.com/api/v1/projects \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Website Redesign", "clientid": 123, "billing_type": 1, "start_date": "2026-03-01", "deadline": "2026-06-30", "description": "Complete website overhaul"}'
GET/api/v1/projects/{id}

Get project details by ID

curl -X GET https://your-crm.com/api/v1/projects/15 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/projects/{id}

Update an existing project

curl -X PUT https://your-crm.com/api/v1/projects/15 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"deadline": "2026-07-31", "description": "Updated project scope"}'
DELETE/api/v1/projects/{id}

Delete a project

curl -X DELETE https://your-crm.com/api/v1/projects/15 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/projects/{id}/tasks

List tasks for a project

curl -X GET https://your-crm.com/api/v1/projects/15/tasks \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/projects/{id}/milestones

List milestones for a project

curl -X GET https://your-crm.com/api/v1/projects/15/milestones \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/projects/{id}/files

List files for a project

curl -X GET https://your-crm.com/api/v1/projects/15/files \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/projects/{id}/discussions

List discussions for a project

curl -X GET https://your-crm.com/api/v1/projects/15/discussions \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/projects/{id}/activity

Get project activity feed

curl -X GET https://your-crm.com/api/v1/projects/15/activity \
  -H "X-API-KEY: pk_your_api_key_here"

Contracts

GET/api/v1/contracts

List all contracts with pagination

curl -X GET https://your-crm.com/api/v1/contracts \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/contracts

Create a new contract

curl -X POST https://your-crm.com/api/v1/contracts \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"client": 123, "subject": "Annual Support", "contract_type": 1, "datestart": "2026-01-01", "dateend": "2026-12-31", "contract_value": 12000.00}'
GET/api/v1/contracts/{id}

Get contract details by ID

curl -X GET https://your-crm.com/api/v1/contracts/8 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/contracts/{id}

Update an existing contract

curl -X PUT https://your-crm.com/api/v1/contracts/8 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"contract_value": 15000.00, "dateend": "2027-03-31"}'
DELETE/api/v1/contracts/{id}

Delete a contract

curl -X DELETE https://your-crm.com/api/v1/contracts/8 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contracts/expiring

List contracts that are about to expire

curl -X GET https://your-crm.com/api/v1/contracts/expiring \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contracts/expired

List expired contracts

curl -X GET https://your-crm.com/api/v1/contracts/expired \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/contracts/{id}/renew

Renew an existing contract

curl -X POST https://your-crm.com/api/v1/contracts/8/renew \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"dateend": "2027-12-31"}'
POST/api/v1/contracts/{id}/sign

Sign a contract

curl -X POST https://your-crm.com/api/v1/contracts/8/sign \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contracts/{id}/attachments

List attachments for a contract

curl -X GET https://your-crm.com/api/v1/contracts/8/attachments \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contracts/{id}/comments

List comments for a contract

curl -X GET https://your-crm.com/api/v1/contracts/8/comments \
  -H "X-API-KEY: pk_your_api_key_here"

Expenses

GET/api/v1/expenses

List all expenses with pagination

curl -X GET https://your-crm.com/api/v1/expenses \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/expenses

Create a new expense

curl -X POST https://your-crm.com/api/v1/expenses \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"category": 3, "amount": 250.00, "currency": "USD", "date": "2026-02-10", "clientid": 123, "note": "Office supplies"}'
GET/api/v1/expenses/{id}

Get expense details by ID

curl -X GET https://your-crm.com/api/v1/expenses/55 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/expenses/{id}

Update an existing expense

curl -X PUT https://your-crm.com/api/v1/expenses/55 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"amount": 275.00, "note": "Office supplies - updated receipt"}'
DELETE/api/v1/expenses/{id}

Delete an expense

curl -X DELETE https://your-crm.com/api/v1/expenses/55 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/expenses/categories

List all expense categories

curl -X GET https://your-crm.com/api/v1/expenses/categories \
  -H "X-API-KEY: pk_your_api_key_here"

Estimates

GET/api/v1/estimates

List all estimates with pagination

curl -X GET https://your-crm.com/api/v1/estimates \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/estimates

Create a new estimate

curl -X POST https://your-crm.com/api/v1/estimates \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"clientid": 123, "number": "EST-001", "date": "2026-02-10", "expirydate": "2026-03-10", "items": [{"description": "Consulting", "qty": 10, "rate": 150}], "status": 1}'
GET/api/v1/estimates/{id}

Get estimate details by ID

curl -X GET https://your-crm.com/api/v1/estimates/20 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/estimates/{id}

Update an existing estimate

curl -X PUT https://your-crm.com/api/v1/estimates/20 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status": 2, "expirydate": "2026-04-10"}'
DELETE/api/v1/estimates/{id}

Delete an estimate

curl -X DELETE https://your-crm.com/api/v1/estimates/20 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/estimates/{id}/send

Send estimate to customer via email

curl -X POST https://your-crm.com/api/v1/estimates/20/send \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/estimates/{id}/convert

Convert estimate to invoice

curl -X POST https://your-crm.com/api/v1/estimates/20/convert \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/estimates/{id}/pdf

Download estimate as PDF

curl -X GET https://your-crm.com/api/v1/estimates/20/pdf \
  -H "X-API-KEY: pk_your_api_key_here" \
  -o estimate.pdf

Tasks

GET/api/v1/tasks

List all tasks with pagination

curl -X GET https://your-crm.com/api/v1/tasks \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/tasks

Create a new task

curl -X POST https://your-crm.com/api/v1/tasks \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Review proposal", "startdate": "2026-02-10", "duedate": "2026-02-15", "priority": 2, "rel_type": "project", "rel_id": 15, "assignees": [1, 5]}'
GET/api/v1/tasks/{id}

Get task details by ID

curl -X GET https://your-crm.com/api/v1/tasks/100 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/tasks/{id}

Update an existing task

curl -X PUT https://your-crm.com/api/v1/tasks/100 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"priority": 1, "duedate": "2026-02-20"}'
DELETE/api/v1/tasks/{id}

Delete a task

curl -X DELETE https://your-crm.com/api/v1/tasks/100 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tasks/{id}/timesheets

List timesheets for a task

curl -X GET https://your-crm.com/api/v1/tasks/100/timesheets \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tasks/{id}/comments

List comments for a task

curl -X GET https://your-crm.com/api/v1/tasks/100/comments \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/tasks/{id}/assign

Assign task to a staff member

curl -X POST https://your-crm.com/api/v1/tasks/100/assign \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"staff_id": 5}'
PUT/api/v1/tasks/{id}/status

Update task status

curl -X PUT https://your-crm.com/api/v1/tasks/100/status \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status": 4}'
POST/api/v1/tasks/{id}/mark-complete

Mark task as complete

curl -X POST https://your-crm.com/api/v1/tasks/100/mark-complete \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tasks/{id}/attachments

List attachments for a task

curl -X GET https://your-crm.com/api/v1/tasks/100/attachments \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/tasks/{id}/checklist

List checklist items for a task

curl -X GET https://your-crm.com/api/v1/tasks/100/checklist \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/tasks/{id}/priority

Set task priority

curl -X PUT https://your-crm.com/api/v1/tasks/100/priority \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"priority": 1}'
GET/api/v1/tasks/{id}/followers

List followers for a task

curl -X GET https://your-crm.com/api/v1/tasks/100/followers \
  -H "X-API-KEY: pk_your_api_key_here"

Staff

GET/api/v1/staff

List all staff members

curl -X GET https://your-crm.com/api/v1/staff \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/staff

Create a new staff member

curl -X POST https://your-crm.com/api/v1/staff \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"firstname": "Jane", "lastname": "Smith", "email": "jane@company.com", "password": "securePass123"}'
GET/api/v1/staff/{id}

Get staff member details by ID

curl -X GET https://your-crm.com/api/v1/staff/5 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/staff/{id}

Update a staff member

curl -X PUT https://your-crm.com/api/v1/staff/5 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"firstname": "Jane", "lastname": "Smith", "email": "jane@company.com"}'
DELETE/api/v1/staff/{id}

Delete a staff member

curl -X DELETE https://your-crm.com/api/v1/staff/5 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/staff/roles

List all staff roles

curl -X GET https://your-crm.com/api/v1/staff/roles \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/staff/departments

List all departments

curl -X GET https://your-crm.com/api/v1/staff/departments \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/staff/{id}/permissions

Get permissions for a staff member

curl -X GET https://your-crm.com/api/v1/staff/5/permissions \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/staff/{id}/tasks

List tasks assigned to a staff member

curl -X GET https://your-crm.com/api/v1/staff/5/tasks \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/staff/{id}/timesheets

List timesheets for a staff member

curl -X GET https://your-crm.com/api/v1/staff/5/timesheets \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/staff/{id}/change-password

Change staff member password

curl -X POST https://your-crm.com/api/v1/staff/5/change-password \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"password": "newSecurePass456"}'
POST/api/v1/staff/{id}/activate

Activate a staff member

curl -X POST https://your-crm.com/api/v1/staff/5/activate \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/staff/{id}/deactivate

Deactivate a staff member

curl -X POST https://your-crm.com/api/v1/staff/5/deactivate \
  -H "X-API-KEY: pk_your_api_key_here"

Proposals

GET/api/v1/proposals

List all proposals with pagination

curl -X GET https://your-crm.com/api/v1/proposals \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/proposals

Create a new proposal

curl -X POST https://your-crm.com/api/v1/proposals \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"subject": "Website Development Proposal", "rel_type": "customer", "rel_id": 123, "date": "2026-02-10", "open_till": "2026-03-10", "content": "<p>Proposal details here</p>"}'
GET/api/v1/proposals/{id}

Get proposal details by ID

curl -X GET https://your-crm.com/api/v1/proposals/7 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/proposals/{id}

Update an existing proposal

curl -X PUT https://your-crm.com/api/v1/proposals/7 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"subject": "Updated Proposal", "open_till": "2026-04-10"}'
DELETE/api/v1/proposals/{id}

Delete a proposal

curl -X DELETE https://your-crm.com/api/v1/proposals/7 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/proposals/{id}/send

Send proposal to customer via email

curl -X POST https://your-crm.com/api/v1/proposals/7/send \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/proposals/{id}/accept

Accept a proposal

curl -X POST https://your-crm.com/api/v1/proposals/7/accept \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/proposals/{id}/decline

Decline a proposal

curl -X POST https://your-crm.com/api/v1/proposals/7/decline \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/proposals/{id}/pdf

Download proposal as PDF

curl -X GET https://your-crm.com/api/v1/proposals/7/pdf \
  -H "X-API-KEY: pk_your_api_key_here" \
  -o proposal.pdf
GET/api/v1/proposals/{id}/comments

List comments for a proposal

curl -X GET https://your-crm.com/api/v1/proposals/7/comments \
  -H "X-API-KEY: pk_your_api_key_here"

Subscriptions

GET/api/v1/subscriptions

List all subscriptions

curl -X GET https://your-crm.com/api/v1/subscriptions \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/subscriptions

Create a new subscription

curl -X POST https://your-crm.com/api/v1/subscriptions \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Monthly Support Plan", "clientid": 123, "quantity": 1, "date": "2026-02-10"}'
GET/api/v1/subscriptions/{id}

Get subscription details by ID

curl -X GET https://your-crm.com/api/v1/subscriptions/10 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/subscriptions/{id}

Update an existing subscription

curl -X PUT https://your-crm.com/api/v1/subscriptions/10 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"quantity": 2, "name": "Monthly Support Plan - Updated"}'
DELETE/api/v1/subscriptions/{id}

Delete a subscription

curl -X DELETE https://your-crm.com/api/v1/subscriptions/10 \
  -H "X-API-KEY: pk_your_api_key_here"

Credit Notes

GET/api/v1/credit-notes

List all credit notes

curl -X GET https://your-crm.com/api/v1/credit-notes \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/credit-notes

Create a new credit note

curl -X POST https://your-crm.com/api/v1/credit-notes \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"clientid": 123, "number": "CN-001", "date": "2026-02-10", "items": [{"description": "Refund for service", "qty": 1, "rate": 500}]}'
GET/api/v1/credit-notes/{id}

Get credit note details by ID

curl -X GET https://your-crm.com/api/v1/credit-notes/3 \
  -H "X-API-KEY: pk_your_api_key_here"
PUT/api/v1/credit-notes/{id}

Update an existing credit note

curl -X PUT https://your-crm.com/api/v1/credit-notes/3 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"status": 2}'
DELETE/api/v1/credit-notes/{id}

Delete a credit note

curl -X DELETE https://your-crm.com/api/v1/credit-notes/3 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/credit-notes/{id}/refunds

List refunds for a credit note

curl -X GET https://your-crm.com/api/v1/credit-notes/3/refunds \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/credit-notes/{id}/credits

List applied credits for a credit note

curl -X GET https://your-crm.com/api/v1/credit-notes/3/credits \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/credit-notes/{id}/pdf

Download credit note as PDF

curl -X GET https://your-crm.com/api/v1/credit-notes/3/pdf \
  -H "X-API-KEY: pk_your_api_key_here" \
  -o credit-note.pdf

Payments

GET/api/v1/payments

List all payments with pagination. Filterable by invoice_id, customer_id, date_from, date_to, payment_mode

curl -X GET "https://your-crm.com/api/v1/payments?invoice_id=789" \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/payments/{id}

Get payment record details by ID

curl -X GET https://your-crm.com/api/v1/payments/30 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/payments

Create a new payment record. Required: invoiceid, amount, date. Automatically updates invoice paid status

curl -X POST https://your-crm.com/api/v1/payments \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"invoiceid": 789, "amount": 500.00, "date": "2026-02-10", "paymentmode": "bank_transfer"}'
PUT/api/v1/payments/{id}

Update an existing payment record

curl -X PUT https://your-crm.com/api/v1/payments/30 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"amount": 550.00, "note": "Updated payment amount"}'
DELETE/api/v1/payments/{id}

Delete a payment record. Automatically updates invoice paid status

curl -X DELETE https://your-crm.com/api/v1/payments/30 \
  -H "X-API-KEY: pk_your_api_key_here"

Items

GET/api/v1/items

List all items/products with pagination. Filterable by group_id, search

curl -X GET "https://your-crm.com/api/v1/items?group_id=2" \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/items/{id}

Get item details by ID

curl -X GET https://your-crm.com/api/v1/items/25 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/items

Create a new item. Required: description (item name), rate

curl -X POST https://your-crm.com/api/v1/items \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"description": "Consulting Hour", "rate": 150.00, "group_id": 2, "unit": "hour"}'
PUT/api/v1/items/{id}

Update an existing item

curl -X PUT https://your-crm.com/api/v1/items/25 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"rate": 175.00, "description": "Senior Consulting Hour"}'
DELETE/api/v1/items/{id}

Delete an item

curl -X DELETE https://your-crm.com/api/v1/items/25 \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/items/groups

List all item groups

curl -X GET https://your-crm.com/api/v1/items/groups \
  -H "X-API-KEY: pk_your_api_key_here"

Contacts

GET/api/v1/contacts

List all contacts with pagination. Filterable by customer_id, active, search, is_primary

curl -X GET "https://your-crm.com/api/v1/contacts?customer_id=123" \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contacts/{id}

Get contact details by ID

curl -X GET https://your-crm.com/api/v1/contacts/45 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/contacts

Create a new contact. Required: userid (customer_id), firstname, lastname, email. Email must be unique per customer

curl -X POST https://your-crm.com/api/v1/contacts \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"userid": 123, "firstname": "Jane", "lastname": "Smith", "email": "jane@acme.com", "phonenumber": "+1234567890"}'
PUT/api/v1/contacts/{id}

Update an existing contact

curl -X PUT https://your-crm.com/api/v1/contacts/45 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"phonenumber": "+0987654321", "title": "CTO"}'
DELETE/api/v1/contacts/{id}

Delete a contact. Primary contacts cannot be deleted

curl -X DELETE https://your-crm.com/api/v1/contacts/45 \
  -H "X-API-KEY: pk_your_api_key_here"

Timesheets

GET/api/v1/timesheets

List all timesheet entries with pagination. Filterable by task_id, staff_id, date_from, date_to

curl -X GET "https://your-crm.com/api/v1/timesheets?staff_id=5" \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/timesheets/{id}

Get timesheet entry details by ID

curl -X GET https://your-crm.com/api/v1/timesheets/88 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/timesheets

Create a new timesheet entry. Required: task_id, staff_id, start_time. Supports running timers (omit end_time)

curl -X POST https://your-crm.com/api/v1/timesheets \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"task_id": 100, "staff_id": 5, "start_time": "2026-02-10 09:00:00", "end_time": "2026-02-10 12:30:00"}'
PUT/api/v1/timesheets/{id}

Update an existing timesheet entry

curl -X PUT https://your-crm.com/api/v1/timesheets/88 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"end_time": "2026-02-10 13:00:00", "note": "Extended session"}'
DELETE/api/v1/timesheets/{id}

Delete a timesheet entry

curl -X DELETE https://your-crm.com/api/v1/timesheets/88 \
  -H "X-API-KEY: pk_your_api_key_here"

Notes

GET/api/v1/notes

List all notes with pagination. Filterable by rel_type, rel_id, staff_id, date_from, date_to

curl -X GET "https://your-crm.com/api/v1/notes?rel_type=customer&rel_id=123" \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/notes/{id}

Get note details by ID

curl -X GET https://your-crm.com/api/v1/notes/200 \
  -H "X-API-KEY: pk_your_api_key_here"
POST/api/v1/notes

Create a new note. Required: rel_type, rel_id, description. Valid rel_types: customer, lead, invoice, estimate, contract, proposal, project, task, expense, staff

curl -X POST https://your-crm.com/api/v1/notes \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"rel_type": "customer", "rel_id": 123, "description": "Follow up about renewal next week"}'
PUT/api/v1/notes/{id}

Update an existing note. Cannot change rel_type or rel_id after creation

curl -X PUT https://your-crm.com/api/v1/notes/200 \
  -H "X-API-KEY: pk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"description": "Updated: Follow up completed, renewal confirmed"}'
DELETE/api/v1/notes/{id}

Delete a note

curl -X DELETE https://your-crm.com/api/v1/notes/200 \
  -H "X-API-KEY: pk_your_api_key_here"

Utilities

GET/api/v1/currencies

List all available currencies

curl -X GET https://your-crm.com/api/v1/currencies \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/taxes

List all tax rates

curl -X GET https://your-crm.com/api/v1/taxes \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/payment-modes

List all payment methods

curl -X GET https://your-crm.com/api/v1/payment-modes \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/countries

List all countries

curl -X GET https://your-crm.com/api/v1/countries \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/departments

List all departments

curl -X GET https://your-crm.com/api/v1/departments \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/ticket-statuses

List all ticket statuses

curl -X GET https://your-crm.com/api/v1/ticket-statuses \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/ticket-priorities

List all ticket priorities

curl -X GET https://your-crm.com/api/v1/ticket-priorities \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/lead-statuses

List all lead statuses

curl -X GET https://your-crm.com/api/v1/lead-statuses \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/lead-sources

List all lead sources

curl -X GET https://your-crm.com/api/v1/lead-sources \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/contract-types

List all contract types

curl -X GET https://your-crm.com/api/v1/contract-types \
  -H "X-API-KEY: pk_your_api_key_here"
GET/api/v1/item-groups

List all item groups

curl -X GET https://your-crm.com/api/v1/item-groups \
  -H "X-API-KEY: pk_your_api_key_here"

Authentication

API Key Authentication

Include your API key in the X-API-KEY header:

X-API-KEY: pk_your_api_key_here

JWT Authentication

Include JWT token in Authorization header:

Authorization: Bearer your_jwt_token

Response Codes

CodeDescription
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing authentication
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Server Error - Internal server error