patch_team_tag
PATCH
/api/v1/teams/{team_id}/tags/{tag_id}
const url = 'https://example.com/api/v1/teams/1/tags/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"color":"example","name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/teams/1/tags/1";
let payload = json!({ "color": "example", "name": "example" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PATCH \ --url https://example.com/api/v1/teams/1/tags/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "color": "example", "name": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”team_id
required
integer format: int64
Team ID
tag_id
required
integer format: int64
Tag ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
color
string | null
name
string | null
Examplegenerated
{ "color": "example", "name": "example"}Responses
Section titled “Responses”Team tag updated
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
code
required
string
data
object
color
required
string
created_at
required
string
id
required
integer format: int64
name
required
string
normalized_name
required
string
owner_user_id
integer | null format: int64
scope_type
required
标签作用域。
string
sort_order
required
integer format: int32
team_id
integer | null format: int64
updated_at
required
string
usage_count
required
integer format: int64
error
msg
required
string
Example
{ "code": "success", "data": { "scope_type": "personal" }}Unauthorized
Forbidden
Tag not found