NATSoauth.app.create注册应用
Try it 面板需要启用 JavaScript。
注册开放平台应用;生成 clientId 与 clientSecret(secret 仅本次返回,服务端存哈希)。
Request Payload
消息格式:JSON
| Name | Data Type | Required | Description |
|---|---|---|---|
| ownerId | string | Yes | 注册人用户 ID |
| name | string | Yes | 应用名称 |
| homepage | string | No | 应用主页 |
| redirectUris | array | Yes | 允许的回调地址(https) |
| tokenType | string | Yes | 访问令牌形态:jwt / opaque(注册后不可变更) |
| scopes | array | Yes | 申请的 scope 列表 |
type RequestBody = {
/** 注册人用户 ID */
ownerId: string
/** 应用名称 */
name: string
/** 应用主页 */
homepage?: string
/** 允许的回调地址(https) */
redirectUris: string[]
/** 访问令牌形态:jwt / opaque(注册后不可变更) */
tokenType: string
/** 申请的 scope 列表 */
scopes: string[]
}{
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"name": "Xeegam Analytics",
"homepage": "https://analytics.xeegam.com",
"redirectUris": [
"https://analytics.xeegam.com/oauth/callback"
],
"tokenType": "jwt",
"scopes": [
"user:profile:read",
"orgs:list"
]
}Response Payload
回复使用统一信封 {id, code, messages, result},其 result:
| Name | Data Type | Required | Description |
|---|---|---|---|
| appId | string | Yes | 应用 ID |
| clientId | string | Yes | 客户端标识 |
| clientSecret | string | Yes | 客户端密钥(仅此一次完整返回) |
| status | string | Yes | 固定为 pending |
| createdAt | string | Yes | 注册时间 |
type ResponseBody = {
/** 应用 ID */
appId: string
/** 客户端标识 */
clientId: string
/** 客户端密钥(仅此一次完整返回) */
clientSecret: string
/** 固定为 pending */
status: string
/** 注册时间 */
createdAt: string
}{
"appId": "01JD8SNST2N5U6X1BU9YBHK4C7J",
"clientId": "cli_9f2ka81mdx",
"clientSecret": "cs_5Kx9mQeR2vB8wL7pN3tZ6yH4",
"status": "pending",
"createdAt": "2026-10-01T10:00:00Z"
}Response Code
回复使用统一信封 {id, code, messages, result},其 code 字段:
| code | Meaning | Notes |
|---|---|---|
| 0 | 成功 | 注册应用 |
| 2701 | 回调地址无效 | |
| 2704 | scope 无效 |
Examples
{
"ownerId": "01JD8SEGQ0P9N2XK4L7VDH3T6C",
"name": "Xeegam Analytics",
"homepage": "https://analytics.xeegam.com",
"redirectUris": ["https://analytics.xeegam.com/oauth/callback"],
"tokenType": "jwt",
"scopes": ["user:profile:read", "orgs:list"]
}
{
"id": "01JD8SWIWH6J3KG",
"code": 0,
"messages": [],
"result": {
"appId": "01JD8SNST2N5U6X1BU9YBHK4C7J",
"clientId": "cli_9f2ka81mdx",
"clientSecret": "cs_5Kx9mQeR2vB8wL7pN3tZ6yH4",
"status": "pending",
"createdAt": "2026-10-01T10:00:00Z"
}
}