> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galxe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Credential API Reference

> Query user credentials and check eligibility for verification requirements

## Overview

The Credential API provides **read-only** access to verify user eligibility and query credential information.

## Core Queries

### Get Credential Information

```graphql theme={null}
query GetCredential($credId: ID!) {
  credential(id: $credId) {
    id
    name
    description
    credType
    credSource
    chain
    referenceLink
    itemCount
    lastUpdate
    lastSync
    syncStatus
    curatorSpace {
      id
      name
    }
  }
}
```

### Check User Eligibility

```graphql theme={null}
query CheckEligibility($credId: ID!, $address: String!, $campaignId: ID) {
  credential(id: $credId) {
    id
    name
    eligible(address: $address, campaignId: $campaignId)
    credType
    credSource
    syncStatus
    lastSync
  }
}
```

**Variables**:

```json theme={null}
{
  "credId": "312969464",
  "address": "0x1234567890123456789012345678901234567890",
  "campaignId": "GChdWUjXX3"
}
```

**Response**:

```json theme={null}
{
  "data": {
    "credential": {
      "id": "312969464",
      "name": "Twitter Follower Verification",
      "eligible": 1,
      "credType": "TWITTER",
      "credSource": "TWITTER_FOLLOW",
      "syncStatus": "SYNCED",
      "lastSync": 1699200000
    }
  }
}
```

**Eligibility Values**:

* `1` - User has the credential
* `0` - User does not have the credential

## Field Reference

### Key Fields

| Field                           | Type          | Description                        |
| ------------------------------- | ------------- | ---------------------------------- |
| `id`                            | `ID!`         | Credential's unique identifier     |
| `name`                          | `String!`     | Human-readable credential name     |
| `credType`                      | `CredType!`   | Credential platform/type           |
| `credSource`                    | `CredSource!` | Verification method                |
| `eligible(address, campaignId)` | `Int`         | User eligibility check (0 or 1)    |
| `syncStatus`                    | `SyncStatus!` | Data synchronization status        |
| `itemCount`                     | `Int`         | Total number of credential holders |

### Credential Types

| Type             | Description                     |
| ---------------- | ------------------------------- |
| `TWITTER`        | Twitter account verification    |
| `DISCORD`        | Discord membership verification |
| `EVM_ADDRESS`    | Ethereum-compatible addresses   |
| `SOLANA_ADDRESS` | Solana wallet addresses         |
| `GITHUB`         | GitHub account verification     |
| `EMAIL`          | Email address verification      |

### Credential Sources

| Source                | Description                  |
| --------------------- | ---------------------------- |
| `TWITTER_FOLLOW`      | Twitter follow verification  |
| `DISCORD_MEMBER`      | Discord server membership    |
| `CONTRACT_NFT_HOLDER` | NFT ownership verification   |
| `WALLET_BALANCE`      | Token balance requirements   |
| `QUIZ`                | Quiz completion verification |
| `API`                 | Custom API verification      |

### Sync Status

| Status    | Description                         |
| --------- | ----------------------------------- |
| `SYNCED`  | Data is current and reliable        |
| `SYNCING` | Data is being updated, may be stale |

## Integration Patterns

### Basic Verification

```bash theme={null}
curl -X POST https://graphigo-business.prd.galaxy.eco/query \
  -H "Content-Type: application/json" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -d '{
    "query": "query CheckEligibility($credId: ID!, $address: String!) { credential(id: $credId) { name eligible(address: $address) syncStatus } }",
    "variables": { "credId": "312969464", "address": "0x..." }
  }'
```

### Quest-Specific Context

When checking eligibility for a specific quest, include the `campaignId` parameter:

```graphql theme={null}
eligible(address: $address, campaignId: $campaignId)
```

## Best Practices

1. **Check Sync Status**: Always verify `syncStatus` is `SYNCED` before relying on eligibility results
2. **Handle Quest Context**: Use `campaignId` parameter for quest-specific verifications
3. **Cache Results**: Cache eligibility results for 5-10 minutes to reduce API calls
4. **Error Handling**: Handle invalid credential IDs and network errors gracefully

## Common Errors

| Error                  | Cause                     | Solution                      |
| ---------------------- | ------------------------- | ----------------------------- |
| `Credential not found` | Invalid credential ID     | Verify credential ID exists   |
| `Address not provided` | Missing address parameter | Include user address in query |
| `Rate limit exceeded`  | Too many requests         | Implement retry logic         |
| `Invalid access token` | Bad/expired token         | Regenerate access token       |

## Next Steps

* **[User Verification Guide](/galxe-integration/guides/user-verification)** - Implementation patterns
* **[Quest API Reference](/galxe-integration/api-reference/quest)** - Quest requirements
* **[Authentication](/galxe-integration/getting-started/authentication)** - Access token setup
