Update Link

Update Link

Updates the link configuration.

URL

PATCH
/links/{id}
Request
curl --request PATCH \
--url https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
--header 'content-type: application/json' \
--data '{"webhook":"https://example.com/updated/hook","tags":["smoke_test","user_type:admin"]}'
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer REPLACE_BEARER_TOKEN',
'content-type': 'application/json'
},
body: '{"webhook":"https://example.com/updated/hook","tags":["smoke_test","user_type:admin"]}'
};

fetch('https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests

url = "https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV"

payload = {
"webhook": "https://example.com/updated/hook",
"tags": ["smoke_test", "user_type:admin"]
}
headers = {
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"content-type": "application/json"
}

response = requests.request("PATCH", url, json=payload, headers=headers)

print(response.text)
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV"

payload := strings.NewReader("{\"webhook\":\"https://example.com/updated/hook\",\"tags\":[\"smoke_test\",\"user_type:admin\"]}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer REPLACE_BEARER_TOKEN")
req.Header.Add("content-type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'
request["content-type"] = 'application/json'
request.body = "{\"webhook\":\"https://example.com/updated/hook\",\"tags\":[\"smoke_test\",\"user_type:admin\"]}"

response = http.request(request)
puts response.read_body
import Foundation

let headers = [
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"content-type": "application/json"
]
let parameters = [
"webhook": "https://example.com/updated/hook",
"tags": ["smoke_test", "user_type:admin"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moneykit.com/links/mk_eqkWN34UEoa2NxyALG8pcV")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})

dataTask.resume()
Response
{
"link_id": "mk_eqkWN34UEoa2NxyALG8pcV",
"institution_id": "chase",
"institution_name": "Chase",
"institution_avatar": "https://example.com/avatar.png",
"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
}
}
}
}
{
"error_code": "api_error.auth.expired_access_token",
"error_message": "Access token expired",
"documentation_url": string
}
{
"error_code": "link_error.forbidden_action",
"error_message": "Accounts access not permitted",
"documentation_url": string
}
{
"error_code": "link_error.not_found",
"error_message": "Link not found.",
"documentation_url": string
}
{
"error_code": "link_error.deleted",
"error_message": "Link deleted.",
"documentation_url": string
}
{
"error_code": "link_error.bad_state",
"error_message": string,
"documentation_url": string,
"link_error_code": string
}
{
"error_code": "api_error.rate_limit_exceeded",
"error_message": "Rate limit exceeded",
"documentation_url": string
}

tags

: array

Arbitrary strings used to describe this link.

example: smoke_test

example: user_type:admin

webhook

: string

Sets the webhook URL for this link. To remove a webhook for this link, set to null.

format:

uri

min length:

1

max length:

65536

example: https://example.com/updated/hook

id

: string

required

The unique ID for this link.

example: mk_eqkWN34UEoa2NxyALG8pcV

Responses

200

Updated link.

institution_id

: string

required

The unique ID for the institution this link is connected to.

example: chase

institution_name

: string

required

The institution name this link is connected to.

example: Chase

institution_avatar

: string

required

An avatar image for the link's institution.

example: https://example.com/avatar.png

state

: string

required

An enumeration.

connecting awaiting_token_exchange connected deleted error

example: connected

Allowed values:

"connecting"

"awaiting_token_exchange"

"connected"

"deleted"

"error"

error_code

: string

required

An enumeration.

system_error provider_error institution_error user_error auth_expired incomplete

Allowed values:

"system_error"

"provider_error"

"institution_error"

"user_error"

"auth_expired"

"incomplete"

last_synced_at

: string

required

An ISO-8601 timestamp indicating the last time that the account was updated.

format:

date-time

example: 2023-02-16T09:14:11

tags

: array

required

Arbitrary strings used to describe this link.

example: smoke_test

example: user_type:admin

example: user_type:admin

products

: object

required

The granted products available for this link.

available_products

: array

required

A list of products that could be added to this link. Products can be added to (and removed from) an existing link by creating a new /link-session and supplying the existing_link_id with a new set of products.

example: account_numbers

Allowed values:

"accounts"

"account_numbers"

"identity"

"transactions"

"investments"

provider

: string

required

An enumeration.

moneykit finicity plaid yodlee mx akoya sophtron

example: mx

Allowed values:

"moneykit"

"finicity"

"plaid"

"yodlee"

"mx"

"akoya"

"sophtron"

webhook

: string

required

The webhook url assigned to this link.

example: https://example.com/webhook

401

Invalid access_token or insufficent API client scope or unauthorized link access.

403

Forbidden by link owner. The user did not give permission to access this data when linking.

error_code

: string

required

link_error.forbidden_action

default: "link_error.forbidden_action"

Allowed values:

"link_error.forbidden_action"

error_message

: string

required

Error message

example: Accounts access not permitted

documentation_url

: string

required

404

Link not found.

error_code

: string

required

link_error.not_found

default: "link_error.not_found"

Allowed values:

"link_error.not_found"

error_message

: string

required

default: "Link not found."

documentation_url

: string

required

410

Link deleted.

error_code

: string

required

link_error.deleted

default: "link_error.deleted"

Allowed values:

"link_error.deleted"

error_message

: string

required

default: "Link deleted."

documentation_url

: string

required

422

Link error.

error_code

: string

required

link_error.bad_state

default: "link_error.bad_state"

Allowed values:

"link_error.bad_state"

error_message

: string

required

documentation_url

: string

required

429

Rate limit exceeded.

error_code

: string

required

api_error.rate_limit_exceeded

default: "api_error.rate_limit_exceeded"

Allowed values:

"api_error.rate_limit_exceeded"

error_message

: string

required

Error message

default: "Rate limit exceeded"

documentation_url

: string

required