Endpoints
| Method | Path | Description |
|---|
GET | /api/accounts/ | List accounts |
POST | /api/accounts/ | Create an account |
GET | /api/accounts/{id}/ | Get an account |
PATCH | /api/accounts/{id}/ | Update an account |
DELETE | /api/accounts/{id}/ | Delete an account |
GET | /api/accounts/{id}/contacts/ | List contacts for an account |
List Accounts
GET /api/accounts/
Authorization: Bearer <token>
Query Parameters:
| Parameter | Type | Description |
|---|
page | integer | Page number |
limit | integer | Results per page (max: 100) |
stage | string | Filter by account stage |
industry | string | Filter by industry |
assignedTo | string | Filter by assigned user ID |
search | string | Search by company name or website |
Response:
{
"count": 34,
"next": null,
"previous": null,
"results": [
{
"id": "acc_01HX...",
"name": "Acme Corp",
"website": "https://acme.com",
"industry": "Manufacturing",
"companySize": "51-200",
"stage": "customer",
"assignedTo": "usr_01HX...",
"contactCount": 5,
"openOpportunityCount": 2,
"createdAt": "2024-11-01T09:00:00Z",
"updatedAt": "2025-03-18T16:45:00Z"
}
]
}
Create an Account
POST /api/accounts/
Authorization: Bearer <token>
Content-Type: application/json
Request body:
{
"name": "TechCorp Inc",
"website": "https://techcorp.com",
"industry": "Software",
"companySize": "201-500",
"annualRevenue": 15000000,
"stage": "prospect",
"phone": "+15551234567",
"billingAddress": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postalCode": "94107",
"country": "US"
},
"assignedTo": "usr_01HX...",
"tags": ["enterprise", "saas"],
"description": "Enterprise SaaS company focused on data analytics"
}
Required fields: name
Response: 201 Created
Get an Account
GET /api/accounts/{id}/
Authorization: Bearer <token>
Response:
{
"id": "acc_01HX...",
"name": "TechCorp Inc",
"website": "https://techcorp.com",
"industry": "Software",
"companySize": "201-500",
"annualRevenue": 15000000,
"stage": "prospect",
"phone": "+15551234567",
"billingAddress": {
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postalCode": "94107",
"country": "US"
},
"assignedTo": "usr_01HX...",
"assignedToName": "Alex Johnson",
"tags": ["enterprise", "saas"],
"description": "Enterprise SaaS company focused on data analytics",
"contactCount": 0,
"openOpportunityCount": 0,
"openCaseCount": 0,
"createdAt": "2025-03-15T14:00:00Z",
"updatedAt": "2025-03-15T14:00:00Z"
}
Update an Account
PATCH /api/accounts/{id}/
Authorization: Bearer <token>
Content-Type: application/json
Example:
{
"stage": "active",
"industry": "FinTech"
}
Response: 200 OK with the updated account object.
Delete an Account
DELETE /api/accounts/{id}/
Authorization: Bearer <token>
Response: 204 No Content
Deleting an account does not delete linked contacts, opportunities, or cases. Those records remain in the CRM but lose their account association. To fully clean up, delete the linked records first.
GET /api/accounts/{id}/contacts/
Authorization: Bearer <token>
Returns all contacts linked to the specified account.
Response:
{
"count": 3,
"results": [
{
"id": "cnt_01HX...",
"firstName": "John",
"lastName": "Smith",
"email": "[email protected]",
"title": "VP of Engineering",
"stage": "customer"
}
]
}
Account Stage Values
| Value | Label |
|---|
prospect | Prospect |
active | Active |
customer | Customer |
partner | Partner |
churned | Churned |