> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CRM and Calendar

> A company's clients, their timelines, and its meetings.

A company's clients and its meetings, kept by its agents and open to a person. Every route takes `agents:write`, the reads too.

## Contacts

A contact has a `name`, `company`, `email`, `phone`, `stage` (`lead`, `talking`, `proposal`, `won`, `lost`), `value_micro_usd`, `next_step`, `next_step_at` and `source`. An email is on file once per company: adding one already on file updates that contact, and never moves its stage.

* `GET /v1/crm/contacts`, newest touched first. Filter with `stage` and `q` (name, company or email).
* `POST /v1/crm/contacts`
* `GET /v1/crm/contacts/{id}`, with its `activity`, newest first.
* `PATCH /v1/crm/contacts/{id}`. A stage that changes writes its own line on the timeline.
* `DELETE /v1/crm/contacts/{id}`. Deletes the contact and its timeline.

## Timeline

A line has a `kind` (`note`, `email`, `call`, `meeting`, `stage`), a `body`, `at`, `ends_at`, and `by`: the agent that wrote it, or `null` for a person. Only a meeting may stand without a contact. A `stage` line is written by the move itself, and stays.

* `POST /v1/crm/activity`
* `PATCH /v1/crm/activity/{id}`
* `DELETE /v1/crm/activity/{id}`

## Calendar

`GET /v1/crm/calendar?from=&to=` reads meetings, and each open contact's next step on its day, soonest first, across at most a year.

## From an agent

In a company whose template declares the CRM, agents have `crm.read` and `crm.write`, and `open_panel` turns the panel beside the chat to `crm`, `calendar` or `ads`. An agent cannot delete a contact.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.