# Checking claim status

### Overview

The Check Quest Claim endpoint allows you to verify whether a specific user has claimed a particular quest. This is useful for:

* Preventing duplicate quest completions
* Validating eligibility for rewards
* Tracking user progress through quest journeys

### How It Works

The endpoint accepts a quest ID and user identifiers, then:

1. Locates the user based on the provided identifiers
2. Checks if that user has claimed the specified quest
3. Returns the claim status and relevant user/quest details

### API Reference

```
POST /api/quests/check-claim
```

#### Request Parameters

| Parameter | Type   | Description                                |
| --------- | ------ | ------------------------------------------ |
| `questId` | String | **Required**. The ID of the quest to check |

{% hint style="info" %}
You can find the `questId` in the sharing panel of the quest editor.
{% endhint %}

You must also include **at least one** of the following user identifiers:

| Parameter     | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| `externalId`  | String | User's ID in your external system     |
| `discordId`   | String | User's Discord ID                     |
| `twitterId`   | String | User's Twitter/X ID                   |
| `telegramId`  | String | User's Telegram ID                    |
| `zealyUserId` | String | User's Zealy ID                       |
| `wallet`      | Object | User's wallet information (see below) |

The `wallet` object can include:

```json
{
  "walletAddress": "0x123...",
  "type": "ethereum",
  "network": "mainnet",
  "provider": "metamask"
}
```

#### Response

**User Found, Quest Exists**

```json
{
  "claimed": true, // or false
  "user": {
    "id": "user-id",
    "externalId": "external-id-if-exists"
  },
  "quest": {
    "id": "quest-id",
    "title": "Quest Title"
  }
}
```

**User Found, Quest Not Found**

```json
{
  "claimed": false,
  "reason": "Quest not found",
  "user": {
    "id": "user-id",
    "externalId": "external-id-if-exists"
  }
}
```

**User Not Found**

```json
{
  "claimed": false,
  "reason": "User not found"
}
```

#### Example Request

{% hint style="info" %}
Replace `your-community` in the URL with your community slug. You can find your community slug in your community URL - it's the part before `.domino.page`. For example, if your community URL is `my-community.domino.page`, your slug is `my-community`.
{% endhint %}

```javascript
const response = await fetch('https://your-community.domino.page/api/quests/check-claim', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'your-domino-api-key'
  },
  body: JSON.stringify({
    questId: 'quest-123',
    externalId: 'user-456'
  })
});

const data = await response.json();
const hasClaimed = data.claimed;
```

### Usage Examples

#### Checking Before Showing Quest Content

```javascript
// Check if user has already claimed this quest
const checkResponse = await checkQuestClaim({ 
  questId: 'quest-123', 
  externalId: 'user-456' 
});

if (checkResponse.claimed) {
  // Show "already completed" message
  showCompletedMessage();
} else {
  // Show quest content
  showQuestContent();
}
```


---

# 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.domino.run/docs/checking-claim-status.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.
