Trust API
Add attestation
Section titled “Add attestation”Add a reputation attestation to the trust graph.
POST /v1/trust/attestationsAuthorization: Bearer <token>Permission required: trust:attest
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
issuer_did | string | Yes | DID of the attester |
subject_did | string | Yes | DID being attested |
domain | string | Yes | Trust domain (e.g., identity, education) |
score | integer | Yes | Reputation score (0-100) |
weight | number | No | Weight (0.0-1.0, default: 1.0) |
evidence | string[] | No | Evidence references |
Response
Section titled “Response”{ "id": "edge-0", "issuer": "did:key:z6MkIssuer", "subject": "did:key:z6MkSubject", "domain": "identity", "score": 85, "weight": 1.0}Get attestations
Section titled “Get attestations”List all attestations for a subject DID.
GET /v1/trust/attestations/:didAuthorization: Bearer <token>Permission required: trust:query
Compute trust score
Section titled “Compute trust score”Compute a trust score for a DID in a domain.
GET /v1/trust/score/:did?domain=identity&algorithm=directAuthorization: Bearer <token>Permission required: trust:query
Query parameters
Section titled “Query parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
domain | string | general | Trust domain |
algorithm | string | direct | direct, transitive, weighted |
Response
Section titled “Response”{ "subject": "did:key:z6Mk...", "domain": "identity", "score": 85.0, "confidence": 1.0, "direct_count": 3, "transitive_count": 0}Algorithms
Section titled “Algorithms”| Algorithm | Description |
|---|---|
direct | Average of direct attestations only |
transitive | PageRank-style with damping factor (0.85) |
weighted | Reputation-weighted traversal (depth 3) |
Create delegation
Section titled “Create delegation”Delegate scoped access to a credential.
POST /v1/trust/delegateAuthorization: Bearer <token>Permission required: trust:attest
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
credential_ref | string | Yes | Reference to the credential being delegated |
delegator_did | string | Yes | Delegator’s DID (must belong to your tenant) |
delegate_did | string | Yes | Delegate’s DID |
purpose | string | Yes | Delegation purpose |
allowed_claims | string[] | Yes | Which claims the delegate can access |
max_depth | integer | No | Max re-delegation depth |
valid_seconds | integer | No | Validity duration in seconds |
Response
Section titled “Response”{ "token_id": "tok-abc123", "delegator": "did:key:z6MkDelegator", "delegate": "did:key:z6MkDelegate", "depth": 0, "scope": { "purpose": "age verification", "allowed_claims": ["dateOfBirth", "age_over_18"], "max_depth": 1, "valid_until": "2026-04-26T12:00:00Z" }}Verify delegation
Section titled “Verify delegation”Verify a delegation token and chain.
POST /v1/trust/verify-delegationAuthorization: Bearer <token>Permission required: trust:query
Request body
Section titled “Request body”{ "token": { "id": "tok-abc123", "delegator": "...", "delegate": "...", "..." }}Response
Section titled “Response”{ "valid": true, "delegator": "did:key:z6MkDelegator", "delegate": "did:key:z6MkDelegate", "depth": 0, "chain_length": 1}See also
Section titled “See also”- Trust & Delegation concept — trust graphs, scoring, delegation model
- DIDs concept — DID-based identities in the trust graph
- Compliance API — regulatory trust requirements