For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 Stats by User Key

GET /api/v1/contributions/:userkey/stats

Description: Retrieves contribution statistics for a specific user key (profile or address).

Authentication Required: No

Parameters

Path Parameters

Name
Type
Required
Description

userkey

string

Yes

The user key (e.g., profileId:123, address:0xabc...).

Query Parameters

None

Request Body

None

Responses

Success Response

Code: 200 OK

Property
Type
Description

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 ContributionStats type 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

Property
Type
Required
Description

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)

Property
Type
Description

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.

Property
Type
Description

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