> ## Documentation Index
> Fetch the complete documentation index at: https://www.marqeta.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Views

> Use this endpoint to retrieve a list of the available view endpoints from the DiVA API.

export const EndpointCard = ({method = "API", title, children, href, arrow = true}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-green-400/20 dark:mint-bg-green-400/20",
      text: "mint-text-green-700 dark:mint-text-green-400",
      border: "mint-border-green-300 dark:mint-border-green-700"
    },
    POST: {
      bg: "mint-bg-blue-400/20 dark:mint-bg-blue-400/20",
      text: "mint-text-blue-700 dark:mint-text-blue-400"
    },
    PUT: {
      bg: "mint-bg-yellow-400/20 dark:mint-bg-yellow-400/20",
      text: "mint-text-yellow-700 dark:mint-text-yellow-400"
    },
    PATCH: {
      bg: "mint-bg-orange-400/20 dark:mint-bg-orange-400/20",
      text: "mint-text-orange-700 dark:mint-text-orange-400"
    },
    DELETE: {
      bg: "mint-bg-red-400/20 dark:mint-bg-red-400/20",
      text: "mint-text-red-700 dark:mint-text-red-400"
    },
    API: {
      bg: "mint-bg-black",
      text: "mint-text-white"
    }
  };
  const MethodBadge = ({method}) => {
    const style = METHOD_STYLES[method?.toUpperCase()] ?? METHOD_STYLES.GET;
    return <span className={`
          method-pill rounded-lg font-semibold px-1.5 py-0.5 text-xs leading-5 ${style.bg} ${style.text}`}>
        {method?.toUpperCase()}
      </span>;
  };
  const content = <div className="group flex items-center gap-4 border border-gray-200 dark:border-gray-700 rounded-xl p-5 hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md transition-all cursor-pointer">
      {}
      <div className="shrink-0">
        <MethodBadge method={method} />
      </div>
      {}
      <div className="flex-1 min-w-0">
        <p className="font-semibold text-gray-900 dark:text-white text-sm leading-snug">{title}</p>
        {children && <p className="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-2">{children}</p>}
      </div>
    </div>;
  if (!href) return content;
  return <a href={href} className="block no-underline border-b-0 mb-2">
      {content}
    </a>;
};

Use this endpoint to retrieve a list of the available view endpoints from the DiVA API. Each view endpoint provides access to a specific type of data on the Marqeta platform that is aggregated at a specific level. For example, a view can provide access to authorization transaction data aggregated by week. For more information about data aggregation levels, see [Response Customization](/diva-api/response-customization/).

<h2 id="_retrieve_views">
  Retrieve views
</h2>

**Action:** `GET`\
**Endpoint:** `/views`

This endpoint returns an array of objects that describe the available views. Each object contains metadata about a view, such as the default filters and aggregation level, if available.

<h3 id="_response_body">
  Response body
</h3>

| Fields                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| default\_date<br /><br />string<br />Returned   | Date field used in the default filter for API requests without a date range in the query filter.<br /><br />**Allowable Values:**<br /><br />Name of a date field in the view schema.                                                                                                                                                                                                                                                                                    |
| default\_filter<br /><br />object<br />Returned | Object that describes the default filter for API requests without a date range in the query filter.<br /><br />**Allowable Values:**<br /><br />`default_date_field_name` , `fields`                                                                                                                                                                                                                                                                                     |
| display<br /><br />string<br />Returned         | Summary field for the related report in the Marqeta Dashboard.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                                                                                                                                  |
| endpoint<br /><br />string<br />Returned        | Relative URL to the DiVA API endpoint for retrieving the view.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                                                                                                                                  |
| expansion<br /><br />object<br />Returned       | Object that describes the expandable fields for a schema. Expanding a field value returns a more detailed breakdown of data for that field. For example, you can pass the `expand=pin_purchase_net` parameter to the `/views/activitybalances/day` endpoint to break out PIN purchases by card network (such as `maestro_pin_net` and `cirrus_pin_net` ).<br /><br />Null if no values are expandable.<br /><br />**Allowable Values:**<br /><br />`expand_argument_<n>` |
| fields\_domain<br /><br />string<br />Returned  | List of all fields that are available in the view schema.<br /><br />**Allowable Values:**<br /><br />Comma-delimited list of fields in the view schema.                                                                                                                                                                                                                                                                                                                 |
| filter\_domain<br /><br />string<br />Returned  | List of fields that are not returned as data in the view but that you can use for filtering results (indicated by the `is_filter_only` field in the view schema).<br /><br />**Allowable Values:**<br /><br />Comma-delimited list of fields in the view schema.                                                                                                                                                                                                         |
| report<br /><br />string<br />Returned          | Category of the related report in the Marqeta Dashboard.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                                                                                                                                        |
| schema<br /><br />string<br />Returned          | Relative URL to the DiVA API endpoint for retrieving the view schema.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                                                                                                                           |
| type<br /><br />string<br />Returned            | Name of the related report in the Marqeta Dashboard.<br /><br />**Allowable Values:**<br /><br />255 char max                                                                                                                                                                                                                                                                                                                                                            |

