Skip to content

Latest commit

 

History

History
5013 lines (3531 loc) · 58.6 KB

File metadata and controls

5013 lines (3531 loc) · 58.6 KB

Reference

Achievements

client.achievements.all() -> Internal::Types::Array[Trophy::Types::AchievementWithStatsResponse]

📝 Description

Get all achievements and their completion stats.

🔌 Usage

client.achievements.all(user_attributes: "plan-type:premium,region:us-east")

⚙️ Parameters

user_attributes: String — Optional colon-delimited user attributes in the format attribute:value,attribute:value. Only achievements accessible to a user with the provided attributes will be returned.

request_options: Trophy::Achievements::RequestOptions

client.achievements.complete(key, request) -> Trophy::Types::AchievementCompletionResponse

📝 Description

Mark an achievement as completed for a user.

🔌 Usage

client.achievements.complete(
  key: "finish-onboarding",
  user: {
    email: "user@example.com",
    tz: "Europe/London",
    id: "user-id"
  }
)

⚙️ Parameters

key: String — Unique reference of the achievement as set when created.

user: Trophy::Types::UpsertedUser — The user that completed the achievement.

request_options: Trophy::Achievements::RequestOptions

Metrics

client.metrics.event(key, request) -> Trophy::Types::EventResponse

📝 Description

Increment or decrement the value of a metric for a user.

🔌 Usage

client.metrics.event(
  key: "words-written",
  idempotency_key: "e4296e4b-8493-4bd1-9c30-5a1a9ac4d78f",
  user: {
    email: "user@example.com",
    tz: "Europe/London",
    attributes: {
      department: "engineering",
      role: "developer"
    },
    id: "18"
  },
  value: 750,
  attributes: {
    category: "writing",
    source: "mobile-app"
  }
)

⚙️ Parameters

key: String — Unique reference of the metric as set when created.

idempotency_key: String — The idempotency key for the event.

user: Trophy::Types::UpsertedUser — The user that triggered the event.

value: Integer — The value to add to the user's current total for the given metric.

attributes: Internal::Types::Hash[String, String] — Event attributes as key-value pairs. Keys must match existing event attributes set up in the Trophy dashboard.

request_options: Trophy::Metrics::RequestOptions

Users

client.users.create(request) -> Trophy::Types::User

📝 Description

Create a new user.

🔌 Usage

client.users.create(id: "user-id")

⚙️ Parameters

request: Trophy::Types::UpsertedUser

request_options: Trophy::Users::RequestOptions

client.users.get(id) -> Trophy::Types::User

📝 Description

Get a single user.

🔌 Usage

client.users.get(id: "userId")

⚙️ Parameters

id: String — ID of the user to get.

request_options: Trophy::Users::RequestOptions

client.users.identify(id, request) -> Trophy::Types::User

📝 Description

Identify a user.

🔌 Usage

client.users.identify(
  id: "id",
  email: "user@example.com",
  tz: "Europe/London",
  attributes: {
    department: "engineering",
    role: "developer"
  }
)

⚙️ Parameters

id: String — ID of the user to identify.

request: Trophy::Types::UpdatedUser — The user object.

request_options: Trophy::Users::RequestOptions

client.users.update(id, request) -> Trophy::Types::User

📝 Description

Update a user.

🔌 Usage

client.users.update(
  id: "id",
  email: "user@example.com",
  tz: "Europe/London",
  attributes: {
    department: "engineering",
    role: "developer"
  }
)

⚙️ Parameters

id: String — ID of the user to update.

request: Trophy::Types::UpdatedUser — The user object.

request_options: Trophy::Users::RequestOptions

client.users.get_preferences(id) -> Trophy::Types::UserPreferencesResponse

📝 Description

Get a user's notification preferences.

🔌 Usage

client.users.get_preferences(id: "user-123")

⚙️ Parameters

id: String — The user's ID in your database.

request_options: Trophy::Users::RequestOptions

client.users.update_preferences(id, request) -> Trophy::Types::UserPreferencesResponse

📝 Description

Update a user's notification and streak preferences. Streak preferences require streak customization to be enabled in your Trophy dashboard settings.

