Back to Smithery

Transfer a server

docs-api-reference-servers-transfer-a-server.md

latest8.1 KB
Original Source

POST

/

servers

/

{qualifiedName}

/

transfer

Try it

JavaScript

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

200

400

403

404

409

{
  "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

[​

](#authorization-authorization)

Authorization

string

header

required

Smithery API key as Bearer token

Path Parameters

[​

](#parameter-qualified-name)

qualifiedName

string

required

The server's qualified name (e.g. 'namespace/server' or 'namespace' for namespace-only servers). Use %2F to encode the slash.

Body

application/json

[​

](#body-target-organization-id)

targetOrganizationId

string

required

Minimum string length: 1

Example:

"org_01H1234567890"

[​

](#body-target-namespace)

targetNamespace

string

required

Minimum string length: 1

Example:

"my-team"

[​

](#body-target-slug)

targetSlug

string

Example:

"weather"

Response

200

application/json

Server transferred

[​

](#response-success)

success

boolean

required

[​

](#response-namespace)

namespace

string

required

[​

](#response-server)

server

string

required

[​

](#response-qualified-name)

qualifiedName

string

required

Example:

"my-team/weather"

Was this page helpful?

YesNo

⌘I

JavaScript

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

200

400

403

404

409

{
  "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"
}