Skip to main content
GET
/
v1
/
credential
/
{credentialId}
Get Credential
curl --request GET \
  --url https://api.example.com/v1/credential/{credentialId}
{
  "credential": {
    "id": "507f1f77bcf86cd799439011",
    "resourceType": "DOCUMENT",
    "status": "PENDING",
    "proofs": [
      "<array>"
    ],
    "data": [
      {
        "label": "Consent statement",
        "type": "string",
        "value": "I consent to the terms and conditions",
        "hidden": false,
        "fields": [
          {}
        ]
      }
    ],
    "name": "Identity Document",
    "internalId": "internal-12345"
  },
  "w3cCredential": {
    "@context": [
      "https://www.w3.org/ns/credentials/v2",
      "https://humanos.id/schemas/credential/v1"
    ],
    "id": "https://humanos.id/credentials/crd_abc123",
    "type": [
      "VerifiableCredential"
    ],
    "issuer": "did:web:humanos.id",
    "issuanceDate": "2025-01-01T00:00:00Z",
    "validFrom": "2025-01-01T00:00:00Z",
    "validUntil": "2026-01-01T00:00:00Z",
    "credentialSubject": {
      "id": "did:key:z6MkExample123",
      "data": [
        {
          "label": "pdf",
          "type": "pdf",
          "value": "JVBERi0xLjQKJeLjz9...",
          "hidden": false
        }
      ]
    },
    "proof": [
      {
        "type": "DataIntegrityProof",
        "cryptosuite": "eddsa-jcs-2022",
        "proofPurpose": "assertionMethod",
        "verificationMethod": "did:web:humanos.id#key-1",
        "proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz",
        "actionType": "CREATE",
        "actionProof": "0x1234567890abcdef",
        "createdAt": "2025-01-01T00:00:00Z"
      }
    ]
  },
  "pdf": "JVBERi0xLjQKJeLjz9..."
}

Path Parameters

credentialId
string
required

Unique identifier of the credential. Must be a valid MongoDB ObjectId.

Example:

"507f1f77bcf86cd799439011"

Query Parameters

includePdf
boolean
default:false

Whether to include the PDF content for document type credentials

Example:

false

Response

Returns the W3C Verifiable Credential structure, internalId and optionallly the PDF content in its most updated version

credential
CredentialFullEntity · object
required

Credential full entity

w3cCredential
W3CVerifiableCredential · object
required

W3C Verifiable Credential in JSON-LD format

Example:
{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://humanos.id/schemas/credential/v1"
  ],
  "id": "https://humanos.id/credentials/crd_abc123",
  "type": ["VerifiableCredential"],
  "issuer": "did:web:humanos.id",
  "issuanceDate": "2025-01-01T00:00:00Z",
  "validFrom": "2025-01-01T00:00:00Z",
  "validUntil": "2026-01-01T00:00:00Z",
  "credentialSubject": {
    "id": "did:key:z6MkExample123",
    "data": [
      {
        "label": "pdf",
        "type": "pdf",
        "value": "JVBERi0xLjQKJeLjz9...",
        "hidden": false
      }
    ]
  },
  "proof": [
    {
      "type": "DataIntegrityProof",
      "cryptosuite": "eddsa-jcs-2022",
      "proofPurpose": "assertionMethod",
      "verificationMethod": "did:web:humanos.id#key-1",
      "proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz",
      "actionType": "CREATE",
      "actionProof": "0x1234567890abcdef",
      "createdAt": "2025-01-01T00:00:00Z"
    }
  ]
}
pdf
string

Base64-encoded PDF document (only included when includePdf=true and resource type is DOCUMENT)

Example:

"JVBERi0xLjQKJeLjz9..."