Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions admin-api/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Authentication
description: Integrate securely with the API using account-level API keys
transmitted in the `X-API-KEY` header.
og:description: Integrate securely with the Trophy API using account-level API
keys transmitted in the `X-API-KEY` header.
icon: key
---

The Trophy Admin API is authenticated using the same API keys as the [Application API](/api-reference/authentication).

## Get Support {#get-support}

Want to get in touch with the Trophy team? Reach out to us via [email](mailto:support@trophy.so). We're here to help!

36 changes: 36 additions & 0 deletions admin-api/client-libraries.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Client Libraries
description: Use Trophy's type-safe SDKs to integrate with the API.
og:description: Use Trophy's type-safe SDKs to integrate with the API and start
building gamified product experiences.
icon: code-xml
---

The Trophy Admin API is available in the same SDKs as the [Application API](/api-reference/client-libraries), under the `trophy.admin` namespace.

Check warning on line 9 in admin-api/client-libraries.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trophy) - vale-spellcheck

admin-api/client-libraries.mdx#L9

Did you really mean 'namespace'?

For example in NodeJs you can use the following code to create a points boost through the `admin` namespace:

```javascript Admin API Usage
import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient({
apiKey: 'YOUR_API_KEY'
});

const response = await trophy.admin.points.boosts.create({
systemKey: 'xp',
boosts: [
{
userId: 'user-123',
name: 'Double XP Weekend',
start: '2024-01-01',
end: '2024-01-03',
multiplier: 2
}
]
});
```

## Get Support {#get-support}

Want to get in touch with the Trophy team? Reach out to us via [email](mailto:support@trophy.so). We're here to help!
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create attributes in bulk
openapi: openapi.yml post /attributes
openapi: openapi/admin.yml post /attributes
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Delete attributes in bulk
openapi: openapi.yml delete /attributes
openapi: openapi/admin.yml delete /attributes
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/attributes/get-an-attribute.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get an attribute
openapi: openapi.yml get /attributes/{id}
openapi: openapi/admin.yml get /attributes/{id}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/attributes/list-attributes.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: List attributes
openapi: openapi.yml get /attributes
openapi: openapi/admin.yml get /attributes
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Update attributes in bulk
openapi: openapi.yml patch /attributes
openapi: openapi/admin.yml patch /attributes
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
10 changes: 10 additions & 0 deletions admin-api/endpoints/leaderboards/create-leaderboards-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Create leaderboards in bulk
openapi: openapi/admin.yml post /leaderboards
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";

**Rate Limits**

<RateLimitBadge tier={1} />
10 changes: 10 additions & 0 deletions admin-api/endpoints/leaderboards/delete-leaderboards-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Delete leaderboards in bulk
openapi: openapi/admin.yml delete /leaderboards
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";

**Rate Limits**

<RateLimitBadge tier={1} />
10 changes: 10 additions & 0 deletions admin-api/endpoints/leaderboards/get-a-leaderboard.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Get a leaderboard
openapi: openapi/admin.yml get /leaderboards/{id}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";

**Rate Limits**

<RateLimitBadge tier={1} />
10 changes: 10 additions & 0 deletions admin-api/endpoints/leaderboards/list-leaderboards.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: List leaderboards
openapi: openapi/admin.yml get /leaderboards
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";

**Rate Limits**

<RateLimitBadge tier={1} />
10 changes: 10 additions & 0 deletions admin-api/endpoints/leaderboards/update-leaderboards-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Update leaderboards in bulk
openapi: openapi/admin.yml patch /leaderboards
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";

**Rate Limits**

