Skip to content

Service Identity

Manage the service identity configuration: the DID and identity mode that HappyView uses to identify itself on the atproto network. All endpoints require the settings:manage permission.

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };
GET /admin/service-identity
const 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:

FieldTypeDescription
modestringIdentity mode (see below)
didstring/nullThe service DID
signing_key_encstring/nullEncrypted signing key (present for did_plc)
attached_account_didstring/nullLinked account DID (present for attach_account)
setup_completebooleanWhether identity setup has been completed
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp
ModeDescription
did_webHappyView derives a did:web from its public URL
did_plcHappyView manages its own did:plc identity
attach_accountHappyView uses an existing atproto account’s DID
not_exposedNo service identity is exposed on the network
PUT /admin/service-identity
const 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:

FieldTypeRequiredDescription
modestringYesdid_web, did_plc, attach_account, or not_exposed
didstringNoService DID (required for did_plc)
signing_key_encstringNoEncrypted signing key (for did_plc)
rotation_key_encstringNoEncrypted rotation key (for did_plc)
attached_account_didstringNoAccount DID to attach (for attach_account)

Response: 204 No Content