Slashes

Overview

The Slashes API provides endpoints for interacting with slash events, which are community moderation actions within the Ethos network. It allows retrieving slash details, checking potential slash validity, and determining user roles in relation to a specific slash.

Endpoints

List Slashes

GET /api/v1/slashes

Description: Retrieves a list of slashes (community moderation actions), optionally filtered by author, subject, and status.

Authentication Required: No

Parameters

Query Parameters

{
  author?: string;      // Optional: Filter by author's userkey (e.g., eth:0x..., did:privy:...)
  subject?: string;     // Optional: Filter by subject's userkey
  status?: 'open' | 'closed'; // Optional: Filter by slash status (defaults to all)
  limit?: number;       // Optional: Pagination limit (default: 50, max: 100)
  offset?: number;      // Optional: Pagination offset (default: 0)
}
Parameter
Type
Required
Default
Description

author

string (Userkey)

No

-

Filter slashes created by this author.

subject

string (Userkey)

No

-

Filter slashes targeting this subject.

status

'open' | 'closed'

No

all

Filter slashes by their status (open or closed).

limit

number

No

50

Maximum number of slashes to return. Max 100.

offset

number

No

0

Number of slashes to skip for pagination.

Responses

Success Response

Code: 200 OK

Note: The exact structure of the subject object and other fields within the values array depends on the convert.toSlash function and needs confirmation via testing.

Error Responses

Code: 400 Bad Request

Example

Request

Response

Notes

  • Returns slashes ordered by creation date descending.

  • Uses standard pagination (limit, offset).

  • Supports filtering by author, subject (using userkey format), and status.

Get Slash Roles

Description: Retrieves the roles of specified profiles related to a specific slash (e.g., slasher, defender, voter).

Authentication Required: No (Assumed, needs verification)

Parameters

Path Parameters

Parameter
Type
Description

id

number

The ID of the slash.

Query Parameters

Parameter
Type
Required
Description

profileId

number

number[]

Yes

Responses

Success Response

Code: 200 OK

Role
Description

slasher

The profile authored the slash.

defender

The profile is the subject of the slash.

voted_slash

The profile upvoted the slash (supported slasher).

voted_defend

The profile downvoted the slash (supported defender).

Error Responses

Code: 400 Bad Request (Example: Missing profileId)

Code: 404 Not Found (Example: Slash ID not found)

Example

Request

Response

Notes

  • Used to determine relationship of specific users to a slash.

  • Requires the numerical slash ID and at least one profile ID.

Check Slash Validity

// ... existing code ...

Last updated