naftiko: 1.0.0-alpha2 info: label: Pipedrive API v1 — Leads description: 'Pipedrive API v1 — Leads. 8 operations. Lead operation: Get all leads. Self-contained Naftiko capability covering one Pipedrive business surface.' tags: - Pipedrive - Leads created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: PIPEDRIVE_API_KEY: PIPEDRIVE_API_KEY capability: consumes: - type: http namespace: v1-leads baseUri: https://api.pipedrive.com/v1 description: Pipedrive API v1 — Leads business capability. Self-contained, no shared references. resources: - name: leads path: /leads operations: - name: getleads method: GET description: Get all leads outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. - name: start in: query type: integer description: For pagination, the position that represents the first result for the page - name: owner_id in: query type: integer description: If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. - name: person_id in: query type: integer description: If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. - name: organization_id in: query type: integer description: If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. - name: filter_id in: query type: integer description: The ID of the filter to use - name: updated_since in: query type: string description: If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. - name: sort in: query type: string description: The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). - name: addlead method: POST description: Add a lead outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: false - name: leads-archived path: /leads/archived operations: - name: getarchivedleads method: GET description: Get all archived leads outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. - name: start in: query type: integer description: For pagination, the position that represents the first result for the page - name: owner_id in: query type: integer description: If supplied, only leads matching the given user will be returned. However, `filter_id` takes precedence over `owner_id` when supplied. - name: person_id in: query type: integer description: If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. - name: organization_id in: query type: integer description: If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. - name: filter_id in: query type: integer description: The ID of the filter to use - name: sort in: query type: string description: The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). - name: leads-search path: /leads/search operations: - name: searchleads method: GET description: Search leads outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: term in: query type: string description: The search term to look for. Minimum 2 characters (or 1 if using `exact_match`). Please note that the search term has to be URL encoded. required: true - name: fields in: query type: string description: A comma-separated string array. The fields to perform the search from. Defaults to all of them. - name: exact_match in: query type: boolean description: When enabled, only full exact matches against the given term are returned. It is not case sensitive. - name: person_id in: query type: integer description: Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000. - name: organization_id in: query type: integer description: Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000. - name: include_fields in: query type: string description: Supports including optional fields in the results which are not provided by default - name: start in: query type: integer description: Pagination start. Note that the pagination is based on main results and does not include related items when using `search_for_related_items` parameter. - name: limit in: query type: integer description: Items shown per page - name: leads-id path: /leads/{id} operations: - name: getlead method: GET description: Get one lead outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of the lead required: true - name: updatelead method: PATCH description: Update a lead outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of the lead required: true - name: body in: body type: object description: Request body (JSON). required: false - name: deletelead method: DELETE description: Delete a lead outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of the lead required: true - name: leads-id-permittedUsers path: /leads/{id}/permittedUsers operations: - name: getleadusers method: GET description: List permitted users outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string description: The ID of the lead required: true authentication: type: bearer token: '{{env.PIPEDRIVE_API_KEY}}' exposes: - type: rest namespace: v1-leads-rest port: 8080 description: REST adapter for Pipedrive API v1 — Leads. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/leads name: leads description: REST surface for leads. operations: - method: GET name: getleads description: Get all leads call: v1-leads.getleads with: limit: rest.limit start: rest.start owner_id: rest.owner_id person_id: rest.person_id organization_id: rest.organization_id filter_id: rest.filter_id updated_since: rest.updated_since sort: rest.sort outputParameters: - type: object mapping: $. - method: POST name: addlead description: Add a lead call: v1-leads.addlead with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/leads/archived name: leads-archived description: REST surface for leads-archived. operations: - method: GET name: getarchivedleads description: Get all archived leads call: v1-leads.getarchivedleads with: limit: rest.limit start: rest.start owner_id: rest.owner_id person_id: rest.person_id organization_id: rest.organization_id filter_id: rest.filter_id sort: rest.sort outputParameters: - type: object mapping: $. - path: /v1/leads/search name: leads-search description: REST surface for leads-search. operations: - method: GET name: searchleads description: Search leads call: v1-leads.searchleads with: term: rest.term fields: rest.fields exact_match: rest.exact_match person_id: rest.person_id organization_id: rest.organization_id include_fields: rest.include_fields start: rest.start limit: rest.limit outputParameters: - type: object mapping: $. - path: /v1/leads/{id} name: leads-id description: REST surface for leads-id. operations: - method: GET name: getlead description: Get one lead call: v1-leads.getlead with: id: rest.id outputParameters: - type: object mapping: $. - method: PATCH name: updatelead description: Update a lead call: v1-leads.updatelead with: id: rest.id body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: deletelead description: Delete a lead call: v1-leads.deletelead with: id: rest.id outputParameters: - type: object mapping: $. - path: /v1/leads/{id}/permittedusers name: leads-id-permittedusers description: REST surface for leads-id-permittedUsers. operations: - method: GET name: getleadusers description: List permitted users call: v1-leads.getleadusers with: id: rest.id outputParameters: - type: object mapping: $. - type: mcp namespace: v1-leads-mcp port: 9090 transport: http description: MCP adapter for Pipedrive API v1 — Leads. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: get-all-leads description: Get all leads hints: readOnly: true destructive: false idempotent: true call: v1-leads.getleads with: limit: tools.limit start: tools.start owner_id: tools.owner_id person_id: tools.person_id organization_id: tools.organization_id filter_id: tools.filter_id updated_since: tools.updated_since sort: tools.sort outputParameters: - type: object mapping: $. - name: add-lead description: Add a lead hints: readOnly: false destructive: false idempotent: false call: v1-leads.addlead with: body: tools.body outputParameters: - type: object mapping: $. - name: get-all-archived-leads description: Get all archived leads hints: readOnly: true destructive: false idempotent: true call: v1-leads.getarchivedleads with: limit: tools.limit start: tools.start owner_id: tools.owner_id person_id: tools.person_id organization_id: tools.organization_id filter_id: tools.filter_id sort: tools.sort outputParameters: - type: object mapping: $. - name: search-leads description: Search leads hints: readOnly: true destructive: false idempotent: true call: v1-leads.searchleads with: term: tools.term fields: tools.fields exact_match: tools.exact_match person_id: tools.person_id organization_id: tools.organization_id include_fields: tools.include_fields start: tools.start limit: tools.limit outputParameters: - type: object mapping: $. - name: get-one-lead description: Get one lead hints: readOnly: true destructive: false idempotent: true call: v1-leads.getlead with: id: tools.id outputParameters: - type: object mapping: $. - name: update-lead description: Update a lead hints: readOnly: false destructive: false idempotent: true call: v1-leads.updatelead with: id: tools.id body: tools.body outputParameters: - type: object mapping: $. - name: delete-lead description: Delete a lead hints: readOnly: false destructive: true idempotent: true call: v1-leads.deletelead with: id: tools.id outputParameters: - type: object mapping: $. - name: list-permitted-users description: List permitted users hints: readOnly: true destructive: false idempotent: true call: v1-leads.getleadusers with: id: tools.id outputParameters: - type: object mapping: $.