<h3 id="_the_default_filter_object_response">
  The default\_filter object (response)
</h3>

| Fields                                                     | Description                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| fields<br /><br />string<br />Returned                     | View fields returned by default for API requests without a field filter.<br /><br />**Allowable Values:**<br /><br />Comma-delimited list of fields in the view schema.                                                                                                                                                                              |
| default\_date\_field\_name<br /><br />string<br />Returned | Date range filter applied for API requests without a date range in the query filter. The default date range includes results for a recent period of time based on when the query is run.<br /><br />**Allowable Values:**<br /><br />Date range following the <a href="/diva-api/response-customization/#_query_filtering">query filter syntax</a> . |

<h3 id="_the_expansion_object_response">
  The expansion object (response)
</h3>

| Fields                                                                                           | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| expand\_argument\_1<br /><br />…​<br /><br />expand\_argument\_N<br /><br />string<br />Returned | Name of an argument to the `expand` query parameter, and list of additional fields that the argument returns. For example,<br /><br />`json JSON "expansion": { "pin_purchases_net": "maestro_pin_net,...", "sig_purchases_net": "mastercard_sig_purchases,...", } `<br /><br />**Allowable Values:**<br /><br />Name-value pairs of an argument name and a comma-delimited list of additional field names. |

<h3 id="_sample_response_body">
  Sample response body
</h3>

The following sample shows a representative JSON response for a `GET` request to the `/views?program=my_program` endpoint.

```json JSON expandable lines wrap theme={null}
[
  {
    "default_date": "post_date",
    "default_filter": {
      "fields": "post_date,starting_balance,ach_loads_net,credit_or_debit_card_loads_net,marqeta_loads_net,partner_funds_loads,jit_loads_net,sig_purchases_net,in_purchases_net,chargeback,currency_conversion_fees,program_fees,ending_balance",
      "post_date": "2023-04-29..2023-05-29"
    },
    "display": "Overview",
    "endpoint": "activitybalances/day",
    "expansion": {
      "pin_purchases_net": "maestro_pin_net,cirrus_pin_net,interlink_pin_net,plus_pin_net,netdebit_pin_net,pulse_pin_net",
      "sig_purchases_net": "mastercard_sig_purchases,mastercard_sig_returns,visa_sig_purchases,visa_sig_returns,discover_sig_purchases,discover_sig_returns"
    },
    "fields_domain": "post_date,starting_balance,ach_loads_net,credit_or_debit_card_loads_net,marqeta_loads_net,partner_funds_loads,jit_loads_net,sig_purchases_net,in_purchases_net,chargeback,currency_conversion_fees,program_fees,ending_balance",
    "filter_domain": null,
    "report": "Balance",
    "schema": "activitybalances/day/schema",
    "type": "Day"
  },
  {
    "default_date": "post_date",
    "default_filter": {
      "fields": "post_date,starting_balance,ach_loads_net,credit_or_debit_card_loads_net,partner_funds_loads,jit_loads_net,mastercard_sig_purchases,mastercard_sig_returns,visa_sig_purchases,visa_sig_returns,discover_sig_purchases,discover_sig_returns,maestro_pin_net,cirrus_pin_net,interlink_pin_net,plus_pin_net,netdebit_pin_net,pulse_pin_net,chargeback,currency_conversion_fees,program_fees,ending_balance",
      "post_date": "2023-04-29..2023-05-29"
    },
    "display": "Network Detail",
    "endpoint": "activitybalances/day/networkdetail",
    "expansion": null,
    "fields_domain": "post_date,starting_balance,ach_loads_net,credit_or_debit_card_loads_net,partner_funds_loads,jit_loads_net,mastercard_sig_purchases,mastercard_sig_returns,visa_sig_purchases,visa_sig_returns,discover_sig_purchases,discover_sig_returns,maestro_pin_net,cirrus_pin_net,interlink_pin_net,plus_pin_net,netdebit_pin_net,pulse_pin_net,chargeback,currency_conversion_fees,program_fees,ending_balance",
    "filter_domain": null,
    "report": "Balance",
    "schema": "activitybalances/day/networkdetail/schema",
    "type": "Day"
    },
    ...
]
```
