Skip to main content

Overview

The Contacts API provides endpoints for managing people (contacts) associated with companies in your CRM. Base Path: /api/contacts

Endpoints

List Contacts

GET /api/contacts
Query Parameters:
ParameterTypeDescription
pageintegerPage number (default: 1)
page_sizeintegerItems per page (default: 20)
company_idUUIDFilter by company
searchstringSearch by name, email, role
rolestringFilter by role
Example:
curl -H "Authorization: Bearer TOKEN" \
  "http://localhost:8000/api/contacts?company_id=550e8400-e29b-41d4-a716-446655440000"
Response:
{
  "data": [
    {
      "id": "dd0e8400-e29b-41d4-a716-446655440888",
      "name": "John Doe",
      "email": "john@acmecorp.com",
      "phone": "+1 (555) 123-4567",
      "role": "CEO",
      "company_id": "550e8400-e29b-41d4-a716-446655440000",
      "company_name": "Acme Corp",
      "linkedin": "https://linkedin.com/in/johndoe",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 12,
  "page": 1,
  "page_size": 20
}

Create Contact

POST /api/contacts
Request Body:
{
  "name": "Jane Smith",
  "email": "jane@techstart.com",
  "phone": "+1 (555) 987-6543",
  "role": "CTO",
  "company_id": "660e8400-e29b-41d4-a716-446655440111",
  "linkedin": "https://linkedin.com/in/janesmith"
}
Response (201 Created):
{
  "id": "ee0e8400-e29b-41d4-a716-446655440999",
  "name": "Jane Smith",
  "email": "jane@techstart.com",
  "phone": "+1 (555) 987-6543",
  "role": "CTO",
  "company_id": "660e8400-e29b-41d4-a716-446655440111",
  "linkedin": "https://linkedin.com/in/janesmith",
  "created_at": "2024-01-22T11:00:00Z"
}

Update Contact

PATCH /api/contacts/{contact_id}

Delete Contact

DELETE /api/contacts/{contact_id}

Next Steps