API Reference
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
Check User Eligibility
Variables:
Response:
Eligibility Values:
1
- User has the credential0
- 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
Quest-Specific Context
When checking eligibility for a specific quest, include the campaignId
parameter:
Best Practices
- Check Sync Status: Always verify
syncStatus
isSYNCED
before relying on eligibility results - Handle Quest Context: Use
campaignId
parameter for quest-specific verifications - Cache Results: Cache eligibility results for 5-10 minutes to reduce API calls
- 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 - Implementation patterns
- Quest API Reference - Quest requirements
- Authentication - Access token setup