# Pipedrive adapter The Pipedrive adapter exposes deals, persons, organizations, and activities under `/pipedrive`, with writeback routes for creating and updating those objects. Read-only mounts: - `/pipedrive/deals/.json` - Deal records. - `/pipedrive/persons/.json` - Person records. - `/pipedrive/organizations/.json` - Organization records. - `/pipedrive/activities/.json` - Activity records. Resources: | Resource | Schema | Create example | ID pattern | What it does | |---|---|---|---|---| | `/pipedrive/deals/.json` | `/pipedrive/deals/.schema.json` | `/pipedrive/deals/.create.example.json` | `^(?:[A-Za-z0-9_.~-]+--)?\d+$` | Creates a Pipedrive deal. | | `/pipedrive/persons/.json` | `/pipedrive/persons/.schema.json` | `/pipedrive/persons/.create.example.json` | `^(?:[A-Za-z0-9_.~-]+--)?\d+$` | Creates a Pipedrive person. | | `/pipedrive/organizations/.json` | `/pipedrive/organizations/.schema.json` | `/pipedrive/organizations/.create.example.json` | `^(?:[A-Za-z0-9_.~-]+--)?\d+$` | Creates a Pipedrive organization. | | `/pipedrive/activities/.json` | `/pipedrive/activities/.schema.json` | `/pipedrive/activities/.create.example.json` | `^(?:[A-Za-z0-9_.~-]+--)?\d+$` | Creates a Pipedrive activity. | ## Operations | To... | Do... | |---|---| | Read | `cat ` after listing the resource directory or following an alias when one is available. Use the resource table and ID patterns below to determine whether a resource uses a bare id, an adapter-specific slug/id filename, or an exact sidecar path such as `content.md`. | | Edit | Write the resource update payload to the canonical resource path. For JSON resources, included mutable fields PATCH; fields marked `readOnly` in `.schema.json` are rejected. | | Create | Write JSON to any non-canonical filename such as `create request.json`. The adapter creates the record at its canonical resource path and rewrites the draft as `{ "created": "", "path": "", "url": "" }`. | | Ignore | Editor scratch files named `partial.json`, `.tmp.json`, `.partial.json`, `*.tmp.json`, or `*.partial.json` are ignored and never treated as create drafts. | | Delete | `rm ` for canonical records. | ## ID Patterns - `/pipedrive/deals/.json`: `^(?:[A-Za-z0-9_.~-]+--)?\d+$`. Filenames that do not match this pattern are treated as create drafts. - `/pipedrive/persons/.json`: `^(?:[A-Za-z0-9_.~-]+--)?\d+$`. Filenames that do not match this pattern are treated as create drafts. - `/pipedrive/organizations/.json`: `^(?:[A-Za-z0-9_.~-]+--)?\d+$`. Filenames that do not match this pattern are treated as create drafts. - `/pipedrive/activities/.json`: `^(?:[A-Za-z0-9_.~-]+--)?\d+$`. Filenames that do not match this pattern are treated as create drafts. ## Write field contracts ### Create Pipedrive deal Resource: `/pipedrive/deals/.json` Schema: `/pipedrive/deals/.schema.json` Create example: `/pipedrive/deals/.create.example.json` Required fields: `title`. Optional fields: `value`, `currency`, `status`, `stage_id`, `pipeline_id`, `person_id`, `org_id`, `user_id`, `expected_close_date`, `probability`, `label`. Fields: - `title` (required, string) - Deal title. - `value` (optional, number) - Deal value. - `currency` (optional, string) - Currency code. - `status` (optional, enum) - Deal status. Allowed values: `open`, `won`, `lost`, `deleted`. - `stage_id` (optional, integer) - Pipeline stage id. - `pipeline_id` (optional, integer) - Pipeline id. - `person_id` (optional, integer) - Linked person id. - `org_id` (optional, integer) - Linked organization id. - `user_id` (optional, integer) - Owner user id. - `expected_close_date` (optional, string, date) - Expected close date in YYYY-MM-DD form. - `probability` (optional, integer) - Deal probability percentage. - `label` (optional, string) - Deal label. ### Create Pipedrive person Resource: `/pipedrive/persons/.json` Schema: `/pipedrive/persons/.schema.json` Create example: `/pipedrive/persons/.create.example.json` Required fields: `name`. Optional fields: `first_name`, `last_name`, `email`, `phone`, `owner_id`, `org_id`, `visible_to`. Fields: - `name` (required, string) - Person name. - `first_name` (optional, string) - First name. - `last_name` (optional, string) - Last name. - `email` (optional, array) - Email entries accepted by Pipedrive. - `phone` (optional, array) - Phone entries accepted by Pipedrive. - `owner_id` (optional, integer) - Owner user id. - `org_id` (optional, integer) - Linked organization id. - `visible_to` (optional, string) - Visibility setting. ### Create Pipedrive organization Resource: `/pipedrive/organizations/.json` Schema: `/pipedrive/organizations/.schema.json` Create example: `/pipedrive/organizations/.create.example.json` Required fields: `name`. Optional fields: `owner_id`, `address`, `visible_to`. Fields: - `name` (required, string) - Organization name. - `owner_id` (optional, integer) - Owner user id. - `address` (optional, string) - Organization address. - `visible_to` (optional, string) - Visibility setting. ### Create Pipedrive activity Resource: `/pipedrive/activities/.json` Schema: `/pipedrive/activities/.schema.json` Create example: `/pipedrive/activities/.create.example.json` Required fields: `subject`. Optional fields: `type`, `done`, `due_date`, `due_time`, `duration`, `note`, `deal_id`, `person_id`, `org_id`, `user_id`. Fields: - `subject` (required, string) - Activity subject. - `type` (optional, string) - Activity type. - `done` (optional, boolean) - Whether the activity is complete. - `due_date` (optional, string, date) - Due date in YYYY-MM-DD form. - `due_time` (optional, string) - Due time in HH:MM form. - `duration` (optional, string) - Duration in HH:MM form. - `note` (optional, string) - Activity note. - `deal_id` (optional, integer) - Linked deal id. - `person_id` (optional, integer) - Linked person id. - `org_id` (optional, integer) - Linked organization id. - `user_id` (optional, integer) - Owner user id. ## Create Examples Read the resource `.schema.json` first, then use the sibling `.create.example.json` as a minimal create document. The example intentionally omits read-only fields.