# Credential status (DCP)

{% hint style="info" %}
Specifications and best practice implementations for Verifiable Credentials are currently being developed. This page is expected to be updated, closely following these developments.
{% endhint %}

The `GET` request to the `/requests/{requestId}` endpoint requests the status of a credential issuance process.

{% hint style="info" %}
The `GET` request to the `/requests/{requestId}` is an **OPTIONAL** endpoint and is part of the iSHARE Framework's Verifiable Credentials support in line with the **Decentralised Claims Protocol (DCP)**.
{% endhint %}

## Get credential request status

> Retrieves the status of a credential request. This endpoint is used to check the processing status of a previously submitted credential request. The request ID is provided in the Location header of the 201 response from the /credentials endpoint. More information in the  \[DCP specification]\(<https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#credential-request-status-api>).

```json
{"openapi":"3.1.0","info":{"title":"iSHARE Decentralized Claims Protocol (DCP) API specifications","version":"3.0"},"tags":[{"name":"Issuer","description":"Endpoints relevant for the VC Issuer role (e.g., issuing credentials, issuer metadata)."}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"iSHARE JWT Bearer token authentication"}}},"paths":{"/requests/{requestId}":{"get":{"tags":["Issuer"],"summary":"Get credential request status","description":"Retrieves the status of a credential request. This endpoint is used to check the processing status of a previously submitted credential request. The request ID is provided in the Location header of the 201 response from the /credentials endpoint. More information in the  [DCP specification](https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/#credential-request-status-api).","operationId":"get-credential-request-status","parameters":[{"name":"requestId","in":"path","required":true,"description":"Unique identifier of the credential request","schema":{"type":"string","format":"uri"}}],"responses":{"200":{"description":"Credential request status retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/x-ext/e780916"}}}},"401":{"description":"Unauthorized - Invalid or missing authentication"},"404":{"description":"Credential request not found"},"500":{"description":"Internal Server Error"}}}}}}
```

### Request model

The request contains a {requestId} parameter in the URL. This {requestId} corresponds to the ID identified by the location header returned after a [Credential Issuance message](https://dev.ishare.eu/all-roles-common-endpoints/m2m-verifiable-credential-endpoints/credential-issuance-dcp).

### Example request

```json
GET /credentials/3cc1e9be-99d0-43fc-bb48-1f60837163bd HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
```

### Response model

The model for the CredentialStatus is defined in: <https://eclipse-dataspace-dcp.github.io/decentralized-claims-protocol/v1.0/resources/issuance/credential-request-message-schema.json>.

* `@context`\
  **Array of Strings**. Root level. <mark style="color:red;">(Required)</mark>\
  Specifies a valid Json-Ld context. Must contain `"https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"`
* `type`\
  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  A string specifying the CredentialStatus type. Must contain `"CredentialStatus"`
* `issuerPid`\
  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  A string corresponding to the issuance id on the Issuer side.
* `holderPid`\
  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  A string corresponding to the request id on the Holder side.
* `status`\
  **String**. Root level. <mark style="color:red;">(Required)</mark>\
  A string with a value of `RECEIVED`, `REJECTED`, or `ISSUED`.

### Example response

```json
{
  "@context": [
    "https://w3id.org/dspace-dcp/v1.0/dcp.jsonld"
  ],
  "type": "CredentialStatus",
  "issuerPid": "issuerPid",
  "holderPid": "holderPid",
  "status": "RECEIVED"
}
```
