Skip to main content
POST
/
link-session
/
exchange-token
/link-session/exchange-token
curl --request POST \
  --url http://localhost:8080/link-session/exchange-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "exchangeable_token": "c7318ff7-257c-490e-8242-03a815b223b7"
}'
{
  "link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
  "link": {
    "link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
    "institution_id": "chase",
    "institution_name": "Chase",
    "provider": "mx",
    "state": "connected",
    "last_synced_at": "2023-02-16T09:14:11",
    "tags": [
      "user_type:admin"
    ],
    "products": {
      "accounts": {
        "refreshed_at": "2023-02-16T09:14:11",
        "last_attempted_at": "2023-02-16T09:14:11"
      },
      "identity": {
        "refreshed_at": "2023-02-16T09:14:11",
        "last_attempted_at": "2023-02-16T09:14:11",
        "settings": {
          "required": true,
          "prefetch": false
        }
      }
    }
  }
}
curl -i -X POST \
  http://localhost:8080/link-session/exchange-token \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'moneykit-version: 2023-02-18' \
  -d '{
    "exchangeable_token": "c7318ff7-257c-490e-8242-03a815b223b7"
  }'
{
  "link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
  "link": {
    "link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
    "institution_id": "chase",
    "institution_name": "Chase",
    "provider": "mx",
    "state": "connected",
    "last_synced_at": "2023-02-16T09:14:11",
    "tags": [
      "user_type:admin"
    ],
    "products": {
      "accounts": {
        "refreshed_at": "2023-02-16T09:14:11",
        "last_attempted_at": "2023-02-16T09:14:11"
      },
      "identity": {
        "refreshed_at": "2023-02-16T09:14:11",
        "last_attempted_at": "2023-02-16T09:14:11",
        "settings": {
          "required": true,
          "prefetch": false
        }
      }
    }
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

moneykit-version
string
default:2023-02-18

Body

application/json
exchangeable_token
string
required

The token returned to your front end by Connect's onSuccess callback.

Example:

"c7318ff7-257c-490e-8242-03a815b223b7"

Response

Successful Response

The unique ID associated with this link.

Example:

"mk_eqkWN34UEoa2NxyALG8pcV"

Details of the new link.

Example:
{
"link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
"institution_id": "chase",
"institution_name": "Chase",
"provider": "mx",
"state": "connected",
"last_synced_at": "2023-02-16T09:14:11",
"tags": ["user_type:admin"],
"products": {
"accounts": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11"
},
"identity": {
"refreshed_at": "2023-02-16T09:14:11",
"last_attempted_at": "2023-02-16T09:14:11",
"settings": { "required": true, "prefetch": false }
}
}
}