委托写面(owner):能力词表闭集(ceiling.manage/approval.decide/license.manage/budget.manage/policy.manage);恒带 expiresAt(无永久委托);expiresAt=null 撤销(幂等);恒审计
PUT
/v1/org-delegations
const url = 'https://api.tansr.com/v1/org-delegations';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"granteeUserId":"example","capability":"ceiling.manage","expiresAt":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.tansr.com/v1/org-delegations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "granteeUserId": "example", "capability": "ceiling.manage", "expiresAt": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-tansr-org
string
Org 作用域声明(org 公开 id);服务端校验成员资格与角色,非成员恒 404、角色不够 403
Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”委托档(写后)
Media typeapplication/json
object
delegation
required
撤销后 null
object | null
Examplegenerated
{ "delegation": "example"}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。