Resolve accounts for display in admin tools.
const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };const TOKEN = "hv_..."; // your API keyconst headers = { Authorization: `Bearer ${TOKEN}` };let token = "hv_..."; // your API keyconst token = "hv_..." // your API key# All examples assume $TOKEN is an API key (hv_...)AUTH="Authorization: Bearer $TOKEN"
Resolve a handle or DID
Section titled “Resolve a handle or DID”GET /admin/identity/resolve?identifier=<handle-or-did>Requires authentication. No specific permission is needed.
interface ResolvedIdentity { did: string; handle: string | null; display_name?: string; // with profile=true avatar?: string; // with profile=true}
const params = new URLSearchParams({ identifier: "alice.bsky.social" });const response = await fetch( `http://127.0.0.1:3000/admin/identity/resolve?${params}`, { headers },);const data: ResolvedIdentity = await response.json();const params = new URLSearchParams({ identifier: "alice.bsky.social" });const response = await fetch( `http://127.0.0.1:3000/admin/identity/resolve?${params}`, { headers },);const data = await response.json();let client = reqwest::Client::new();let response = client .get("http://127.0.0.1:3000/admin/identity/resolve") .query(&[("identifier", "alice.bsky.social")]) .bearer_auth(token) .send() .await?;let data: serde_json::Value = response.json().await?;req, _ := http.NewRequest("GET", "http://127.0.0.1:3000/admin/identity/resolve?identifier=alice.bsky.social", nil)req.Header.Set("Authorization", "Bearer "+token)resp, err := http.DefaultClient.Do(req)if err != nil { log.Fatal(err)}defer resp.Body.Close()curl "http://127.0.0.1:3000/admin/identity/resolve?identifier=alice.bsky.social" -H "$AUTH"| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | yes | A handle (a leading @ is allowed) or a DID |
profile | bool | no | true also returns display_name and avatar |
Response: 200 OK
{ "did": "did:plc:abc123", "handle": "alice.bsky.social"}handle is null unless the DID document lists the handle in alsoKnownAs and the handle resolves to the same DID. A returned handle is in lowercase.
profile=true adds display_name and avatar from the account’s app.bsky.actor.profile record. avatar is a com.atproto.sync.getBlob URL on the account’s PDS. A field the record doesn’t set is left out. Both are left out when the account has no profile record or its PDS can’t be reached, and the request still succeeds.
Errors use two statuses. 400 means the input can’t succeed as given: it’s malformed, the handle doesn’t resolve, or the DID document is missing, forbidden or invalid. 502 means the failure is on the network side and a later attempt may work: resolution ran past 10 seconds, the DID document host was unreachable, or it rate limited the lookup. The error names the identifier and a general reason, never the underlying network error.
© HappyProto