🔌 Usage

client.users.update_preferences(
  id: "user-123",
  notifications: {
    streak_reminder: ["email"]
  }
)

⚙️ Parameters

id: String — The user's ID in your database.

notifications: Trophy::Types::NotificationPreferences

streak: Trophy::Types::StreakPreferences

request_options: Trophy::Users::RequestOptions

client.users.all_metrics(id) -> Internal::Types::Array[Trophy::Types::MetricResponse]

📝 Description

Get a single user's progress against all active metrics.

🔌 Usage

client.users.all_metrics(id: "userId")

⚙️ Parameters

id: String — ID of the user

request_options: Trophy::Users::RequestOptions

client.users.single_metric(id, key) -> Trophy::Types::MetricResponse

📝 Description

Get a user's progress against a single active metric.

🔌 Usage

client.users.single_metric(
  id: "userId",
  key: "key"
)

⚙️ Parameters

id: String — ID of the user.

key: String — Unique key of the metric.

request_options: Trophy::Users::RequestOptions

client.users.metric_event_summary(id, key) -> Internal::Types::Array[Trophy::Users::Types::UsersMetricEventSummaryResponseItem]

📝 Description

Get a summary of metric events over time for a user.

🔌 Usage

client.users.metric_event_summary(
  id: "userId",
  key: "words-written",
  aggregation: "daily",
  start_date: "2024-01-01",
  end_date: "2024-01-31"
)

⚙️ Parameters

id: String — ID of the user.

key: String — Unique key of the metric.

aggregation: Trophy::Users::Types::UsersMetricEventSummaryRequestAggregation — The time period over which to aggregate the event data.

start_date: String — The start date for the data range in YYYY-MM-DD format. The startDate must be before the endDate, and the date range must not exceed 400 days.

end_date: String — The end date for the data range in YYYY-MM-DD format. The endDate must be after the startDate, and the date range must not exceed 400 days.

request_options: Trophy::Users::RequestOptions

client.users.achievements(id) -> Internal::Types::Array[Trophy::Types::UserAchievementWithStatsResponse]

📝 Description

Get a user's achievements.

🔌 Usage

client.users.achievements(
  id: "userId",
  include_incomplete: "true"
)

⚙️ Parameters

id: String — ID of the user.

include_incomplete: String — When set to 'true', returns both completed and incomplete achievements for the user. When omitted or set to any other value, returns only completed achievements.

request_options: Trophy::Users::RequestOptions

client.users.streak(id) -> Trophy::Types::StreakResponse

📝 Description

Get a user's streak data.

🔌 Usage

client.users.streak(
  id: "userId",
  history_periods: 1
)

⚙️ Parameters

id: String — ID of the user.

history_periods: Integer — The number of past streak periods to include in the streakHistory field of the response.

request_options: Trophy::Users::RequestOptions

client.users.points(id, key) -> Trophy::Types::GetUserPointsResponse

📝 Description

Get a user's points for a specific points system.

🔌 Usage

client.users.points(
  id: "userId",
  key: "points-system-key",
  awards: 1
)

⚙️ Parameters

id: String — ID of the user.

key: String — Key of the points system.

awards: Integer — The number of recent point awards to return.

request_options: Trophy::Users::RequestOptions

client.users.points_boosts(id, key) -> Internal::Types::Array[Trophy::Types::PointsBoost]

📝 Description

Get active points boosts for a user in a specific points system. Returns both global boosts the user is eligible for and user-specific boosts.

🔌 Usage

client.users.points_boosts(
  id: "userId",
  key: "points-system-key"
)

⚙️ Parameters

id: String — ID of the user.

key: String — Key of the points system.

request_options: Trophy::Users::RequestOptions

client.users.points_event_summary(id, key) -> Internal::Types::Array[Trophy::Users::Types::UsersPointsEventSummaryResponseItem]

📝 Description

Get a summary of points awards over time for a user for a specific points system.

🔌 Usage

client.users.points_event_summary(
  id: "userId",
  key: "points-system-key",
  aggregation: "daily",
  start_date: "2024-01-01",
  end_date: "2024-01-31"
)

⚙️ Parameters

id: String — ID of the user.

