# Check Bitstring Status List

Using the `/credential-status/check` API, users are able to query specific Credential indices within a Status List to ascertain whether the Credential is revoked, suspended or currently valid.

## Step 1: Set parameters for check

Using the `/credential-status/check` API, users have two options for checking whether a particular Credential index is revoked or suspended:

1. **Filling out a simple form** using the `application/x-www-url-form-encoded` option on the Swagger UI.
2. **Compiling a DID Document body yourself** using the `application/json` option on the Swagger UI.

### Option 1. Choose from a few variables

This is the easiest way to check whether a particular credential index is revoked or suspended.

&#x20;Using the `application/x-www-url-form-encoded` option on the Swagger UI, users are able to choose between the following variables to compile your DID:

<details>

<summary>statusPurpose</summary>

The purpose of the status list that has already been created on-ledger. Can be:

* revocation
* suspension

</details>

<details>

<summary>did</summary>

DID of the StatusList2021 publisher, or the DID linked to the Status List resources. For example:

```json
did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
```

</details>

<details>

<summary>statusListName</summary>

The name of the existing Status List resource to be checked. For example:

<pre><code><strong>employmentCredentialRevocationList
</strong></code></pre>

</details>

<details>

<summary>index</summary>

The index within the bitstring that the user wants to query. For example:

<pre><code><strong>10
</strong></code></pre>

</details>

### Make Fee Payment

To automatically make a payment to an Issuer in order to verify an encrypted Status List, follow the tutorial here:

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Verifier pays Issuer</strong></mark></td><td>Understand how a Verifier pays an Issuer to decrypt an encrypted Status List and verify a Credential Status.</td><td><a href="../../payments/verifier-pays-issuer">verifier-pays-issuer</a></td></tr></tbody></table>

### Option 2. Publish a JSON Payload

Instead of using simple parameters, users can submit a JSON payload to the same effect using the `application/json` option on the Swagger UI. For example:

```json
{
  "did": "string",
  "statusListName": "string",
  "index": 0,
  "makeFeePayment": false
}
```

## Step 2: Execute the API request

Execute the API request using the API below:

## Check a StatusList2021 or BitstringStatusList index for a given Verifiable Credential.

> This endpoint checks a StatusList2021 or BitstringStatusList index for a given Verifiable Credential and reports whether it is revoked or suspended. It offers a standalone method for checking an index without passing the entire Verifiable Credential or Verifiable Presentation.

```json
{"openapi":"3.0.0","info":{"title":"cheqd Studio API for cheqd network","version":"2.0.0"},"tags":[{"name":"Status Lists"}],"servers":[{"url":"https://studio-api.cheqd.net","description":"Main (production) server"},{"url":"https://studio-api-staging.cheqd.net","description":"Staging server for testing"},{"url":"http://localhost:3000","description":"Local server for testing"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"x-api-key","in":"header"}},"schemas":{"CredentialStatusCheckRequest":{"type":"object","required":["did","statusListName"],"properties":{"did":{"description":"DID of the StatusList2021 publisher.","type":"string","format":"uri"},"statusListName":{"description":"The name of the StatusList2021 DID-Linked Resource to be checked.","type":"string"},"index":{"description":"Credential status index to be checked for revocation or suspension.","type":"integer","minimum":0,"exclusiveMinimum":false},"indices":{"description":"List of credential status indices to be checked for revocation or suspension.","type":"array","items":{"type":"integer"}},"indexRangeStart":{"description":"Start of the credential status index range to be checked for revocation or suspension.","type":"integer"},"indexRangeEnd":{"description":"End of the credential status index range to be checked for revocation or suspension.","type":"integer"},"statusListCredential":{"description":"Optional Resolvable DID URL of the BitstringStatusList credential to be checked.","type":"string"},"statusSize":{"description":"Optional size of the BitstringStatusList.","type":"number","default":2},"statusMessage":{"description":"Array of status messages for each bit in the BitstringStatusList.","type":"array"},"makeFeePayment":{"description":"Automatically make fee payment (if required) based on payment conditions to unlock encrypted StatusList2021 or BitstringStatusList DID-Linked Resource.","type":"boolean","default":true}}},"CredentialStatusCheckResult":{"oneOf":[{"$ref":"#/components/schemas/CredentialStatusCheckRevocationResult"},{"$ref":"#/components/schemas/CredentialStatusCheckSuspensionResult"}]},"CredentialStatusCheckRevocationResult":{"type":"object","properties":{"checked":{"type":"boolean"},"revoked":{"type":"boolean"}}},"CredentialStatusCheckSuspensionResult":{"type":"object","properties":{"checked":{"type":"boolean"},"suspended":{"type":"boolean"}}},"InvalidRequest":{"description":"A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.","type":"object","properties":{"error":{"type":"string"}}},"UnauthorizedError":{"description":"Access token is missing or invalid","type":"object","properties":{"error":{"type":"string"}}},"InternalError":{"description":"An internal error has occurred. Additional state information plus metadata may be available in the response body.","type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/credential-status/check":{"post":{"tags":["Status Lists"],"summary":"Check a StatusList2021 or BitstringStatusList index for a given Verifiable Credential.","description":"This endpoint checks a StatusList2021 or BitstringStatusList index for a given Verifiable Credential and reports whether it is revoked or suspended. It offers a standalone method for checking an index without passing the entire Verifiable Credential or Verifiable Presentation.","parameters":[{"in":"query","name":"listType","description":"The type of Status List.","required":true,"schema":{"type":"string","enum":["StatusList2021","BitstringStatusList"]}},{"in":"query","name":"statusPurpose","description":"The purpose of the status list. Can be either revocation or suspension.","required":true,"schema":{"type":"string","enum":["revocation","suspension","message","refresh"]}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/CredentialStatusCheckRequest"}},"application/json":{"schema":{"$ref":"#/components/schemas/CredentialStatusCheckRequest"}}}},"responses":{"200":{"description":"The request was successful.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialStatusCheckResult"}}}},"400":{"$ref":"#/components/schemas/InvalidRequest"},"401":{"$ref":"#/components/schemas/UnauthorizedError"},"500":{"$ref":"#/components/schemas/InternalError"}}}}}}
```
