Skip to content

DIDComm API

DIDComm (DID Communication) is a messaging protocol where parties communicate using their DIDs. Unlike REST APIs where a client calls a server, DIDComm enables peer-to-peer messaging between any two parties identified by DIDs.

BaseID Cloud provides a DIDComm relay — you can send and receive DIDComm messages through the API, and the platform tracks protocol threads (multi-step conversations like credential issuance).

Use caseDIDCommREST API
Credential issuanceOffer → Request → Issue (3-step protocol)Single POST /v1/credentials/issue
Presentation exchangeRequest → Present (2-step)Single POST /v1/verify
Connectivity checkTrust-ping → Ping-responseGET /health
Interop with walletsRequired for Aries/DIDComm walletsNot supported by DIDComm wallets

Use DIDComm when interoperating with DIDComm-native wallets (Aries, ACA-Py, BC Wallet). Use the REST API for simpler server-to-server integration.


ProtocolVersionMessage types
Trust Ping2.0ping, ping-response
Issue Credential3.0offer-credential, request-credential, issue-credential
Present Proof3.0request-presentation, presentation

Create and send a DIDComm v2 message.

POST /v1/didcomm/send
Authorization: Bearer <token>

Permission required: didcomm:send

FieldTypeRequiredDescription
actionstringYesProtocol action (see below)
from_didstringYesSender DID
to_didstringYesRecipient DID
bodyobjectNoMessage body — content depends on the protocol
ActionProtocolWhat it does
trust-pingTrust Ping 2.0Send a connectivity check. The recipient should respond with a ping-response.
offer-credentialIssue Credential 3.0Offer a credential to a holder. Include the credential preview in body.
request-presentationPresent Proof 3.0Request a verifiable presentation. Include the proof request in body.

Test connectivity with another DID:

Terminal window
curl -X POST https://api.baseid.cloud/v1/didcomm/send \
-H "Authorization: Bearer bsk_live_..." \
-H "Content-Type: application/json" \
-d '{
"action": "trust-ping",
"from_did": "did:key:z6MkSender",
"to_did": "did:key:z6MkRecipient"
}'
Terminal window
curl -X POST https://api.baseid.cloud/v1/didcomm/send \
-H "Authorization: Bearer bsk_live_..." \
-H "Content-Type: application/json" \
-d '{
"action": "offer-credential",
"from_did": "did:key:z6MkIssuer",
"to_did": "did:key:z6MkHolder",
"body": {
"credential_preview": {
"type": "CanadianDigitalID",
"claims": {"givenName": "Alice", "province": "Ontario"}
}
}
}'
{
"message_id": "msg-abc123",
"thread_id": "msg-abc123",
"type": "https://didcomm.org/trust-ping/2.0/ping",
"status": "sent"
}

Process an incoming DIDComm message. For trust-ping messages, a response is automatically generated.

POST /v1/didcomm/receive
Authorization: Bearer <token>

Permission required: didcomm:receive

A full DIDComm v2 Message object:

{
"id": "msg-xyz",
"type": "https://didcomm.org/trust-ping/2.0/ping",
"from": "did:key:z6MkSender",
"to": ["did:key:z6MkRecipient"],
"body": { "response_requested": true },
"created_time": 1711459200
}
FieldTypeDescription
idstringUnique message identifier
typestringProtocol message type URI
fromstringSender DID
tostring[]Recipient DID(s)
thidstringThread ID — links related messages in a protocol
pthidstringParent thread ID — for nested protocols
bodyobjectProtocol-specific message content
attachmentsarrayBinary or JSON attachments (credentials, proof requests)
created_timenumberUnix timestamp
{
"message_id": "msg-xyz",
"thread_id": "msg-xyz",
"type": "https://didcomm.org/trust-ping/2.0/ping",
"status": "received",
"response": {
"response_id": "msg-resp-abc",
"type": "https://didcomm.org/trust-ping/2.0/ping-response"
}
}

The response field is included when the protocol requires an automatic response (e.g., trust-ping).


DIDComm protocols are multi-step conversations linked by a thread ID. BaseID tracks thread state so you can monitor protocol progress.

GET /v1/didcomm/threads
Authorization: Bearer <token>

Permission required: didcomm:receive

GET /v1/didcomm/threads/:id
Authorization: Bearer <token>
{
"id": "msg-abc123",
"type": "https://didcomm.org/trust-ping/2.0/ping",
"from": "did:key:z6MkSender",
"to": ["did:key:z6MkRecipient"],
"status": "sent",
"created_at": "2026-03-26T12:00:00Z"
}
1. Send offer-credential → thread created (status: sent)
2. Receive request-credential → thread updated (status: received)
3. Send issue-credential → thread updated (status: completed)

DIDComm messages can include attachments for credentials, proof requests, or other binary data:

{
"attachments": [
{
"id": "att-1",
"media_type": "application/json",
"data": {
"json": { "credential": "eyJ..." }
}
}
]
}
FormatFieldUse case
JSON{ "json": {...} }Credential previews, proof requests
Base64{ "base64": "..." }Binary data, CBOR-encoded credentials
Links{ "links": ["https://..."], "hash": "..." }Large files with integrity check