Admin API
Service Identity
Manage the service identity configuration: the DID and identity mode that HappyView uses to identify itself on the AT Protocol network. All endpoints require the settings:manage permission.
const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };Get service identity
GET /admin/service-identityconst response = await fetch("http://127.0.0.1:3000/admin/service-identity", {
headers,
});
const data = await response.json();Returns the current service identity configuration, or null if no identity has been configured.
Response:
| Field | Type | Description |
|---|---|---|
mode | string | Identity mode (see below) |
did | string/null | The service DID |
signing_key_enc | string/null | Encrypted signing key (present for did_plc) |
attached_account_did | string/null | Linked account DID (present for attach_account) |
setup_complete | boolean | Whether identity setup has been completed |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
Identity modes
| Mode | Description |
|---|---|
did_web | HappyView derives a did:web from its public URL |
did_plc | HappyView manages its own did:plc identity |
attach_account | HappyView uses an existing AT Protocol account's DID |
not_exposed | No service identity is exposed on the network |
Update service identity
PUT /admin/service-identityconst response = await fetch("http://127.0.0.1:3000/admin/service-identity", {
method: "PUT",
headers: {
...headers,
"Content-Type": "application/json",
},
body: JSON.stringify({
mode: "did_web",
}),
});Input:
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Yes | did_web, did_plc, attach_account, or not_exposed |
did | string | No | Service DID (required for did_plc) |
signing_key_enc | string | No | Encrypted signing key (for did_plc) |
rotation_key_enc | string | No | Encrypted rotation key (for did_plc) |
attached_account_did | string | No | Account DID to attach (for attach_account) |
Response: 204 No Content