naftiko: 1.0.0-alpha2 info: label: Twilio SendGrid Subusers — Subuser Statistics description: 'Twilio SendGrid Subusers — Subuser Statistics. 4 operations. Lead operation: Retrieve email statistics for your subusers.. Self-contained Naftiko capability covering one Sendgrid business surface.' tags: - Sendgrid - Subuser Statistics created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: SENDGRID_API_KEY: SENDGRID_API_KEY capability: consumes: - type: http namespace: tsg_subusers_v3-subuser-statistics baseUri: https://api.sendgrid.com description: Twilio SendGrid Subusers — Subuser Statistics business capability. Self-contained, no shared references. resources: - name: v3-subusers-stats path: /v3/subusers/stats operations: - name: liststat method: GET description: Retrieve email statistics for your subusers. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: limit in: query type: integer description: Limits the number of results returned per page. - name: offset in: query type: integer description: The point in the list to begin retrieving results from. - name: aggregated_by in: query type: string description: How to group the statistics. Must be either "day", "week", or "month". - name: subusers in: query type: string description: The subuser you want to retrieve statistics for. You may include this parameter up to 10 times to retrieve statistics for multiple subusers. required: true - name: start_date in: query type: string description: The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. required: true - name: end_date in: query type: string description: The end date of the statistics to retrieve. Defaults to today. - name: v3-subusers-stats-monthly path: /v3/subusers/stats/monthly operations: - name: listmonthlystat method: GET description: Retrieve monthly stats for all subusers outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: date in: query type: string description: The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD required: true - name: subuser in: query type: string description: A substring search of your subusers. - name: sort_by_metric in: query type: string description: 'The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique' - name: sort_by_direction in: query type: string description: The direction you want to sort. - name: limit in: query type: integer description: Optional field to limit the number of results returned. - name: offset in: query type: integer description: Optional beginning point in the list to retrieve from. - name: v3-subusers-stats-sums path: /v3/subusers/stats/sums operations: - name: liststatsum method: GET description: Retrieve the totals for each email statistic metric for all subusers. outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: sort_by_direction in: query type: string description: The direction you want to sort. - name: start_date in: query type: string description: The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. required: true - name: end_date in: query type: string description: The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. - name: limit in: query type: integer description: Limits the number of results returned per page. - name: offset in: query type: integer description: The point in the list to begin retrieving results from. - name: aggregated_by in: query type: string description: How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD. - name: sort_by_metric in: query type: string description: The metric that you want to sort by. Must be a single metric. - name: v3-subusers-subuser_name-stats-monthly path: /v3/subusers/{subuser_name}/stats/monthly operations: - name: listsubusermonthlystat method: GET description: Retrieve the monthly email statistics for a single subuser outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: date in: query type: string description: The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD required: true - name: sort_by_metric in: query type: string description: 'The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique' - name: sort_by_direction in: query type: string description: The direction you want to sort. - name: limit in: query type: integer description: Optional field to limit the number of results returned. - name: offset in: query type: integer description: Optional beginning point in the list to retrieve from. authentication: type: bearer token: '{{env.SENDGRID_API_KEY}}' exposes: - type: rest namespace: tsg_subusers_v3-subuser-statistics-rest port: 8080 description: REST adapter for Twilio SendGrid Subusers — Subuser Statistics. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/v3/subusers/stats name: v3-subusers-stats description: REST surface for v3-subusers-stats. operations: - method: GET name: liststat description: Retrieve email statistics for your subusers. call: tsg_subusers_v3-subuser-statistics.liststat with: limit: rest.limit offset: rest.offset aggregated_by: rest.aggregated_by subusers: rest.subusers start_date: rest.start_date end_date: rest.end_date outputParameters: - type: object mapping: $. - path: /v1/v3/subusers/stats/monthly name: v3-subusers-stats-monthly description: REST surface for v3-subusers-stats-monthly. operations: - method: GET name: listmonthlystat description: Retrieve monthly stats for all subusers call: tsg_subusers_v3-subuser-statistics.listmonthlystat with: date: rest.date subuser: rest.subuser sort_by_metric: rest.sort_by_metric sort_by_direction: rest.sort_by_direction limit: rest.limit offset: rest.offset outputParameters: - type: object mapping: $. - path: /v1/v3/subusers/stats/sums name: v3-subusers-stats-sums description: REST surface for v3-subusers-stats-sums. operations: - method: GET name: liststatsum description: Retrieve the totals for each email statistic metric for all subusers. call: tsg_subusers_v3-subuser-statistics.liststatsum with: sort_by_direction: rest.sort_by_direction start_date: rest.start_date end_date: rest.end_date limit: rest.limit offset: rest.offset aggregated_by: rest.aggregated_by sort_by_metric: rest.sort_by_metric outputParameters: - type: object mapping: $. - path: /v1/v3/subusers/{subuser-name}/stats/monthly name: v3-subusers-subuser-name-stats-monthly description: REST surface for v3-subusers-subuser_name-stats-monthly. operations: - method: GET name: listsubusermonthlystat description: Retrieve the monthly email statistics for a single subuser call: tsg_subusers_v3-subuser-statistics.listsubusermonthlystat with: date: rest.date sort_by_metric: rest.sort_by_metric sort_by_direction: rest.sort_by_direction limit: rest.limit offset: rest.offset outputParameters: - type: object mapping: $. - type: mcp namespace: tsg_subusers_v3-subuser-statistics-mcp port: 9090 transport: http description: MCP adapter for Twilio SendGrid Subusers — Subuser Statistics. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: retrieve-email-statistics-your-subusers description: Retrieve email statistics for your subusers. hints: readOnly: true destructive: false idempotent: true call: tsg_subusers_v3-subuser-statistics.liststat with: limit: tools.limit offset: tools.offset aggregated_by: tools.aggregated_by subusers: tools.subusers start_date: tools.start_date end_date: tools.end_date outputParameters: - type: object mapping: $. - name: retrieve-monthly-stats-all-subusers description: Retrieve monthly stats for all subusers hints: readOnly: true destructive: false idempotent: true call: tsg_subusers_v3-subuser-statistics.listmonthlystat with: date: tools.date subuser: tools.subuser sort_by_metric: tools.sort_by_metric sort_by_direction: tools.sort_by_direction limit: tools.limit offset: tools.offset outputParameters: - type: object mapping: $. - name: retrieve-totals-each-email-statistic description: Retrieve the totals for each email statistic metric for all subusers. hints: readOnly: true destructive: false idempotent: true call: tsg_subusers_v3-subuser-statistics.liststatsum with: sort_by_direction: tools.sort_by_direction start_date: tools.start_date end_date: tools.end_date limit: tools.limit offset: tools.offset aggregated_by: tools.aggregated_by sort_by_metric: tools.sort_by_metric outputParameters: - type: object mapping: $. - name: retrieve-monthly-email-statistics-single description: Retrieve the monthly email statistics for a single subuser hints: readOnly: true destructive: false idempotent: true call: tsg_subusers_v3-subuser-statistics.listsubusermonthlystat with: date: tools.date sort_by_metric: tools.sort_by_metric sort_by_direction: tools.sort_by_direction limit: tools.limit offset: tools.offset outputParameters: - type: object mapping: $.