curl --request PATCH \
--url https://melso.ai/api/areas/{id}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_kind": "<string>",
"connection_ref": "<string>",
"enabled": true,
"owner_user_id": "<string>",
"visibility": "<string>"
}
'import requests
url = "https://melso.ai/api/areas/{id}/connections"
payload = {
"connection_kind": "<string>",
"connection_ref": "<string>",
"enabled": True,
"owner_user_id": "<string>",
"visibility": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_kind: '<string>',
connection_ref: '<string>',
enabled: true,
owner_user_id: '<string>',
visibility: '<string>'
})
};
fetch('https://melso.ai/api/areas/{id}/connections', 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://melso.ai/api/areas/{id}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'connection_kind' => '<string>',
'connection_ref' => '<string>',
'enabled' => true,
'owner_user_id' => '<string>',
'visibility' => '<string>'
]),
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://melso.ai/api/areas/{id}/connections"
payload := strings.NewReader("{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://melso.ai/api/areas/{id}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/areas/{id}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available_accounts": [
{
"id": "<string>",
"connected_account_id": "<string>",
"toolkit_slug": "<string>",
"status": "<string>",
"connected_at": "<string>",
"last_used_at": "<string>",
"owner_user_id": "<string>",
"is_owner": true,
"shared_with_workspace": true,
"account_identity": "<string>",
"account_label": "<string>",
"description": "<string>",
"scopes": [
"<string>"
]
}
],
"company_commit_sha": "<string>",
"connections": [
{
"area_id": "<string>",
"connection_kind": "<string>",
"connection_ref": "<string>",
"owner_user_id": "<string>",
"visibility": "<string>",
"enabled": true,
"created_at": "<string>"
}
],
"selected_account_ids": [
"<string>"
],
"selected_mcp_server_ids": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Set area connection
An Agents company and company definition write permission are required: owner/admin, or an admin company API key only on its allowed Area routes. Other company types receive 403 agents_only. Resource access also applies.
Request: {connection_kind:string,connection_ref:string,owner_user_id:UUID,visibility:"private"|"shared",enabled:boolean}. Changes only this connection; other grants remain unchanged. The account must be active when enabling it. Disabling an unavailable account is allowed.
Response: Connection list response.
Status: 200; 400 invalid connection; 403 machine credential, account ownership or MCP administration denied; 404 Area/server unavailable; 409 account unavailable or grant ownership changed. Authentication and resource-access errors follow Overview.
curl --request PATCH \
--url https://melso.ai/api/areas/{id}/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_kind": "<string>",
"connection_ref": "<string>",
"enabled": true,
"owner_user_id": "<string>",
"visibility": "<string>"
}
'import requests
url = "https://melso.ai/api/areas/{id}/connections"
payload = {
"connection_kind": "<string>",
"connection_ref": "<string>",
"enabled": True,
"owner_user_id": "<string>",
"visibility": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_kind: '<string>',
connection_ref: '<string>',
enabled: true,
owner_user_id: '<string>',
visibility: '<string>'
})
};
fetch('https://melso.ai/api/areas/{id}/connections', 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://melso.ai/api/areas/{id}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'connection_kind' => '<string>',
'connection_ref' => '<string>',
'enabled' => true,
'owner_user_id' => '<string>',
'visibility' => '<string>'
]),
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://melso.ai/api/areas/{id}/connections"
payload := strings.NewReader("{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://melso.ai/api/areas/{id}/connections")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://melso.ai/api/areas/{id}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_kind\": \"<string>\",\n \"connection_ref\": \"<string>\",\n \"enabled\": true,\n \"owner_user_id\": \"<string>\",\n \"visibility\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"available_accounts": [
{
"id": "<string>",
"connected_account_id": "<string>",
"toolkit_slug": "<string>",
"status": "<string>",
"connected_at": "<string>",
"last_used_at": "<string>",
"owner_user_id": "<string>",
"is_owner": true,
"shared_with_workspace": true,
"account_identity": "<string>",
"account_label": "<string>",
"description": "<string>",
"scopes": [
"<string>"
]
}
],
"company_commit_sha": "<string>",
"connections": [
{
"area_id": "<string>",
"connection_kind": "<string>",
"connection_ref": "<string>",
"owner_user_id": "<string>",
"visibility": "<string>",
"enabled": true,
"created_at": "<string>"
}
],
"selected_account_ids": [
"<string>"
],
"selected_mcp_server_ids": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Company API key (mwk_) or personal access token (mel_). A PAT requires X-Workspace-ID on company-scoped routes. An API key implies its own company.
Headers
Company UUID for a personal token on company-scoped operations. A company API key already binds its company.
Path Parameters
id from the corresponding authorized response.