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

# Generate OAuth Window URI

> This endpoint generates an `oauth_window_uri` for the specified `member`.

This endpoint will generate an `oauth_window_uri` for the specified `member`.

Generating a new `oauth_window_uri` is necessary to send the end user through the OAuth process again. The following are a few examples where you might want to do this:

* A previous attempt at OAuth failed — for instance if the end user closed the OAuth window before completing the process.
* The financial institution has revoked a previous OAuth token or the token has expired.

The `member` in question must be connected to an institution which supports OAuth. if the institution does not support OAuth, a `400 Bad Request` error will be returned with the message `Member cannot use OAuth`.

<ParamField query="skip_aggregation" type="boolean">
  Setting this parameter to `true` will prevent the member from automatically aggregating after being redirected from the authorization page.
</ParamField>

<ParamField query="referral_source" type="string">
  Must be either `BROWSER` or `APP` depending on the implementation. Defaults to `BROWSER`.
</ParamField>

<ParamField query="client_redirect_url" type="string">
  A URL that MX will redirect to at the end of OAuth with additional query parameters. Only available with \`referral\_source: \\
</ParamField>

<ParamField query="ui_message_webview_url_scheme" type="string">
  A scheme for routing the user back to the application state they were previously in. Only available with \`referral\_source: \\
</ParamField>

<RequestExample>
  ```shell Request theme={null}
  curl -i 'https://vestibule.mx.com/users/{user_guid}/members/{member_guid}/oauth_window_uri' \  -H 'Accept: application/vnd.mx.atrium.v1+json' \  -H 'MX-API-Key: {mx_api_key}' \  -H 'MX-Client-ID: {mx_client_id}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "member": {
      "aggregated_at": "2016-10-13T18:07:57+00:00",
      "connection_status": "CONNECTED",
      "guid": "MBR-7c6f361b-e582-15b6-60c0-358f12466b4b",
      "identifier": "unique_id",
      "institution_code": "mx_bank_oauth",
      "is_being_aggregated": false,
      "metadata": "{\"credentials_last_refreshed_at\": \"2015-10-15\"}",
      "name": "MX Bank (OAuth)",
      "oauth_window_uri": "https://mxbank.mx.com/oauth/authorize?client_id=b8OikQ4Ep3NuSUrQ13DdvFuwpNx-qqoAsJDVAQCyLkQ&redirect_uri=https%3A%2F%2Fint-app.moneydesktop.com%2Foauth%2Fredirect_from&response_type=code&scope=openid&state=d273e4f71bc095cf16c4acbee011caf4",
      "status": "COMPLETED",
      "successfully_aggregated_at": "2016-10-13T17:57:38+00:00",
      "user_guid": "USR-fa7537f3-48aa-a683-a02a-b18940482f54"
    }
  }
  ```
</ResponseExample>
