CRM
Deals in pipelines, the team's tasks, a customer's timeline and the team members they are assigned to.
The CRM of a store is its deals (sales in progress, each in a stage of a pipeline), the team's tasks (calls, meetings, follow-ups) and each customer's timeline (notes, calls and e-mails the team logged). Deals and tasks belong to someone on the team: a team member.
Endpoints
Paths are relative to https://api.mobiari.com/v1, with the store named
by its key or the Mobiari-Store header, as everywhere in the
API.
| Method | Path | Purpose |
|---|---|---|
GET | /team-members | The store's team: the ids a deal's owner_id and a task's assignee_id take. |
GET, POST | /pipelines | List pipelines with their stages, and create one. |
GET, PATCH | /pipelines/{pipeline_id} | Read a pipeline; rename, archive it (is_archived) or replace its stages. |
GET, POST | /deals | List deals (pipeline_id, stage_id, status, owner, customer_id, company_id, q) and create one. |
GET, PATCH, DELETE | /deals/{deal_id} | Read, change and delete a deal. |
POST | /deals/{deal_id}/stage-changes | Move it to another stage (stage_id, and lost_reason for a lost stage). |
GET, POST | /tasks | List tasks (status, assignee, customer_id, deal_id, order_id, due) and create one. |
GET, PATCH, DELETE | /tasks/{task_id} | Read, change and delete a task. PATCH with done: true completes it. |
GET, POST | /customers/{customer_id}/interactions | A customer's timeline, and a note, call or e-mail to log on it. |
PATCH, DELETE | /customers/{customer_id}/interactions/{interaction_id} | Change or delete an entry the team logged. |
Lists answer a Page.
Deals and their stages
A deal is open, won or lost, as its stage says. Each stage of a
pipeline is of one of those kinds (a pipeline needs at least one open
stage; the store's first one also has a won and a lost stage). Moving a
deal to a won or lost stage closes it (closed_at), and moving it back to an open stage
reopens it. A stage change is its own request, so that it fires its
webhooks:
curl -X POST "https://api.mobiari.com/v1/deals/$DEAL/stage-changes" \
-H "Authorization: Bearer $MOBIARI_KEY" \
-H "Content-Type: application/json" \
-d '{ "stage_id": "'$WON_STAGE'" }'It answers the deal. owner=me in a list means the key's own service
account; owner=unassigned the deals nobody owns.
Webhooks
deals.created, deals.stage_changed, deals.won and deals.lost
carry the Deal as GET /deals/{deal_id} answers it. See
Webhooks.
Permission cheatsheet
| Action | Permission |
|---|---|
| Read pipelines, deals, tasks and timelines | customers.read |
| Create, change, move and delete them | customers.write |
| Log, change and delete timeline entries | customers.manage_interactions |
| List team members | users.read |
A key without the permission answers 403 missing_permission.