naftiko: 1.0.0-alpha2 info: label: API Endpoints — subpackage_opportunities description: 'API Endpoints — subpackage_opportunities. 5 operations. Lead operation: List or filter opportunities. Self-contained Naftiko capability covering one Close business surface.' tags: - Close - subpackage_opportunities created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: CLOSE_API_KEY: CLOSE_API_KEY capability: consumes: - type: http namespace: close-subpackage-opportunities baseUri: https://api.close.com/api/v1 description: API Endpoints — subpackage_opportunities business capability. Self-contained, no shared references. resources: - name: opportunity path: /opportunity/ operations: - name: list method: GET description: List or filter opportunities outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: _limit in: query type: integer description: Number of results to return. - name: _skip in: query type: integer description: Number of results to skip before returning, for pagination. - name: _fields in: query type: string description: Comma-separated list of fields to include in the response. - name: lead_id in: query type: - string - 'null' - name: organization_id in: query type: - string - 'null' - name: user_id in: query type: - string - 'null' - name: user_id__in in: query type: - string - 'null' - name: status_id in: query type: - string - 'null' - name: status_id__in in: query type: - string - 'null' - name: status_type in: query type: - string - 'null' - name: status_type__in in: query type: - string - 'null' - name: status_label in: query type: - string - 'null' - name: status_label__in in: query type: - string - 'null' - name: status in: query type: - string - 'null' - name: status__in in: query type: - string - 'null' - name: date_won in: query type: - string - 'null' - name: date_won__gte in: query type: - string - 'null' - name: date_won__gt in: query type: - string - 'null' - name: date_won__lte in: query type: - string - 'null' - name: date_won__lt in: query type: - string - 'null' - name: date_created in: query type: - string - 'null' - name: date_created__gte in: query type: - string - 'null' - name: date_created__gt in: query type: - string - 'null' - name: date_created__lte in: query type: - string - 'null' - name: date_created__lt in: query type: - string - 'null' - name: date_updated in: query type: - string - 'null' - name: date_updated__gte in: query type: - string - 'null' - name: date_updated__gt in: query type: - string - 'null' - name: date_updated__lte in: query type: - string - 'null' - name: date_updated__lt in: query type: - string - 'null' - name: value_period in: query type: - string - 'null' - name: value_period__in in: query type: - string - 'null' - name: query in: query type: - string - 'null' - name: lead_query in: query type: - string - 'null' - name: lead_saved_search_id in: query type: - string - 'null' - name: is_stalled in: query type: - string - 'null' - name: _order_by in: query type: - string - 'null' - name: _group_by in: query type: - string - 'null' - name: Authorization in: header type: string description: Use your API key as the username and leave the password empty. required: true - name: create method: POST description: Create an opportunity outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: Authorization in: header type: string description: Use your API key as the username and leave the password empty. required: true - name: body in: body type: object description: Request body (JSON). required: false - name: opportunity-id path: /opportunity/{id}/ operations: - name: get method: GET description: Retrieve an opportunity outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string required: true - name: _fields in: query type: string description: Comma-separated list of fields to include in the response. - name: Authorization in: header type: string description: Use your API key as the username and leave the password empty. required: true - name: update method: PUT description: Update an opportunity outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string required: true - name: Authorization in: header type: string description: Use your API key as the username and leave the password empty. required: true - name: body in: body type: object description: Request body (JSON). required: false - name: delete method: DELETE description: Delete an opportunity outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: id in: path type: string required: true - name: Authorization in: header type: string description: Use your API key as the username and leave the password empty. required: true authentication: type: bearer token: '{{env.CLOSE_API_KEY}}' exposes: - type: rest namespace: close-subpackage-opportunities-rest port: 8080 description: REST adapter for API Endpoints — subpackage_opportunities. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/opportunity name: opportunity description: REST surface for opportunity. operations: - method: GET name: list description: List or filter opportunities call: close-subpackage-opportunities.list with: _limit: rest._limit _skip: rest._skip _fields: rest._fields lead_id: rest.lead_id organization_id: rest.organization_id user_id: rest.user_id user_id__in: rest.user_id__in status_id: rest.status_id status_id__in: rest.status_id__in status_type: rest.status_type status_type__in: rest.status_type__in status_label: rest.status_label status_label__in: rest.status_label__in status: rest.status status__in: rest.status__in date_won: rest.date_won date_won__gte: rest.date_won__gte date_won__gt: rest.date_won__gt date_won__lte: rest.date_won__lte date_won__lt: rest.date_won__lt date_created: rest.date_created date_created__gte: rest.date_created__gte date_created__gt: rest.date_created__gt date_created__lte: rest.date_created__lte date_created__lt: rest.date_created__lt date_updated: rest.date_updated date_updated__gte: rest.date_updated__gte date_updated__gt: rest.date_updated__gt date_updated__lte: rest.date_updated__lte date_updated__lt: rest.date_updated__lt value_period: rest.value_period value_period__in: rest.value_period__in query: rest.query lead_query: rest.lead_query lead_saved_search_id: rest.lead_saved_search_id is_stalled: rest.is_stalled _order_by: rest._order_by _group_by: rest._group_by Authorization: rest.Authorization outputParameters: - type: object mapping: $. - method: POST name: create description: Create an opportunity call: close-subpackage-opportunities.create with: Authorization: rest.Authorization body: rest.body outputParameters: - type: object mapping: $. - path: /v1/opportunity/{id} name: opportunity-id description: REST surface for opportunity-id. operations: - method: GET name: get description: Retrieve an opportunity call: close-subpackage-opportunities.get with: id: rest.id _fields: rest._fields Authorization: rest.Authorization outputParameters: - type: object mapping: $. - method: PUT name: update description: Update an opportunity call: close-subpackage-opportunities.update with: id: rest.id Authorization: rest.Authorization body: rest.body outputParameters: - type: object mapping: $. - method: DELETE name: delete description: Delete an opportunity call: close-subpackage-opportunities.delete with: id: rest.id Authorization: rest.Authorization outputParameters: - type: object mapping: $. - type: mcp namespace: close-subpackage-opportunities-mcp port: 9090 transport: http description: MCP adapter for API Endpoints — subpackage_opportunities. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: list-filter-opportunities description: List or filter opportunities hints: readOnly: true destructive: false idempotent: true call: close-subpackage-opportunities.list with: _limit: tools._limit _skip: tools._skip _fields: tools._fields lead_id: tools.lead_id organization_id: tools.organization_id user_id: tools.user_id user_id__in: tools.user_id__in status_id: tools.status_id status_id__in: tools.status_id__in status_type: tools.status_type status_type__in: tools.status_type__in status_label: tools.status_label status_label__in: tools.status_label__in status: tools.status status__in: tools.status__in date_won: tools.date_won date_won__gte: tools.date_won__gte date_won__gt: tools.date_won__gt date_won__lte: tools.date_won__lte date_won__lt: tools.date_won__lt date_created: tools.date_created date_created__gte: tools.date_created__gte date_created__gt: tools.date_created__gt date_created__lte: tools.date_created__lte date_created__lt: tools.date_created__lt date_updated: tools.date_updated date_updated__gte: tools.date_updated__gte date_updated__gt: tools.date_updated__gt date_updated__lte: tools.date_updated__lte date_updated__lt: tools.date_updated__lt value_period: tools.value_period value_period__in: tools.value_period__in query: tools.query lead_query: tools.lead_query lead_saved_search_id: tools.lead_saved_search_id is_stalled: tools.is_stalled _order_by: tools._order_by _group_by: tools._group_by Authorization: tools.Authorization outputParameters: - type: object mapping: $. - name: create-opportunity description: Create an opportunity hints: readOnly: false destructive: false idempotent: false call: close-subpackage-opportunities.create with: Authorization: tools.Authorization body: tools.body outputParameters: - type: object mapping: $. - name: retrieve-opportunity description: Retrieve an opportunity hints: readOnly: true destructive: false idempotent: true call: close-subpackage-opportunities.get with: id: tools.id _fields: tools._fields Authorization: tools.Authorization outputParameters: - type: object mapping: $. - name: update-opportunity description: Update an opportunity hints: readOnly: false destructive: false idempotent: true call: close-subpackage-opportunities.update with: id: tools.id Authorization: tools.Authorization body: tools.body outputParameters: - type: object mapping: $. - name: delete-opportunity description: Delete an opportunity hints: readOnly: false destructive: true idempotent: true call: close-subpackage-opportunities.delete with: id: tools.id Authorization: tools.Authorization outputParameters: - type: object mapping: $.