Experience
Read XP, level and achievements
XP for each published post and each achievement, counted from the workspace's own activity.
GET
/v1/experienceTL;DR
| Question | Answer |
|---|---|
| What does it do? | Read XP, level and achievements. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | Nothing. |
| What does it return? | Status 200 with a body of type Experience. |
| In the SDK? | flung.experience.get() |
| As an MCP tool? | get_experience |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape. |
What it does
XP for each published post and each achievement, counted from the workspace's own activity. Achievements stay earned.
Example
bash
curl -X GET 'https://api.flung.dev/v1/experience' \ --header "Authorization: Bearer $FLUNG_API_KEY"ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.experience.get()js
const response = await fetch('https://api.flung.dev/v1/experience', { method: 'GET', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, },})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()A successful answer looks like this:
json
{ "xp": 1, "level": 1, "xpIntoLevel": 1, "xpForNextLevel": 1, "streakDays": 1, "leaderboardName": "string", "achievements": [ { "id": "first-post", "name": "string", "description": "string", "category": "string", "rarity": "common", "xp": 1, "unlocked": true, "unlockedAt": "2026-11-01T09:00:00.000Z", "progress": {} } ]}Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The workspace's experience. | Experience |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 200 answer has the type Experience.
| Field | Type | Required | Description |
|---|---|---|---|
xp | integer | yes | |
level | integer | yes | |
xpIntoLevel | integer | yes | |
xpForNextLevel | integer | yes | |
streakDays | integer | yes | Days in a row with a published post, up to today or yesterday. |
leaderboardName | string | null | yes | The name on the public leaderboard; null when the workspace is not on it. |
achievements | Achievement[] | yes | |
achievements[].id | string | yes | |
achievements[].name | string | yes | |
achievements[].description | string | yes | |
achievements[].category | string | yes | |
achievements[].rarity | "common" | "rare" | "epic" | "legendary" | yes | |
achievements[].xp | integer | yes | |
achievements[].unlocked | boolean | yes | |
achievements[].unlockedAt | string | null | yes | When Flung first saw it earned. |
achievements[].progress | object | yes | |
achievements[].progress.current | integer | yes | |
achievements[].progress.target | integer | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |
get_experience | The same operation as an MCP tool |