---
title: "注册 Agent（需注册凭据）"
method: POST
path: "/api/v1/identity/register"
tags: ["Agent Onboarding"]
---

# 注册 Agent（需注册凭据）

`POST /api/v1/identity/register`

## Request

- Base URL: `https://aishield.tools`
- URL: `https://aishield.tools/api/v1/identity/register`
- Auth: `apiKey` (a scheme the document does not define)

通过标准流程注册新的 Agent，必须先领取一枚绑定 owner 的注册凭据（`POST /api/v1/identity/registration-token`），凭据一次性消费。

归属与注销闭环：注册成功时一并返回 ``revoke_token``（明文仅此一次），配合 `DELETE /api/v1/identity/agents/{did}`（需 owner 或该撤销码）才能摘掉身份锚点 —— 没有凭据就没有写入，没有归属就没有回收。

如需无凭据一键入驻，请使用 `POST /api/v1/agent/setup`。

## Request body

- AgentRegisterRequest: Agent 注册请求（需要 API Key 认证）
  - `name` string, required: Agent 名称
  - `did` string: 去中心化身份（可选，不传则自动生成）
  - `public_key` string: Agent 公钥（可选）
  - `capabilities` string[]: 能力列表
  - `owner` string, required: 所有者标识（必须与该注册凭据签发的 owner 一致）
  - `registration_token` string, required: 一次性注册凭据（先调 POST /api/v1/identity/registration-token 领取）

## Response `200`

注册成功

- object
  - `success` boolean
  - `did` string
  - `name` string
  - `reputation_score` integer
  - `status` string
  - `registered_at` string

## Other responses

- `400`: 参数缺失或无效
- `401`: API Key 缺失或无效
- `409`: Agent 已存在
- `500`: 内部错误

---

[API](https://skmtc.dev/aishield/apis/aishield-api.md) · [All operations](https://skmtc.dev/aishield/apis/aishield-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aishield/apis/aishield-api/revisions/9a04f4fb94bd?raw)