key: String — Key of the points system.

aggregation: Trophy::Users::Types::UsersPointsEventSummaryRequestAggregation — The time period over which to aggregate the event data.

start_date: String — The start date for the data range in YYYY-MM-DD format. The startDate must be before the endDate, and the date range must not exceed 400 days.

end_date: String — The end date for the data range in YYYY-MM-DD format. The endDate must be after the startDate, and the date range must not exceed 400 days.

request_options: Trophy::Users::RequestOptions

client.users.leaderboard(id, key) -> Trophy::Types::UserLeaderboardResponseWithHistory

📝 Description

Get a user's rank, value, and daily ranking history for a specific leaderboard.

🔌 Usage

client.users.leaderboard(
  id: "user-123",
  key: "weekly-words",
  run: "2025-01-15",
  num_events: 1
)

⚙️ Parameters

id: String — The user's ID in your database.

key: String — Unique key of the leaderboard as set when created.

run: String — Specific run date in YYYY-MM-DD format. If not provided, returns the current run.

num_events: Integer — The number of days to return in the leaderboard history for the user.

request_options: Trophy::Users::RequestOptions

client.users.wrapped(id) -> Trophy::Types::WrappedResponse

📝 Description

Get a user's year-in-review wrapped data.

🔌 Usage

client.users.wrapped(
  id: "user-123",
  year: 1
)

⚙️ Parameters

id: String — The user's ID in your database.

year: Integer — The year to get wrapped data for. Defaults to the current year. Must be an integer between 1 and the current year.

request_options: Trophy::Users::RequestOptions

Streaks

client.streaks.list() -> Internal::Types::Array[Trophy::Types::BulkStreakResponseItem]

📝 Description

Get the streak lengths of a list of users, ranked by streak length from longest to shortest.

🔌 Usage

client.streaks.list(user_ids: ["userIds"])

⚙️ Parameters

user_ids: String — A list of up to 100 user IDs.

request_options: Trophy::Streaks::RequestOptions

Points

client.points.summary(key) -> Internal::Types::Array[Trophy::Types::PointsRange]

📝 Description

Get a breakdown of the number of users with points in each range.

🔌 Usage

client.points.summary(
  key: "points-system-key",
  user_attributes: "plan-type:premium,region:us-east"
)

⚙️ Parameters

key: String — Key of the points system.

user_attributes: String — Optional colon-delimited user attribute filters in the format attribute:value,attribute:value. Only users matching ALL specified attributes will be included in the points breakdown.

request_options: Trophy::Points::RequestOptions

client.points.system(key) -> Trophy::Types::PointsSystemResponse

📝 Description

Get a points system with its triggers.

🔌 Usage

client.points.system(key: "points-system-key")

⚙️ Parameters

key: String — Key of the points system.

request_options: Trophy::Points::RequestOptions

client.points.boosts(key) -> Internal::Types::Array[Trophy::Types::PointsBoost]

📝 Description

Get all global boosts for a points system. Finished boosts are excluded by default.

🔌 Usage

client.points.boosts(
  key: "points-system-key",
  include_finished: true
)

⚙️ Parameters

key: String — Key of the points system.

include_finished: Internal::Types::Boolean — When set to 'true', boosts that have finished (past their end date) will be included in the response. By default, finished boosts are excluded.

request_options: Trophy::Points::RequestOptions

client.points.levels(key) -> Internal::Types::Array[Trophy::Types::PointsLevel]

📝 Description

Get all levels for a points system.

🔌 Usage

client.points.levels(key: "points-system-key")

⚙️ Parameters

key: String — Key of the points system.

request_options: Trophy::Points::RequestOptions

client.points.level_summary(key) -> Internal::Types::Array[Trophy::Types::PointsLevelSummaryResponseItem]

📝 Description

Get a breakdown of the number of users at each level in a points system.

🔌 Usage

client.points.level_summary(key: "points-system-key")

⚙️ Parameters

key: String — Key of the points system.

request_options: Trophy::Points::RequestOptions

Leaderboards

client.leaderboards.all() -> Internal::Types::Array[Trophy::Leaderboards::Types::LeaderboardsAllResponseItem]

