{"files":{"SKILL.md":"---\nname: twilio-sendgrid-statistics-api\ndescription: \"Twilio SendGrid Statistics API skill. Use when working with Twilio SendGrid Statistics for browsers, categories, clients. Covers 10 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Twilio SendGrid Statistics API\nAPI version: 1.0.0\n\n## Auth\nBearer bearer\n\n## Base URL\nhttps://api.sendgrid.com\n\n## Setup\n1. Set Authorization header with Bearer token\n2. GET /v3/browsers/stats -- retrieve email statistics by browser.\n3. Explore available endpoints below\n\n## Endpoints\n10 endpoints across 7 groups. See references/api-spec.lap for full details.\n\n### Browsers\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/browsers/stats | Retrieve email statistics by browser. |\n\n### Categories\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/categories | Retrieve all categories |\n| GET | /v3/categories/stats | Retrieve Email Statistics for Categories |\n| GET | /v3/categories/stats/sums | Retrieve sums of email stats for each category. |\n\n### Clients\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/clients/stats | Retrieve email statistics by client type. |\n| GET | /v3/clients/{client_type}/stats | Retrieve stats by a specific client type. |\n\n### Devices\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/devices/stats | Retrieve email statistics by device type. |\n\n### Geo\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/geo/stats | Retrieve email statistics by country and state/province. |\n\n### Mailbox_providers\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. |\n\n### Stats\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v3/stats | Retrieve global email statistics |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all stats?\" -> GET /v3/browsers/stats\n- \"List all categories?\" -> GET /v3/categories\n- \"List all sums?\" -> GET /v3/categories/stats/sums\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Paginated endpoints accept limit/offset or cursor parameters\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Twilio SendGrid Statistics API\n@base https://api.sendgrid.com\n@version 1.0.0\n@auth Bearer bearer\n@common_fields {on-behalf-of: str # The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.}\n@endpoints 10\n@toc browsers(1), categories(3), clients(2), devices(1), geo(1), mailbox_providers(1), stats(1)\n\n@group browsers\n@endpoint GET /v3/browsers/stats\n@desc Retrieve email statistics by browser.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {browsers: str # The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times., limit: int # The number of results to return., offset: int # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\"., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.}\n@returns(200)\n\n@endgroup\n\n@group categories\n@endpoint GET /v3/categories\n@desc Retrieve all categories\n@optional {limit: int=50 # `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used., category: str # Allows you to perform a prefix search on this particular category., offset: int=0 # The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list.}\n@returns(200)\n@errors {400}\n\n@endpoint GET /v3/categories/stats\n@desc Retrieve Email Statistics for Categories\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD, categories: str # The individual categories that you want to retrieve statistics for. You may include up to 10 different categories.}\n@optional {end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\".}\n@returns(200)\n\n@endpoint GET /v3/categories/stats/sums\n@desc Retrieve sums of email stats for each category.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {sort_by_metric: str=delivered # The metric that you want to sort by.  Must be a single metric., sort_by_direction: str=desc # The direction you want to sort., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD., limit: int=5 # Limits the number of results returned., offset: int=0 # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\".}\n@returns(200) {date: str, stats: [map]}\n\n@endgroup\n\n@group clients\n@endpoint GET /v3/clients/stats\n@desc Retrieve email statistics by client type.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\".}\n@returns(200)\n\n@endpoint GET /v3/clients/{client_type}/stats\n@desc Retrieve stats by a specific client type.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\".}\n@returns(200)\n\n@endgroup\n\n@group devices\n@endpoint GET /v3/devices/stats\n@desc Retrieve email statistics by device type.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {limit: int # The number of results to return., offset: int # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\"., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.}\n@returns(200)\n\n@endgroup\n\n@group geo\n@endpoint GET /v3/geo/stats\n@desc Retrieve email statistics by country and state/province.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {country: str # The country you would like to see statistics for. Currently only supported for US and CA., limit: int # The number of results to return., offset: int # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\"., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.}\n@returns(200)\n\n@endgroup\n\n@group mailbox_providers\n@endpoint GET /v3/mailbox_providers/stats\n@desc Retrieve email statistics by mailbox provider.\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {mailbox_providers: str # The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times., limit: int # The number of results to return., offset: int # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\"., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.}\n@returns(200)\n\n@endgroup\n\n@group stats\n@endpoint GET /v3/stats\n@desc Retrieve global email statistics\n@required {start_date: str # The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.}\n@optional {limit: int # The number of results to return., offset: int # The point in the list to begin retrieving results., aggregated_by: str # How to group the statistics. Must be either \"day\", \"week\", or \"month\"., end_date: str # The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.}\n@returns(200)\n\n@endgroup\n\n@end\n"}}