Set connection metadata (deprecated)
curl --request POST \
--url https://api.nango.dev/connection/metadata \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nango.dev/connection/metadata"
payload = {
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connection_id: 'connection-123', provider_config_key: '<string>', metadata: {}})
};
fetch('https://api.nango.dev/connection/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nango.dev/connection/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => 'connection-123',
'provider_config_key' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nango.dev/connection/metadata"
payload := strings.NewReader("{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nango.dev/connection/metadata")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/connection/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}{
"message": "<string>"
}Deprecated
Set connection metadata (deprecated)
Set custom metadata for the connection or connections. If updating multiple connections pass in an array of connection ids instead of a string. This endpoint is deprecated, use the /connections/metadata endpoint instead.
POST
/
connection
/
metadata
Set connection metadata (deprecated)
curl --request POST \
--url https://api.nango.dev/connection/metadata \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}
'import requests
url = "https://api.nango.dev/connection/metadata"
payload = {
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connection_id: 'connection-123', provider_config_key: '<string>', metadata: {}})
};
fetch('https://api.nango.dev/connection/metadata', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nango.dev/connection/metadata",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connection_id' => 'connection-123',
'provider_config_key' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.nango.dev/connection/metadata"
payload := strings.NewReader("{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.nango.dev/connection/metadata")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nango.dev/connection/metadata")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": \"connection-123\",\n \"provider_config_key\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"connection_id": "connection-123",
"provider_config_key": "<string>",
"metadata": {}
}{
"message": "<string>"
}Requires an API key with the
environment:connections:update scope. Learn more about API key scopes.Set connection metadata
Nango uses the request body as the new metadata (it must be a JSON object). Note that this overrides any existing metadata. The connection_id must be passed in the body as well. Note that the connection_id can be a single string or an array of strings.Fetching connection metadata
To read the existing metadata of a connection, simply fetch the connection. Your custom metadata is included as part of the returned connection object.Authorizations
An Environment API key from your Nango environment, or an Account API key for account-level endpoints.
Body
application/json
Response
Successfully set the metadata for the connections
Was this page helpful?