DIDTta API Documentation

Explore our RESTful API endpoints for decentralized identity management, verifiable credentials, and cryptographic operations in the DIDTta ecosystem.

Authentication

API Auth Header

All requests must include an API key in the Authorization header in the format:

Authorization: Bearer <your_api_key>

Your API key is available in the dashboard settings under Identity Management

Requests without a valid API key will receive a 401 Unauthorized response

Core Endpoints

Create DID Document

POST
/api/v1/identities

Request Body

{
  "method": "ethr",
  "network": "ethereum",
  "keyType": "secp256k1"
}
                        

Response

{
  "id": "did:ethr:0x33f2d42b3a3f3",
  "created": "2025-09-15T14:30:00Z",
  "publicKey": "3FjNW4j3vqkK8vDpR2gPq5wv2Ej6w4qB6Rv8VpR2gPq5wv2Ej6w4q",
  "proof": "S2NzU...exampleproof..."
}
                        

Returns fully formed DID document with cryptographic proofs

Verify Credential

POST
/api/v1/verify

Request Body

{
  "credential": "{...jsonld...}",
  "proof": "{...signature...}"
}
                        

Response

{
  "valid": true,
  "verificationTime": "2025-09-15T14:30:00Z",
  "error": null
}
                        

Verifies W3C credentials against stored cryptographic proofs

Advanced Operations

Anchor DID

PUT
/api/v1/identities/{did}/anchor

This method cryptographically anchors a DID to a blockchain

  • Validates cryptographic proofs against DID document
  • Deploys identity contract to Ethereum/Polygon networks
  • Generates anchor hash commitment

Revoke Credential

DELETE
/api/v1/credentials/{id}

Requires ownership proof via private key signature

  • Updates revocation registry index
  • Emits blockchain event for audit trail
  • Returns cryptographic proof of revocation

Error Handling

400 Bad Request

Malformed JSON or invalid parameters

{
  "error": "Invalid DID format",
  "path": "/api/v1/identities",
  "code": "BAD_REQUEST"
}
                        

401 Unauthorized

Missing or invalid authentication token

{
  "error": "Authorization header required",
  "code": "UNAUTHORIZED"
}
                        

Example: Create a DID


curl -X POST https://api.didtta.network/api/v1/identities \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "method": "ion",
    "keyType": "Ed25519"
 }'

This example demonstrates creating a DID using the ion method with Ed25519 key type.

Response:

{ "id": "did:ion:8f67...example...2e33", "created": "2025-09-15T15:22:35Z", "validTo": "2030-09-15T15:22:35Z" }