Skip to main content
POST
/
connection
/
{connectionId}
/
metadata
Set connection metadata (deprecated)
curl --request POST \
  --url https://api.nango.dev/connection/{connectionId}/metadata \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Provider-Config-Key: <provider-config-key>' \
  --data '{}'
import requests

url = "https://api.nango.dev/connection/{connectionId}/metadata"

payload = {}
headers = {
"Provider-Config-Key": "<provider-config-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'Provider-Config-Key': '<provider-config-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};

fetch('https://api.nango.dev/connection/{connectionId}/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/{connectionId}/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([

]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Provider-Config-Key: <provider-config-key>"
],
]);

$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/{connectionId}/metadata"

payload := strings.NewReader("{}")

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

req.Header.Add("Provider-Config-Key", "<provider-config-key>")
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/{connectionId}/metadata")
.header("Provider-Config-Key", "<provider-config-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.nango.dev/connection/{connectionId}/metadata")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Provider-Config-Key"] = '<provider-config-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "errors": [
      {}
    ]
  }
}
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.

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

Authorization
string
header
required

The secret key from your Nango environment.

Headers

Provider-Config-Key
string
required

The integration ID used to create the connection (aka Unique Key).

Path Parameters

connectionId
string
required

The connection ID used to create the connection.

Body

application/json

The body is of type object.

Response

Successfully created an integrations