Contributions
Overview
The Contributions API provides endpoints for retrieving information about user contribution activities, bundles, and statistics within the Ethos network. These contributions often involve tasks like performing trust checks, reviewing content, or participating in scoring.
Endpoints
Get Contribution Bundles by Profile ID and Status
GET /api/v1/contributions/:profileIdDescription: Retrieves active contribution bundles for a specific profile ID, filtered by the status of the contributions within them.
Authentication Required: No
Parameters
Path Parameters
profileId
integer
Yes
The unique identifier for the profile.
Query Parameters
status
Array
Yes
Array of contribution statuses to filter by (e.g., PENDING, COMPLETED, SKIPPED).
Request Body
None
Responses
Success Response
Code: 200 OK
Returns an array of contribution bundle objects.
[].id
number
The ID of the contribution bundle.
[].contributions
Array
An array of contribution objects within the bundle that match the specified status filter.
[].contributions[].id
number
The ID of the individual contribution.
[].contributions[].type
string
The type of the contribution (e.g., REVIEW, TRUST_BATTLE).
[].contributions[].status
string
The status of the contribution (PENDING, COMPLETED, SKIPPED).
Error Responses
Code: 400 Bad Request
Code: 404 Not Found
Example
Request
Response
Notes
Retrieves bundles of contributions, not individual contributions directly.
Only includes bundles that are not expired (
expireAt> now).Only includes bundles that contain at least one contribution matching the
statusfilter.The
contributionsarray within each bundle is also filtered by thestatusparameter.The
statusquery parameter is required and should be specified multiple times for OR logic (e.g.,status=COMPLETED&status=SKIPPED).Testing Issue: Direct calls via HTTPie may fail validation (
Expected array, received string) due to how the server parses repeated query parameters. Client-side usage (appending status values) works.Authentication is not required.
Get Contribution Stats by User Key
Description: Retrieves contribution statistics for a specific user key (profile or address).
Authentication Required: No
Parameters
Path Parameters
userkey
string
Yes
The user key (e.g., profileId:123, address:0xabc...).
Query Parameters
None
Request Body
None
Responses
Success Response
Code: 200 OK
ok
boolean
Indicates if the API call itself was successful.
data
object
Container for the contribution statistics.
data.canGenerateDailyContributions
boolean
Whether the user can generate new daily contributions.
data.resetTimestamp
number
Unix timestamp when the daily contributions reset.
data.totalCount
number
Total number of contributions assigned.
data.completedCount
number
Number of completed contributions.
data.skippedCount
number
Number of skipped contributions.
data.pendingCount
number
Number of pending contributions.
data.pendingBundleCount
number
Number of pending contribution bundles.
data.todayXp
number
XP earned from contributions today.
data.totalXp
number
Total XP earned from contributions all time.
data.streakDays
number
Current contribution streak in days (confirmed).
data.streakDaysOptimistic
number
Current contribution streak assuming today is completed (for UI).
data.leaderboardRank
number | null
User's rank on the contribution XP leaderboard (or null if not ranked).
Error Responses
Code: 400 Bad Request
Code: 404 Not Found
Example
Request
Response
Notes
Authentication is not required.
User key can be based on profile ID or address.
Response details match the
ContributionStatstype from@ethos/domain.
Perform Contribution Action
Description: Submits an action (e.g., answer, skip, review submission) for a specific contribution item.
Authentication Required: Yes (Requires Privy Session and Profile)
Parameters
Path Parameters
None
Query Parameters
None
Request Body
id
number
Yes
The ID of the contribution being acted upon.
action
object
Yes
The action object.
action.type
string
Yes
The type of action being performed.
action.txHash
string
Optional
Transaction hash (required for REVIEW type).
action.chosenIndex
number
Optional
The index chosen by the user (required for TRUST_BATTLE type).
action.answer
string
Optional
The user's answer (required for TRUST_CHECK, REVIEW_CHECK, SCORE_CHECK types). Must be one of POSITIVE, NEGATIVE, NEUTRAL, UNSURE.
Responses
Success Response
Code: 200 OK / 204 No Content (Needs verification)
ok
boolean
Indicates if the API call itself was successful.
Error Responses
Code: 400 Bad Request
Code: 401 Unauthorized
Code: 404 Not Found
Example
Request (Skip Action)
Request (Trust Check Action)
Response
Notes
This endpoint requires authentication.
Used to progress through daily contribution tasks.
Specific errors are returned for various conditions (expired bundle, wrong order, already completed, etc.).
Need to confirm exact success response (body/status code).
Generate Daily Contributions
Description: Generates the next set of daily contribution tasks for the authenticated user if they are eligible, or returns the existing daily tasks if already generated.
Authentication Required: Yes (Requires Privy Session and Profile)
Parameters
None
Responses
Success Response
Code: 200 OK
Returns an object containing an array of the user's daily contribution bundle IDs.
ok
boolean
Indicates if the API call itself was successful.
data
object
Container for the response data.
data.contributionBundleIds
Array
An array containing the ID(s) of the contribution bundle(s) generated or retrieved for the current day.
Error Responses
Code: 401 Unauthorized
Code: 409 Conflict
Code: 500 Internal Server Error
Example
Request
Response (New Bundles Generated)
Response (Bundles Already Existed)
Notes
Requires authentication.
Creates the next set of tasks for the user if none exist for the current UTC day.
If tasks already exist for the day, it returns the existing bundle IDs.
Uses a Redis lock to prevent concurrent generation attempts, returning a 409 Conflict if locked.
Last updated