API Reference¶
Every endpoint needs an API key sent as Authorization: Bearer <key> (see The API). The key acts as its user: the user needs the permission listed, and a write endpoint needs a key with write access. Bodies and answers are JSON.
| Method | Path | Permission | Writes |
|---|---|---|---|
| GET | /api/v1/accounts |
accounts_view |
No |
| GET | /api/v1/activities |
crm_activities_view |
No |
| POST | /api/v1/activities |
crm_activities_create |
Yes |
| GET | /api/v1/contacts |
contacts_view |
No |
| POST | /api/v1/contacts |
contacts_create |
Yes |
| GET | /api/v1/deals |
crm_deals_view |
No |
| GET | /api/v1/invoices |
journals_view |
No |
| GET | /api/v1/items |
items_view |
No |
| GET | /api/v1/journal-entries |
journals_view |
No |
| POST | /api/v1/journal-entries |
journals_create |
Yes |
| GET | /api/v1/leads |
leads_view |
No |
| POST | /api/v1/leads |
leads_create |
Yes |
GET /api/v1/accounts¶
The Chart of Accounts.
Permission: accounts_view. Defined in api.go.
GET /api/v1/activities¶
Activities, the latest first; ?contact_id= or ?deal_id= narrow them.
Permission: crm_activities_view. Defined in crm_reports.go.
POST /api/v1/activities¶
Logs an activity: {"kind" (call, meeting, email, note or task), "subject", "body", "outcome", "at", "owner", "contact_id", "deal_id", "lead_id", "case_id", "planned"}.
Permission: crm_activities_create. Defined in crm_reports.go.
GET /api/v1/contacts¶
Contacts; ?type=Customer narrows them.
Permission: contacts_view. Defined in api.go.
POST /api/v1/contacts¶
Adds a contact: {"name", "type", "company", "email", "phone", "account_code"} (a customer or vendor needs its receivable or payable account).
Permission: contacts_create. Defined in api.go.
GET /api/v1/deals¶
Deals; ?status=open (or won, lost) and ?owner= narrow them.
Permission: crm_deals_view. Defined in crm_reports.go.
GET /api/v1/invoices¶
Issue Invoices; ?status=open for those with something outstanding.
Permission: journals_view. Defined in api.go.
GET /api/v1/items¶
Inventory items with their stock on hand.
Permission: items_view. Defined in api.go.
GET /api/v1/journal-entries¶
Journal entries with their lines; ?from=&to= (YYYY-MM-DD) and ?type=.
Permission: journals_view. Defined in api.go.
POST /api/v1/journal-entries¶
Adds an entry: {"date", "type", "description", "reference", "contact_id", "currency", "lines": [{"account_code", "description", "debit", "credit"}]}.
Permission: journals_create. Defined in api.go.
GET /api/v1/leads¶
Sales leads; ?source=Website narrows them.
Permission: leads_view. Defined in api.go.
POST /api/v1/leads¶
Adds a lead: {"name", "company", "email", "phone", "source", "status", "owner", "value", "notes", "utm_campaign"} (utm_campaign ties it to the campaign with that UTM campaign).
Permission: leads_create. Defined in api.go.