{"note":"OpenAPI conversion -- returning structured metadata","name":"sendgrid-stats","description":"Twilio SendGrid Statistics API","version":"1.0.0","base_url":"https://api.sendgrid.com","endpoints":10,"raw":"@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"}