修改组织信息

更新时间:
复制 MD 格式

修改指定组织的名称等基本信息。

前提条件

已获取阿里云账号或 RAM 用户的 AccessKey,并已为其授予调用本接口所需的 RAM 权限。建议将 AccessKey 配置为环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID 和 ALIBABA_CLOUD_ACCESS_KEY_SECRET,避免明文写入代码。

接口

POST/tokenplan/organization

本接口是阿里云 OpenAPI,采用 AccessKey 签名(签名算法 ACS3-HMAC-SHA256),不支持 Authorization: Bearer {API_KEY} 方式。请求需携带公共请求头 x-acs-action: UpdateOrganization、x-acs-version: 2026-02-10、x-acs-date、x-acs-content-sha256、x-acs-signature-nonce 以及 Authorization。

推荐使用阿里云 SDK 或 OpenAPI Explorer 发起调用,可免去自行计算签名。详细说明见认证。

请求参数

所有参数均通过 Query String 传递。

Namestring可选

组织名称

Descriptionstring可选

组织描述

返回参数

Successboolean

调用接口是否成功:
true:成功
false:失败

Codestring

响应状态码。

Messagestring

响应信息。

Dataobject

业务数据

OrgIdstring

组织 ID

NamespaceIdstring

产品命名空间 ID

Namestring

组织名称

Descriptionstring

组织描述

Statusstring

状态
ACTIVE
FROZEN

OwnerIdstring

组织 Owner 的 UAC 账号 ID

OwnerBizAccountIdstring

组织 Owner 的业务账号标识(ALIYUN 类型为 aliyunUid,SSO 类型为 userIdentifier)

GmtCreatestring

创建时间

GmtModifiedstring

修改时间

HttpStatusCodeinteger

HTTP 状态码

RequestIdstring

请求唯一标识

请求示例

本接口使用阿里云 OpenAPI 签名,下例中 ${SIGNATURE} 需按 ACS3-HMAC-SHA256 算法计算得出,x-acs-date、x-acs-signature-nonce 需替换为实际值。示例 URL 中的中文取值为便于阅读未做编码;实际计算签名时,规范化请求(CanonicalRequest)的 Query String 需按 RFC 3986 对键和取值做百分号编码,否则会返回 SignatureDoesNotMatch。使用阿里云 SDK 时会自动处理。

curl -X POST "https://modelstudio.cn-beijing.aliyuncs.com/tokenplan/organization?Name=新的组织名称&Description=新的组织描述" \
    --header "x-acs-action: UpdateOrganization" \
    --header "x-acs-version: 2026-02-10" \
    --header "x-acs-date: 2026-01-01T12:00:00Z" \
    --header "x-acs-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" \
    --header "x-acs-signature-nonce: ${SIGNATURE_NONCE}" \
    --header "Authorization: ACS3-HMAC-SHA256 Credential=${ALIBABA_CLOUD_ACCESS_KEY_ID},SignedHeaders=host;x-acs-action;x-acs-content-sha256;x-acs-date;x-acs-signature-nonce;x-acs-version,Signature=${SIGNATURE}"
import os

from alibabacloud_modelstudio20260210.client import Client
from alibabacloud_modelstudio20260210 import models
from alibabacloud_tea_openapi import models as open_api_models

config = open_api_models.Config(
    access_key_id=os.environ["ALIBABA_CLOUD_ACCESS_KEY_ID"],
    access_key_secret=os.environ["ALIBABA_CLOUD_ACCESS_KEY_SECRET"],
    endpoint="modelstudio.cn-beijing.aliyuncs.com",
)
client = Client(config)

request = models.UpdateOrganizationRequest(
    name="新的组织名称",
    description="新的组织描述",
)
response = client.update_organization(request)
print(response.body)
import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.sdk.service.modelstudio20260210.AsyncClient;
import com.aliyun.sdk.service.modelstudio20260210.DefaultAsyncClientBuilder;
import com.aliyun.sdk.service.modelstudio20260210.models.UpdateOrganizationRequest;
import com.aliyun.sdk.service.modelstudio20260210.models.UpdateOrganizationResponse;

public class UpdateOrganization {
    public static void main(String[] args) throws Exception {
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
            .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
            .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
            .build());
        AsyncClient client = new DefaultAsyncClientBuilder()
            .credentialsProvider(provider)
            .region("cn-beijing")
            .build();

        UpdateOrganizationRequest request = UpdateOrganizationRequest.builder()
            .name("新的组织名称")
            .description("新的组织描述")
            .build();
        UpdateOrganizationResponse response = client.updateOrganization(request).get();
        System.out.println(response.getBody());
        client.close();
    }
}

返回示例

{
  "Success": true,
  "Data": {
    "OrgId": "org_123456789",
    "NamespaceId": "namespace-1",
    "Name": "组织名称",
    "Description": "组织描述",
    "Status": "ACTIVE",
    "OwnerId": "acc_123456789",
    "OwnerBizAccountId": "1269388320468566",
    "GmtCreate": "2025-12-11T02:19:27Z",
    "GmtModified": "2025-07-08 13:59:11"
  }
}

错误码

如果调用失败,会返回错误信息。更多错误码及解决方法,请参见Token Plan API 错误码。