📝 Description

Get all leaderboards for your organization. Finished leaderboards are excluded by default.

🔌 Usage

client.leaderboards.all(include_finished: true)

⚙️ Parameters

include_finished: Internal::Types::Boolean — When set to 'true', leaderboards with status 'finished' will be included in the response. By default, finished leaderboards are excluded.

request_options: Trophy::Leaderboards::RequestOptions

client.leaderboards.get(key) -> Trophy::Types::LeaderboardResponseWithRankings

📝 Description

Get a specific leaderboard by its key.

🔌 Usage

client.leaderboards.get(
  key: "weekly-words",
  offset: 1,
  limit: 1,
  run: "2025-01-15",
  user_id: "user-123",
  user_attributes: "city:London"
)

⚙️ Parameters

key: String — Unique key of the leaderboard as set when created.

offset: Integer — Number of rankings to skip for pagination.

limit: Integer — Maximum number of rankings to return. Cannot be greater than the size of the leaderboard.

run: String — Specific run date in YYYY-MM-DD format. If not provided, returns the current run.

user_id: String — When provided, offset is relative to this user's position on the leaderboard. If the user is not found in the leaderboard, returns empty rankings array.

user_attributes: String — Attribute key and value to filter the rankings by, separated by a colon. For example, city:London. This parameter is required, and only valid for leaderboards with a breakdown attribute.

request_options: Trophy::Leaderboards::RequestOptions

Admin Attributes

client.admin.attributes.list() -> Internal::Types::Array[Trophy::Types::AdminAttribute]

📝 Description

List attributes.

🔌 Usage

client.admin.attributes.list(
  limit: 1,
  skip: 1
)

⚙️ Parameters

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Attributes::RequestOptions

client.admin.attributes.create(request) -> Trophy::Types::CreateAttributesResponse

📝 Description

Create attributes.

🔌 Usage

