重命名 App
curl --request POST \
--url https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename \
--header 'Content-Type: application/json' \
--data '
{
"new_app_name": "<string>"
}
'import requests
url = "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename"
payload = { "new_app_name": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_app_name: '<string>'})
};
fetch('https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_app_name: '<string>'})
};
fetch('https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename"
payload := strings.NewReader("{\n \"new_app_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
.header("Content-Type", "application/json")
.body("{\n \"new_app_name\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename",
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([
'new_app_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_app_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"new_app_name\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"new_app_name\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
.post(body)
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false{
"app_id": "<string>",
"app_name": "<string>",
"namespace": "<string>"
}发布与运营
重命名 App
修改应用名(路由别名),不发版、不影响进行中的运行。
POST
/
v1
/
data-apps
/
{app_id}
/
rename
重命名 App
curl --request POST \
--url https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename \
--header 'Content-Type: application/json' \
--data '
{
"new_app_name": "<string>"
}
'import requests
url = "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename"
payload = { "new_app_name": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_app_name: '<string>'})
};
fetch('https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({new_app_name: '<string>'})
};
fetch('https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename"
payload := strings.NewReader("{\n \"new_app_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
.header("Content-Type", "application/json")
.body("{\n \"new_app_name\": \"<string>\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename",
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([
'new_app_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_app_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n \"new_app_name\": \"<string>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"new_app_name\": \"<string>\"\n}")
val request = Request.Builder()
.url("https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename")
.post(body)
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()false{
"app_id": "<string>",
"app_name": "<string>",
"namespace": "<string>"
}端点
POST https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/rename
404。
重命名完全开放,不限于零 Release 的 App:应用名是路由别名,重命名不发布版本、不作废旧版本、不影响进行中的运行(所有持久引用都钉 app_id)。
调用方引用失效是开发者自己的责任:旧的 owner/old-name 引用(MCP 钉选、SDK、REST、详情页地址)在重命名后返回干净的 404,不做重定向;历史运行与账单显示新名字。旧名不会被他人在你的命名空间下占用,但你自己以后可以再用它建新 App,届时外部残留引用会指向新 App。建议消费方按 app_id 集成。
校验链与创建身份相同:命名规则 → 保留字 → 新名不等于当前名;与他人的历史绑定冲突为 409 app-name-reserved,与你自己的另一个 App 冲突为 409 app-name-taken。
请求
路径参数
string
必填
App 引用。
请求体
string
必填
—
示例请求
curl -X POST \
-H "Authorization: Bearer $BAZHUAYU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"app_name": "review-lookup"}' \
"https://api-datahub.bazhuayu.com/v1/data-apps/carol/reviews-query/rename"
响应
200 成功
{
"data": {
"app_id": "app_6dfe4e839ccf",
"namespace": "carol",
"app_name": "review-lookup",
"previous_app_name": "reviews-query"
}
}
data 字段中,其内容如下。
string
必填
App 的稳定标识,不变。
string
必填
新名称。
string
发布者用户名。
错误
| HTTP | code | category | 说明 |
|---|---|---|---|
| 401 | unauthorized | forbidden | 缺少或无效的 API Key。 |
| 400 | invalid-app-name | invalid_input | 名称不符合命名规则或是保留字。 |
| 409 | app-name-reserved | forbidden | 该名称被他人的历史绑定占用(用户名易主后的 30 天冻结期)。 |
| 409 | app-name-taken | invalid_input | 你名下已有同名 App。 |
{"error": {code, category, message, retryable}},见错误。
