# Create a Session

To launch the Financial Connections authorization flow, create a `Session`. The session’s `client_secret` can be used to launch the flow using Stripe.js.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createCustomer
POST /v1/customers {"name":"Jenny Rosen","email":"jennyrosen@example.com"}

## Request

```curl
curl https://api.stripe.com/v1/financial_connections/sessions \
  -u "<<YOUR_SECRET_KEY>>" \
  -d "account_holder[type]=customer" \
  -d "account_holder[customer]={{CUSTOMER_ID}}" \
  -d "permissions[]=payment_method" \
  -d "permissions[]=balances" \
  -d "filters[countries][]=US"
```

### Response

```json
{
  "id": "fcsess_1MwtnGLkdIwHu7ixs7NPQ7dq",
  "object": "financial_connections.session",
  "account_holder": {
    "customer": "cus_NiKSWdaFz2F6I0",
    "type": "customer"
  },
  "accounts": {
    "object": "list",
    "data": [],
    "has_more": false,
    "total_count": 0,
    "url": "/v1/financial_connections/accounts"
  },
  "client_secret": "fcsess_client_secret_KRJTKvCY3IKoYTrW18EazcO3",
  "filters": {
    "countries": [
      "US"
    ]
  },
  "livemode": false,
  "permissions": [
    "balances",
    "payment_method"
  ]
}
```

## Returns

Returns the `Session` object.

## Parameters

- [`account_holder`](https://docs.stripe.com/api/financial_connections/sessions/create.md?query=account_holder) (object, required)
  The account holder to link accounts for.

- `permissions` (array of strings, required)
  List of data features that you would like to request access to.

  Possible values are `balances`, `transactions`, `ownership`, and `payment_method`.

- [`filters`](https://docs.stripe.com/api/financial_connections/sessions/create.md?query=filters) (object, optional)
  Filters to restrict the kinds of accounts to collect.

- [`limits`](https://docs.stripe.com/api/financial_connections/sessions/create.md?query=limits) (object, optional)
  Settings for configuring Session-specific limits.

- [`manual_entry`](https://docs.stripe.com/api/financial_connections/sessions/create.md?query=manual_entry) (object, optional)
  Customize manual entry behavior

- `prefetch` (array of enums, optional)
  List of data features that you would like to retrieve upon account creation.
Possible enum values:
  - `balances`
    Requests to prefetch balance data on accounts collected in this session.

  - `ownership`
    Requests to prefetch ownership data on accounts collected in this session.

  - `transactions`
    Requests to prefetch transaction data on accounts collected in this session.

- `return_url` (string, optional)
  For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
