harness 许可发照(owner/admin):member 径回一次性激活码(hash 入库永不回读);service 径直接 active 无码;一键一照(api_key UNIQUE)
POST
/v1/org-licenses
const url = 'https://api.tansr.com/v1/org-licenses';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"appId":"example","principalType":"member","memberUserId":"example","expiresAt":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tansr.com/v1/org-licenses \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "appId": "example", "principalType": "member", "memberUserId": "example", "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
license
required
object
id
required
string
appId
required
绑定 org 键(api_keys.public_id;UNIQUE 一键一照)
string
epoch
required
许可纪元(revoke/suspend 递增;末端缓存失效锚)
integer
createdAt
required
string
activationCode
一次性激活码(仅 member 径发照回显一次;hash 入库永不回读)
string
Example
{ "license": { "principalType": "member", "status": "issued", "sourceType": "approval" }}Conflict(该键已有照)
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。