<RateLimitBadge tier={1} />
2 changes: 1 addition & 1 deletion admin-api/endpoints/metrics/create-metrics-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create metrics in bulk
openapi: openapi.yml post /metrics
openapi: openapi/admin.yml post /metrics
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/metrics/delete-metrics-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Delete metrics in bulk
openapi: openapi.yml delete /metrics
openapi: openapi/admin.yml delete /metrics
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/metrics/get-a-metric-by-id.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a metric by ID
openapi: openapi.yml get /metrics/{id}
openapi: openapi/admin.yml get /metrics/{id}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/metrics/list-metrics.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: List metrics
openapi: openapi.yml get /metrics
openapi: openapi/admin.yml get /metrics
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/metrics/update-metrics-in-bulk.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Update metrics in bulk
openapi: openapi.yml patch /metrics
openapi: openapi/admin.yml patch /metrics
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/points/archive-boosts-batch.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Delete multiple points boosts
openapi: openapi.yml delete /points/boosts
openapi: openapi/admin.yml delete /points/boosts
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/points/create-boosts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create points boosts for multiple users
openapi: openapi.yml post /points/boosts
openapi: openapi/admin.yml post /points/boosts
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/streaks/grant-freezes.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create streak freezes for multiple users
openapi: openapi.yml post /streaks/freezes
openapi: openapi/admin.yml post /streaks/freezes
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion admin-api/endpoints/streaks/restore-streaks.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Restore streaks for multiple users
openapi: openapi.yml post /streaks/restore
openapi: openapi/admin.yml post /streaks/restore
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
20 changes: 20 additions & 0 deletions admin-api/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ The Admin API is accessible through **the same SDKs** as the Application API or,
https://admin.trophy.so/v1
```

## Get Started {#get-started}

Learn more about how to integrate with the Trophy Admin API below.

<CardGroup>
<Card title="Authentication" icon="key" href="/admin-api/authentication">
Securely integrate your applications with the Trophy Admin API.
</Card>
<Card
title="Rate Limiting"
icon="circle-gauge"
href="/admin-api/rate-limiting"
>
Learn about the Trophy Admin API and request rate limiting.
</Card>
<Card title="SDKs" icon="code-xml" href="/admin-api/client-libraries">
Use Trophy’s type-safe SDKs to integrate with the Admin API.
</Card>
</CardGroup>

<Note>
Have a use case you think you need an admin API for? [Tell us about
it](mailto:support@trophy.so) and we'll build it!
Expand Down
19 changes: 19 additions & 0 deletions admin-api/rate-limiting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Rate Limiting
description: Learn about the Trophy API and request rate limiting.
og:description: Learn about the Trophy API and request rate limiting.
icon: circle-gauge
---

import { RateLimitBadge } from "../components/rate-limit-badge.jsx";

All admin API endpoints are rate limited according to <RateLimitBadge tier={1} /> of the application API's [rate limiting](/api-reference/rate-limiting) model.

<Tip>
If you feel you need a higher rate limit, then please [contact
us](mailto:support@trophy.so) and we'll be happy to discuss your needs.
</Tip>

## Get Support {#get-support}

Want to get in touch with the Trophy team? Reach out to us via [email](mailto:support@trophy.so). We're here to help!
2 changes: 1 addition & 1 deletion api-reference/endpoints/achievements/all-achievements.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get all achievements and their completion stats
openapi: openapi.yml get /achievements
openapi: openapi/application.yml get /achievements
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Mark an achievement as completed
openapi: openapi.yml post /achievements/{key}/complete
openapi: openapi/application.yml post /achievements/{key}/complete
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get all leaderboards
openapi: openapi.yml get /leaderboards
openapi: openapi/application.yml get /leaderboards
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/leaderboards/get-leaderboard.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a single leaderboard
openapi: openapi.yml get /leaderboards/{key}
openapi: openapi/application.yml get /leaderboards/{key}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Send a metric change event
openapi: openapi.yml post /metrics/{key}/event
openapi: openapi/application.yml post /metrics/{key}/event
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/points/get-points-boosts.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get boosts for a points system
openapi: openapi.yml get /points/{key}/boosts
openapi: openapi/application.yml get /points/{key}/boosts
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get level summary for a points system
openapi: openapi.yml get /points/{key}/level-summary
openapi: openapi/application.yml get /points/{key}/level-summary
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/points/get-points-levels.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get levels for a points system
openapi: openapi.yml get /points/{key}/levels
openapi: openapi/application.yml get /points/{key}/levels
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/points/get-points-summary.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a breakdown of users by points
openapi: openapi.yml get /points/{key}/summary
openapi: openapi/application.yml get /points/{key}/summary
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/points/get-points.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a points system with its triggers
openapi: openapi.yml get /points/{key}
openapi: openapi/application.yml get /points/{key}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/streaks/get-streak-rankings.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get top users by streak length
openapi: openapi.yml get /streaks/rankings
openapi: openapi/application.yml get /streaks/rankings
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/streaks/get-streaks.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get the streak lengths of a list of users
openapi: openapi.yml get /streaks
openapi: openapi/application.yml get /streaks
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/users/create-a-user.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Create a new user
openapi: openapi.yml post /users
openapi: openapi/application.yml post /users
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a summary of metric events over time
openapi: openapi.yml get /users/{id}/metrics/{key}/event-summary
openapi: openapi/application.yml get /users/{id}/metrics/{key}/event-summary
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a single metric for a user
openapi: openapi.yml get /users/{id}/metrics/{key}
openapi: openapi/application.yml get /users/{id}/metrics/{key}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
2 changes: 1 addition & 1 deletion api-reference/endpoints/users/get-a-single-user.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get a single user
openapi: openapi.yml get /users/{id}
openapi: openapi/application.yml get /users/{id}
---

import { RateLimitBadge } from "../../../components/rate-limit-badge.jsx";
Expand Down
Loading
Loading