# Verifiable Credential

Please [generate access token](https://docs.hypersign.id/hypersign-ssi/api-doc/authentication) before proceeding.  Once you generated the `access_token`, you can pass this token as  *<mark style="background-color:yellow;">bearer authorization token</mark>*  in the header for all APIs.&#x20;

### Issue a verifiable credential

An issuer may issue a [verifiable credential](https://docs.hypersign.id/core-concepts/verifiable-credential-vc) to a subject using this API. The credential document is signed by issuer's identity key and its status is registered on the blockchain.&#x20;

{% hint style="info" %}
Entity Studio SSI API base URL: <https://api.entity.hypersign.id>
{% endhint %}

{% openapi src="<https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2F7SWcw0078CGMGkrodrYh%2Fapi-json.json?alt=media&token=10361f3f-4c5b-44d6-b6af-39fbac2cc67e>" path="/api/v1/credential/issue" method="post" %}
[api-json.json](https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2F7SWcw0078CGMGkrodrYh%2Fapi-json.json?alt=media\&token=10361f3f-4c5b-44d6-b6af-39fbac2cc67e)
{% endopenapi %}

{% hint style="info" %}
NOTE: A developer may choose to store the verifiable credential in application's data vault securely or they may not to. Pass `true` for request body property `persist` to store the credential document, `false` otherwise.
{% endhint %}

### Verify an issued verifiable credential document

A signed verifiable credential must has signature of the issuer. Any one may verify an issued credential document. The verification result state the following facts:

> * *This document was issued by intended issuer*
> * *This document have not been tampered*
> * *This document have not been revoked*

{% openapi src="<https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media&token=695305b2-cc3b-400b-9c46-54606891a2d7>" path="/api/v1/credential/verify" method="post" %}
[api-json.json](https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media\&token=695305b2-cc3b-400b-9c46-54606891a2d7)
{% endopenapi %}

{% hint style="info" %}
NOTE: Verifying a credential document is different than verifying a [verifiable presentatio](https://docs.hypersign.id/hypersign-ssi/api-doc/verifiable-presentation)n. Verification result of later, also states that "*Only intended subject holds this document and not one else*".&#x20;
{% endhint %}

### Fetch a verifiable credential and/or its status by Id

{% openapi src="<https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media&token=695305b2-cc3b-400b-9c46-54606891a2d7>" path="/api/v1/credential/{credentialId}" method="get" %}
[api-json.json](https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media\&token=695305b2-cc3b-400b-9c46-54606891a2d7)
{% endopenapi %}

{% hint style="info" %}
Pass `false` value to parameter `retrieveCredential` to only retrieve status of  the credential
{% endhint %}

### Fetch list of verifiable credentials

{% openapi src="<https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media&token=695305b2-cc3b-400b-9c46-54606891a2d7>" path="/api/v1/credential" method="get" %}
[api-json.json](https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media\&token=695305b2-cc3b-400b-9c46-54606891a2d7)
{% endopenapi %}

### Update credential status of a verifiable credential

{% openapi src="<https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media&token=695305b2-cc3b-400b-9c46-54606891a2d7>" path="/api/v1/credential/status/{credentialId}" method="patch" %}
[api-json.json](https://1497651738-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MOLDOibYYcG4PCSEDDL%2Fuploads%2FjYVydJufhHpdtxi9oslY%2Fapi-json.json?alt=media\&token=695305b2-cc3b-400b-9c46-54606891a2d7)
{% endopenapi %}
