> For the complete documentation index, see [llms.txt](https://docs.teranode.group/nchain-event/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.teranode.group/nchain-event/independent-records/api-workflow/verify-record-+.md).

# Verify Record †

##

<figure><img src="/files/DSR8KT3POLvKmm6ucBBj" alt="" width="563"><figcaption></figcaption></figure>

1. Anyone with the original record and information can check whether record exists at the location
2. The result indicates whether there is a match, a mismatch, or unknown (retry later)

## **Verify Encoded Record**

To verify the original record, the verifier will need the record, encoder, salt and the location.&#x20;

#### **Example** **code:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "$URL/api/v1/records/$LOC/match?encode=SHA256(01-02T13.14.15)|Base64" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain" \
     -H "Content-Type: application/octet-stream" \
     --data-binary "hello"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/api/v1/records/${loc}/match?encode=SHA256(01-02T13.14.15)|Base64', {
  method: 'POST',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain',
    'Content-Type': 'application/octet-stream'
  },
  body: 'hello'
});
```

{% endtab %}
{% endtabs %}

## **Verify Unencoded Record** ‡

To verify the original record, the verifier will need the record and the location.&#x20;

#### **Example** **code:**

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST $URL/api/v1/records/$LOC/match \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain" \
     -H "Content-Type: application/octet-stream" \
     --data-binary "hello"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch('${url}/api/v1/records/${loc}/match', {
  method: 'POST',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain',
    'Content-Type': 'application/octet-stream'
  },
  body: 'hello'
});
```

{% endtab %}
{% endtabs %}

## **Example Responses**

#### **Example matching** cURL **response:**

```json
{
  "match": true,
  "confirmation": {
    "confirmedBlocks": 2,
    "blockHash": "279062b6c3b09774ce665....0413ea9bdc6c1603819b11b",
    "blockTimestamp": "2024-01-02T13:20:05Z",
    "merkleProof": {
      "index": 1,
      "txOrId": "7d2aef40841f0109....c31c83a5505a4c147e",
      ....
    }
  }
}
```

#### **Example mismatching** cURL **response:**

```json
{
  "match": false,
  "confirmation": {
    ....
  }
}
```

#### **Example unknown** cURL **response:**

```json
{
  "title": "Content not found",
  "status": 404,
  ....
}
```
