servers
Transfer a server
Move a server to another namespace. The caller must have server write access to both the source namespace and the destination namespace.
POST
/
servers
/
{qualifiedName}
/
transfer
JavaScript
import Smithery from '@smithery/api';
const client = new Smithery({
apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});
const response = await client.servers.transfer('qualifiedName', {
targetNamespace: 'my-team',
targetOrganizationId: 'org_01H1234567890',
});
console.log(response.namespace);curl --request POST \
--url https://api.smithery.ai/servers/{qualifiedName}/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetOrganizationId": "org_01H1234567890",
"targetNamespace": "my-team",
"targetSlug": "weather"
}
'import requests
url = "https://api.smithery.ai/servers/{qualifiedName}/transfer"
payload = {
"targetOrganizationId": "org_01H1234567890",
"targetNamespace": "my-team",
"targetSlug": "weather"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.smithery.ai/servers/{qualifiedName}/transfer",
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([
'targetOrganizationId' => 'org_01H1234567890',
'targetNamespace' => 'my-team',
'targetSlug' => 'weather'
]),
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.smithery.ai/servers/{qualifiedName}/transfer"
payload := strings.NewReader("{\n \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\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.smithery.ai/servers/{qualifiedName}/transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smithery.ai/servers/{qualifiedName}/transfer")
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 \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"namespace": "<string>",
"server": "<string>",
"qualifiedName": "my-team/weather"
}{
"error": "Server not found"
}{
"error": "Server not found"
}{
"error": "Server not found"
}{
"error": "Server not found"
}Authorizations
Smithery API key as Bearer token
Path Parameters
The server's qualified name (e.g. 'namespace/server' or 'namespace' for namespace-only servers). Use %2F to encode the slash.
Body
application/json
Was this page helpful?
⌘I
JavaScript
import Smithery from '@smithery/api';
const client = new Smithery({
apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted
});
const response = await client.servers.transfer('qualifiedName', {
targetNamespace: 'my-team',
targetOrganizationId: 'org_01H1234567890',
});
console.log(response.namespace);curl --request POST \
--url https://api.smithery.ai/servers/{qualifiedName}/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"targetOrganizationId": "org_01H1234567890",
"targetNamespace": "my-team",
"targetSlug": "weather"
}
'import requests
url = "https://api.smithery.ai/servers/{qualifiedName}/transfer"
payload = {
"targetOrganizationId": "org_01H1234567890",
"targetNamespace": "my-team",
"targetSlug": "weather"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.smithery.ai/servers/{qualifiedName}/transfer",
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([
'targetOrganizationId' => 'org_01H1234567890',
'targetNamespace' => 'my-team',
'targetSlug' => 'weather'
]),
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.smithery.ai/servers/{qualifiedName}/transfer"
payload := strings.NewReader("{\n \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\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.smithery.ai/servers/{qualifiedName}/transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smithery.ai/servers/{qualifiedName}/transfer")
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 \"targetOrganizationId\": \"org_01H1234567890\",\n \"targetNamespace\": \"my-team\",\n \"targetSlug\": \"weather\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"namespace": "<string>",
"server": "<string>",
"qualifiedName": "my-team/weather"
}{
"error": "Server not found"
}{
"error": "Server not found"
}{
"error": "Server not found"
}{
"error": "Server not found"
}