client.admin.attributes.create(request: [{
  name: "Plan",
  key: "plan",
  type: "user"
}, {
  name: "Device",
  key: "device",
  type: "event"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::CreateAttributeRequestItem]

request_options: Trophy::Admin::Attributes::RequestOptions

client.admin.attributes.delete() -> Trophy::Types::DeleteAttributesResponse

📝 Description

Delete attributes by ID.

🔌 Usage

client.admin.attributes.delete(ids: %w[550e8400-e29b-41d4-a716-446655440000 550e8400-e29b-41d4-a716-446655440001])

⚙️ Parameters

ids: String — Attribute IDs to delete. Repeat the query param or provide a comma-separated list.

request_options: Trophy::Admin::Attributes::RequestOptions

client.admin.attributes.update(request) -> Trophy::Types::UpdateAttributesResponse

📝 Description

Update attributes by ID.

🔌 Usage

client.admin.attributes.update(request: [{
  id: "550e8400-e29b-41d4-a716-446655440000",
  name: "Subscription Plan"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::UpdateAttributeRequestItem]

request_options: Trophy::Admin::Attributes::RequestOptions

client.admin.attributes.get(id) -> Trophy::Types::AdminAttribute

📝 Description

Get an attribute by ID.

🔌 Usage

client.admin.attributes.get(id: "550e8400-e29b-41d4-a716-446655440000")

⚙️ Parameters

id: String — The UUID of the attribute to retrieve.

request_options: Trophy::Admin::Attributes::RequestOptions

Admin Metrics

client.admin.metrics.list() -> Internal::Types::Array[Trophy::Types::CreatedMetric]

📝 Description

List metrics.

🔌 Usage

client.admin.metrics.list(
  limit: 1,
  skip: 1
)

⚙️ Parameters

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Metrics::RequestOptions

client.admin.metrics.create(request) -> Trophy::Types::CreateMetricsResponse

📝 Description

Create metrics.

🔌 Usage

client.admin.metrics.create(request: [{
  name: "Invites Sent",
  key: "invites-sent"
}, {
  name: "Revenue",
  key: "revenue",
  unit_type: "currency",
  units: "USD"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::CreateMetricRequestItem]

request_options: Trophy::Admin::Metrics::RequestOptions

client.admin.metrics.delete() -> Trophy::Types::DeleteMetricsResponse

📝 Description

Delete metrics by ID.

🔌 Usage

client.admin.metrics.delete(ids: %w[550e8400-e29b-41d4-a716-446655440000 550e8400-e29b-41d4-a716-446655440001])

⚙️ Parameters

ids: String — Metric IDs to delete. Repeat the query param or provide a comma-separated list.

request_options: Trophy::Admin::Metrics::RequestOptions

client.admin.metrics.update(request) -> Trophy::Types::UpdateMetricsResponse

📝 Description

Update metrics by ID.

🔌 Usage

client.admin.metrics.update(request: [{
  id: "550e8400-e29b-41d4-a716-446655440000",
  name: "Invites Completed",
  units: "invites"
}, {
  id: "550e8400-e29b-41d4-a716-446655440001",
  unit_type: "number",
  units: "dollars"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::UpdateMetricRequestItem]

request_options: Trophy::Admin::Metrics::RequestOptions

client.admin.metrics.get(id) -> Trophy::Types::CreatedMetric

📝 Description

Get a metric by ID.

🔌 Usage

client.admin.metrics.get(id: "550e8400-e29b-41d4-a716-446655440000")

⚙️ Parameters

id: String — The UUID of the metric to retrieve.

request_options: Trophy::Admin::Metrics::RequestOptions

Admin Leaderboards

client.admin.leaderboards.list() -> Internal::Types::Array[Trophy::Types::AdminLeaderboard]

📝 Description

List leaderboards.

🔌 Usage

client.leaderboards.all

⚙️ Parameters

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Leaderboards::RequestOptions

client.admin.leaderboards.create(request) -> Trophy::Types::CreateLeaderboardsResponse

📝 Description

Create leaderboards. Maximum 100 leaderboards per request.

🔌 Usage

client.admin.leaderboards.create(request: [{
  name: "Revenue Champions",
  key: "revenue-champions",
  status: "inactive",
  rank_by: "metric",
  metric_id: "550e8400-e29b-41d4-a716-446655440000",
  max_participants: 100,
  start: "2026-04-20",
  breakdown_attributes: ["550e8400-e29b-41d4-a716-446655440010"],
  run_unit: "month",
  run_interval: 1
}, {
  name: "Streak Legends",
  key: "streak-legends",
  status: "scheduled",
  rank_by: "streak",
  start: "2026-04-27"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::CreateLeaderboardRequestItem]

request_options: Trophy::Admin::Leaderboards::RequestOptions

client.admin.leaderboards.delete() -> Trophy::Types::DeleteLeaderboardsResponse

📝 Description

Delete leaderboards by ID.

🔌 Usage

client.admin.leaderboards.delete(ids: ["ids"])

⚙️ Parameters

ids: String — Leaderboard IDs to delete. Repeat the query param or provide a comma-separated list.

request_options: Trophy::Admin::Leaderboards::RequestOptions

client.admin.leaderboards.update(request) -> Trophy::Types::UpdateLeaderboardsResponse

📝 Description

Update leaderboards by ID. Updating status behaves the same as activating, scheduling, deactivating, or finishing a leaderboard in the dashboard.

🔌 Usage

client.admin.leaderboards.update(request: [{
  id: "550e8400-e29b-41d4-a716-446655440100",
  name: "Monthly Revenue Champions",
  description: "Ranked by monthly revenue",
  status: "active"
}, {
  id: "550e8400-e29b-41d4-a716-446655440101",
  status: "finished"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::UpdateLeaderboardRequestItem]

request_options: Trophy::Admin::Leaderboards::RequestOptions

client.admin.leaderboards.get(id) -> Trophy::Types::AdminLeaderboard

📝 Description

Get a leaderboard by ID.

🔌 Usage

client.admin.leaderboards.get(id: "550e8400-e29b-41d4-a716-446655440100")

⚙️ Parameters

id: String — The UUID of the leaderboard to retrieve.

request_options: Trophy::Admin::Leaderboards::RequestOptions

Admin Streaks

client.admin.streaks.restore(request) -> Trophy::Types::RestoreStreaksResponse

📝 Description

Restore streaks for multiple users to the maximum previously achieved streak length found within the current restore window: the last 90 days for daily streaks, weekly periods starting with the week containing the start of the current calendar year for weekly streaks, and monthly periods starting at the beginning of the previous calendar year for monthly streaks.

🔌 Usage

client.admin.streaks.restore(users: [{
  id: "user-123"
}, {
  id: "user-456"
}])

⚙️ Parameters

users: Internal::Types::Array[Trophy::Admin::Streaks::Types::RestoreStreaksRequestUsersItem] — Array of users to restore streaks for. Maximum 100 users per request.

request_options: Trophy::Admin::Streaks::RequestOptions

Admin Tenants

client.admin.tenants.list() -> Internal::Types::Array[Trophy::Types::AdminTenant]

📝 Description

List tenants in the current environment.

🔌 Usage

client.admin.tenants.list(
  limit: 1,
  skip: 1
)

⚙️ Parameters

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Tenants::RequestOptions

client.admin.tenants.create(request) -> Trophy::Types::CreateTenantsResponse

📝 Description

Create tenants.

🔌 Usage

client.admin.tenants.create(request: [{
  customer_id: "customer_12345",
  name: "Acme Corp"
}, {
  customer_id: "customer_67890",
  name: "Globex Inc"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::CreateTenantRequestItem]

request_options: Trophy::Admin::Tenants::RequestOptions

client.admin.tenants.delete() -> Trophy::Types::DeleteTenantsResponse

📝 Description

Delete tenants by ID.

🔌 Usage

client.admin.tenants.delete(ids: %w[550e8400-e29b-41d4-a716-446655440000 550e8400-e29b-41d4-a716-446655440001])

⚙️ Parameters

ids: String — Tenant IDs to delete. Repeat the query param or provide a comma-separated list.

request_options: Trophy::Admin::Tenants::RequestOptions

client.admin.tenants.update(request) -> Trophy::Types::UpdateTenantsResponse

📝 Description

Update tenants by ID.

🔌 Usage

client.admin.tenants.update(request: [{
  id: "550e8400-e29b-41d4-a716-446655440000",
  name: "Acme Corporation"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::UpdateTenantRequestItem]

request_options: Trophy::Admin::Tenants::RequestOptions

client.admin.tenants.get(id) -> Trophy::Types::AdminTenant

📝 Description

Get a tenant by ID.

🔌 Usage

client.admin.tenants.get(id: "550e8400-e29b-41d4-a716-446655440000")

⚙️ Parameters

id: String — The UUID of the tenant to retrieve.

request_options: Trophy::Admin::Tenants::RequestOptions

Admin Points Systems

client.admin.points.systems.list() -> Internal::Types::Array[Trophy::Types::AdminPointsSystem]

📝 Description

List points systems.

🔌 Usage

client.admin.points.systems.list(
  limit: 1,
  skip: 1
)

⚙️ Parameters

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Points::Systems::RequestOptions

client.admin.points.systems.create(request) -> Trophy::Types::CreatePointsSystemsResponse

📝 Description

Create points systems. Optionally include sub-entities (levels, boosts, triggers) in each system payload to create them alongside the system.

🔌 Usage

client.admin.points.systems.create(request: [{
  name: "XP",
  key: "xp",
  description: "Experience points",
  levels: [{
    name: "Bronze",
    key: "bronze",
    points: 100
  }, {
    name: "Silver",
    key: "silver",
    points: 500
  }]
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::CreatePointsSystemRequestItem]

request_options: Trophy::Admin::Points::Systems::RequestOptions

client.admin.points.systems.delete() -> Trophy::Types::DeletePointsSystemsResponse

📝 Description

Delete (archive) points systems by ID.

🔌 Usage

client.admin.points.systems.delete(ids: ["550e8400-e29b-41d4-a716-446655440000"])

⚙️ Parameters

ids: String — The IDs of the points systems to delete.

request_options: Trophy::Admin::Points::Systems::RequestOptions

client.admin.points.systems.update(request) -> Trophy::Types::UpdatePointsSystemsResponse

📝 Description

Update points systems by ID.

🔌 Usage

client.admin.points.systems.update(request: [{
  id: "550e8400-e29b-41d4-a716-446655440000",
  name: "New Name"
}])

⚙️ Parameters

request: Internal::Types::Array[Trophy::Types::UpdatePointsSystemRequestItem]

request_options: Trophy::Admin::Points::Systems::RequestOptions

client.admin.points.systems.get(id) -> Trophy::Types::AdminPointsSystem

📝 Description

Get a points system by ID.

🔌 Usage

client.admin.points.systems.get(id: "550e8400-e29b-41d4-a716-446655440000")

⚙️ Parameters

id: String — The ID of the points system.

request_options: Trophy::Admin::Points::Systems::RequestOptions

Admin Points Boosts

client.admin.points.boosts.list(system_id) -> Internal::Types::Array[Trophy::Types::AdminPointsBoost]

📝 Description

List points boosts for a system.

🔌 Usage

client.admin.points.boosts.list(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  limit: 1,
  skip: 1
)

⚙️ Parameters

system_id: String — The UUID of the points system.

limit: Integer — Maximum number of results to return (1-100, default 10).

skip: Integer — Number of results to skip for pagination (default 0).

request_options: Trophy::Admin::Points::Boosts::RequestOptions

client.admin.points.boosts.create(system_id, request) -> Trophy::Types::CreatePointsBoostsResponse

📝 Description

Create points boosts.

🔌 Usage

client.admin.points.boosts.create(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    user_id: "user-123",
    name: "Double XP Weekend",
    start: "2024-01-01",
    end_: "2024-01-03",
    multiplier: 2
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::CreatePointsBoostRequestItem]

request_options: Trophy::Admin::Points::Boosts::RequestOptions

client.admin.points.boosts.delete(system_id) -> Trophy::Types::DeletePointsBoostsResponse

📝 Description

Delete multiple points boosts by ID.

🔌 Usage

client.admin.points.boosts.delete(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  ids: ["ids"]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

ids: String — A list of up to 100 boost IDs.

request_options: Trophy::Admin::Points::Boosts::RequestOptions

client.admin.points.boosts.update(system_id, request) -> Trophy::Types::PatchPointsBoostsResponse

📝 Description

Update multiple points boosts.

🔌 Usage

client.admin.points.boosts.update(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    id: "550e8400-e29b-41d4-a716-446655440000",
    name: "Updated Boost Name",
    multiplier: 3
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::PatchPointsBoostsRequestItem]

request_options: Trophy::Admin::Points::Boosts::RequestOptions

client.admin.points.boosts.get(system_id, id) -> Trophy::Types::AdminPointsBoost

📝 Description

Get a single points boost by ID.

🔌 Usage

client.admin.points.boosts.get(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  id: "660f9500-f30c-42e5-b827-557766550001"
)

⚙️ Parameters

system_id: String — The UUID of the points system.

id: String — The UUID of the points boost.

request_options: Trophy::Admin::Points::Boosts::RequestOptions

Admin Points Levels

client.admin.points.levels.list(system_id) -> Internal::Types::Array[Trophy::Types::AdminPointsLevel]

📝 Description

List points levels for a system.

🔌 Usage

client.admin.points.levels.list(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  limit: 1,
  skip: 1
)

⚙️ Parameters

system_id: String — The UUID of the points system.

limit: Integer — Number of records to return.

skip: Integer — Number of records to skip from the start of the list.

request_options: Trophy::Admin::Points::Levels::RequestOptions

client.admin.points.levels.create(system_id, request) -> Trophy::Types::CreatePointsLevelsResponse

📝 Description

Create points levels. Maximum 100 levels per request.

🔌 Usage

client.admin.points.levels.create(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    name: "Bronze",
    key: "bronze",
    points: 100
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::CreatePointsLevelRequestItem]

request_options: Trophy::Admin::Points::Levels::RequestOptions

client.admin.points.levels.delete(system_id) -> Trophy::Types::DeletePointsLevelsResponse

📝 Description

Delete multiple points levels by ID.

🔌 Usage

client.admin.points.levels.delete(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  ids: ["ids"]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

ids: String — Comma-separated list of level UUIDs to delete.

request_options: Trophy::Admin::Points::Levels::RequestOptions

client.admin.points.levels.update(system_id, request) -> Trophy::Types::PatchPointsLevelsResponse

📝 Description

Update multiple points levels. Each item must include an ID. key cannot be changed.

🔌 Usage

client.admin.points.levels.update(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    id: "550e8400-e29b-41d4-a716-446655440000"
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::PatchPointsLevelsRequestItem]

request_options: Trophy::Admin::Points::Levels::RequestOptions

client.admin.points.levels.get(system_id, id) -> Trophy::Types::AdminPointsLevel

📝 Description

Get a single points level by ID.

🔌 Usage

client.admin.points.levels.get(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  id: "660f9500-f30c-42e5-b827-557766550001"
)

⚙️ Parameters

system_id: String — The UUID of the points system.

id: String — The UUID of the points level.

request_options: Trophy::Admin::Points::Levels::RequestOptions

Admin Points Triggers

client.admin.points.triggers.list(system_id) -> Internal::Types::Array[Trophy::Types::AdminPointsTrigger]

📝 Description

List points triggers for a system.

🔌 Usage

client.admin.points.triggers.list(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  limit: 1,
  skip: 1
)

⚙️ Parameters

system_id: String — The UUID of the points system.

limit: Integer — Maximum number of results to return (1-100, default 10).

skip: Integer — Number of results to skip for pagination (default 0).

request_options: Trophy::Admin::Points::Triggers::RequestOptions

client.admin.points.triggers.create(system_id, request) -> Trophy::Types::CreatePointsTriggersResponse

📝 Description

Create points triggers in bulk. Maximum 100 triggers per request.

🔌 Usage

client.admin.points.triggers.create(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    type: "metric",
    points: 10
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::CreatePointsTriggerRequestItem]

request_options: Trophy::Admin::Points::Triggers::RequestOptions

client.admin.points.triggers.delete(system_id) -> Trophy::Types::DeletePointsTriggersResponse

📝 Description

Delete (archive) points triggers by ID. Maximum 100 trigger IDs per request.

🔌 Usage

client.admin.points.triggers.delete(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  ids: ["550e8400-e29b-41d4-a716-446655440000"]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

ids: String — Trigger IDs to delete. Can be repeated or comma-separated.

request_options: Trophy::Admin::Points::Triggers::RequestOptions

client.admin.points.triggers.update(system_id, request) -> Trophy::Types::PatchPointsTriggersResponse

📝 Description

Update points triggers in bulk. Maximum 100 triggers per request. Only provided fields are updated; omitted fields are preserved.

🔌 Usage

client.admin.points.triggers.update(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  request: [{
    id: "id"
  }]
)

⚙️ Parameters

system_id: String — The UUID of the points system.

request: Internal::Types::Array[Trophy::Types::PatchPointsTriggersRequestItem]

request_options: Trophy::Admin::Points::Triggers::RequestOptions

client.admin.points.triggers.get(system_id, id) -> Trophy::Types::AdminPointsTrigger

📝 Description

Get a single points trigger by ID.

🔌 Usage

client.admin.points.triggers.get(
  system_id: "550e8400-e29b-41d4-a716-446655440000",
  id: "660f9500-f30c-42e5-b827-557766550001"
)

⚙️ Parameters

system_id: String — The UUID of the points system.

id: String — The UUID of the points trigger.

request_options: Trophy::Admin::Points::Triggers::RequestOptions

Admin Streaks Freezes

client.admin.streaks.freezes.create(request) -> Trophy::Types::CreateStreakFreezesResponse

📝 Description

Create streak freezes for multiple users.

🔌 Usage

client.admin.streaks.freezes.create(freezes: [{
  user_id: "user-123"
}, {
  user_id: "user-456"
}, {
  user_id: "user-123"
}])

⚙️ Parameters

freezes: Internal::Types::Array[Trophy::Admin::Streaks::Freezes::Types::CreateStreakFreezesRequestFreezesItem] — Array of freezes to create. Maximum 100 freezes per request.

request_options: Trophy::Admin::Streaks::Freezes::RequestOptions