light-mode-image
Learn
API ReferenceSemantic CWT credentials

Sign a Semantic CWT credential

Roles

adminissuermanaged-issuer

Analytics Events

CREDENTIAL_COMPACT_SEMANTIC_SIGN_STARTCREDENTIAL_COMPACT_SEMANTIC_SIGN_SUCCESSCREDENTIAL_COMPACT_SEMANTIC_SIGN_FAIL
POST/v2/credentials/compact-semantic/sign

Returns a signed Semantic CWT credential generated from a provided valid payload.

Analytic events

  • CREDENTIAL_COMPACT_SEMANTIC_SIGN_START
  • CREDENTIAL_COMPACT_SEMANTIC_SIGN_SUCCESS
  • CREDENTIAL_COMPACT_SEMANTIC_SIGN_FAIL

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

Semantic CWT credential payload to sign

Response Body

application/json

application/json

curl -X POST "https://example.vii.au01.mattr.global/v2/credentials/compact-semantic/sign" \  -H "Content-Type: application/json" \  -d '{    "payload": {      "iss": "did:web:organization.com",      "vc": {        "type": "AlumniCredential",        "credentialSubject": {          "property1": "...",          "property2": "..."        }      }    }  }'
{
  "id": "string",
  "encoded": "CSS:/1/BASE_32_ENCODED_PAYLOAD",
  "decoded": {
    "iss": "did:web:example.com",
    "jti": "...",
    "nbf": 1645743759,
    "exp": 1645743759,
    "iat": 1645743759,
    "aud": "...",
    "sub": "...",
    "vc": {
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://www.w3.org/2018/credentials/examples/v1"
      ],
      "type": [
        "VerifiableCredential",
        "AlumniCredential"
      ],
      "credentialSubject": {
        "property1": "...",
        "property2": "..."
      }
    },
    "status": {
      "url": "...",
      "index": 123
    }
  }
}
{
  "code": "string",
  "message": "string",
  "details": [
    {
      "value": "string",
      "msg": "Invalid value",
      "param": "id",
      "location": "body"
    }
  ]
}

How would you rate this page?