# VC Revocation

A credential issuer can revoke any of her issued VCs with `vc_revoke` operation by specifying the CID (`<cid>`) of the revoked VC.

## vc\_revoke

<mark style="color:red;">`DELETE`</mark> `https://test-network.finema.co/vc/<cid>`

#### Request Body

| Name            | Type   | Description                                                                         |
| --------------- | ------ | ----------------------------------------------------------------------------------- |
| operation       | string | The method's name that is "add\_key".                                               |
| did\_address    | string | The DID address.                                                                    |
| current\_key    | string | The current public key in the series. It is used to verify the request's signature. |
| next\_key\_hash | string | The SHA-256 hash of the next public key in the series.                              |
| cid             | string | The CID of the revoked VC.                                                          |
| nonce           | number | The request nonce.                                                                  |

{% tabs %}
{% tab title="200 The operation name, DID address (\<did\_address>) and the CID for the revoked VC will be given as the response." %}

```
{
  "operation": "vc_revoke",
  "did_address": "did:idin:afb7ba88c76edbda55c344b70ae0cf0556d770ec256820d7185000de395391b5",
  "cid": "c118304cfcc011eaaca30242c0a83005"

}
```

{% endtab %}

{% tab title="422 " %}

```
{
    "errors": [
        {
           "status": 422,
            "title": "Invalid Attribute",
            "detail": "the server cannot process the request",
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Example Message and Request

```
{
    "operation": "vc_revoke",
    "did_address": "did:idin:afb7ba88c76edbda55c344b70ae0cf0556d770ec256820d7185000de395391b5",
    "current_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5HqmOXLJKDEbUahls2jFWsPSSPIL\n+HchIT2ScHdKqrPzRIiS/Wz13s9gAdtd5ayygxnVW2RLQsq0kxq6FS05Jw==\n-----END PUBLIC KEY-----",
    "next_key_hash": "cd950c9074f7dd6f7b549bb6dcd8d443db440492c1c75c6cf63958494f60ce43",
    "cid": "c118304cfcc011eaaca30242c0a83005",
    "nonce": 6
}
```

The above message can then be encoded in Base64 and signed with ECDSA to obtain the following HTTP request

```
{
    "message": "eyJjaWQiOiAiYzExODMwNGNmY2MwMTFlYWFjYTMwMjQyYzBhODMwMDUiLCAiY3VycmVudF9rZXkiOiAiLS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1cbk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTVIcW1PWExKS0RFYlVhaGxzMmpGV3NQU1NQSUxcbitIY2hJVDJTY0hkS3FyUHpSSWlTL1d6MTNzOWdBZHRkNWF5eWd4blZXMlJMUXNxMGt4cTZGUzA1Snc9PVxuLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tIiwgIm5leHRfa2V5X2hhc2giOiAiY2Q5NTBjOTA3NGY3ZGQ2ZjdiNTQ5YmI2ZGNkOGQ0NDNkYjQ0MDQ5MmMxYzc1YzZjZjYzOTU4NDk0ZjYwY2U0MyIsICJvcGVyYXRpb24iOiAidmNfcmV2b2tlIiwgImRpZF9hZGRyZXNzIjogImRpZDppZGluOmFmYjdiYTg4Yzc2ZWRiZGE1NWMzNDRiNzBhZTBjZjA1NTZkNzcwZWMyNTY4MjBkNzE4NTAwMGRlMzk1MzkxYjUiLCAibm9uY2UiOiA2fQ==",
    "signature": "MEUCIQDUBm3n9ZrchAl/5QQYzFlhQXlQ9lI9yhJePAmvUnJ8yQIgBoJ5HcZjv/9PnJ4dSyiLFqsTPlX6y3L2f5Z3Lp9hjlA="
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finema.co/api-tutorials/vc-api/revoke-vc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
