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

# Create Link Session

> This endpoint is to be called by your back end, to establish a new link session for creating a link to your end user's institution.

<div className="tailwind hidden">
  ```
  curl -i -X POST \
    http://localhost:8080/link-session \
    -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
    -H 'Content-Type: application/json' \
    -H 'moneykit-version: 2023-02-18' \
    -d '{
      "settings": {
        "providers": [
          "moneykit"
        ],
        "link_permissions": {
          "requested": [
            {
              "scope": "accounts",
              "reason": "display your account balances",
              "required": true
            }
          ]
        },
        "products": {
          "account_numbers": {
            "required": false,
            "prefetch": false
          },
          "identity": {
            "required": false,
            "prefetch": false
          },
          "transactions": {
            "required": false,
            "prefetch": false,
            "extend_history": false
          }
        },
        "countries": [
          "US"
        ]
      },
      "customer_user": {
        "id": "string",
        "email": {
          "address": "string",
          "customer_verified_at": "2023-02-16T00:00:00"
        },
        "phone": {
          "number": "+16175551212",
          "country": "US",
          "customer_verified_at": "2023-02-16T00:00:00"
        }
      },
      "existing_link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
      "institution_id": "c7318ff7-257c-490e-8242-03a815b223b7",
      "redirect_uri": "https://yourdomain.com/oauth.html",
      "webhook": "https://yourdomain.com/moneykit_webhook",
      "link_tags": [
        "smoke_test",
        "user_type:admin"
      ],
      "moneylink_features": {}
    }'
  ```

  ```
  {
    "link_session_token": "c7318ff7-257c-490e-8242-03a815b223b7"
  }
  ```

  ```
  {
    "webhook_event": "link.state_changed",
    "webhook_major_version": 1,
    "webhook_minor_version": 0,
    "webhook_idempotency_key": "string",
    "webhook_timestamp": "2019-08-24T14:15:22Z",
    "link_id": "string",
    "link_tags": [
      "string"
    ],
    "state": "connecting",
    "error": "system_error",
    "error_message": "string"
  }
  ```
</div>
