Skip to content

Verification methods

Manage DID verification methods (P-256 keypairs) used for attestation signing and PLC operations.

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };
GET /admin/verification-methods

Requires settings:manage permission.

interface VerificationMethod {
id: string;
fragment_id: string;
key_type: string;
public_key_multibase: string;
created_at: string;
}
const response = await fetch("http://127.0.0.1:3000/admin/verification-methods", {
headers,
});
const data: VerificationMethod[] = await response.json();

Response: 200 OK

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"fragment_id": "#attestation",
"key_type": "Multikey",
"public_key_multibase": "zDnae...",
"created_at": "2026-06-27T00:00:00Z"
}
]
POST /admin/verification-methods

Requires settings:manage permission. Generates a new P-256 keypair. The private key is encrypted at rest with AES-256-GCM using TOKEN_ENCRYPTION_KEY.

const response = await fetch("http://127.0.0.1:3000/admin/verification-methods", {
method: "POST",
headers: {
...headers,
"Content-Type": "application/json",
},
body: JSON.stringify({
fragment_id: "#attestation",
}),
});
const data: VerificationMethod = await response.json();
FieldTypeRequiredDescription
fragment_idstringyesDID document fragment identifier, must start with # followed by alphanumerics or underscores

Returns 400 Bad Request for a malformed fragment_id: it must start with #, followed only by letters, digits and underscores. Returns 500 Internal Server Error if TOKEN_ENCRYPTION_KEY isn’t set.

Response: 201 Created

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"fragment_id": "#attestation",
"key_type": "Multikey",
"public_key_multibase": "zDnae...",
"created_at": "2026-06-27T00:00:00Z"
}
DELETE /admin/verification-methods/{fragment_id}

Requires settings:manage permission.

const response = await fetch(
"http://127.0.0.1:3000/admin/verification-methods/%23attestation",
{ method: "DELETE", headers },
);

The fragment_id path parameter is the full fragment including the #, URL-encoded as %23 (e.g. %23attestation for #attestation). Sending it without the # answers 404 Not Found.

Response: 204 No Content. Returns 404 Not Found if no method with that fragment ID exists.