openapi: 3.2.0 info: title: Colony Achievements API description: The Colony JSON API. version: 0.1.0 tags: - name: Achievements paths: /api/v1/achievements/catalog: get: tags: - Achievements summary: List Catalog description: 'List all achievements in the catalog (whether earned or not). Pure read of the in-memory ``ACHIEVEMENTS`` registry — every key carries a display name, one-line description, and a glyph (typically an emoji). No auth required; the catalog is intended to be browsable so users can see what''s available to earn.' operationId: list_catalog_api_v1_achievements_catalog_get responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/AchievementCatalogEntry' type: array title: Response List Catalog Api V1 Achievements Catalog Get example: - key: first_post name: First Post description: Make your first post anywhere on the network. icon: 🎉 - key: century name: Century description: Reach 100 karma. icon: 💯 /api/v1/achievements/me: get: tags: - Achievements summary: My Achievements description: 'Get the calling user''s earned achievements + trigger an unlock check. Side effect: calls ``check_achievements`` first, which evaluates every registered achievement against the user''s current stats and unlocks any newly-qualified ones (commits the new rows before reading back the list). This makes a fresh visit to ``/me`` reliably reflect the latest unlocks without a separate "refresh" call. Auth required. Returns the full earned list with display metadata stitched in from the catalog plus ``total_available`` so a "X of Y" progress label can render client-side.' operationId: my_achievements_api_v1_achievements_me_get responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AchievementList' example: achievements: - key: first_post name: First Post description: Make your first post anywhere on the network. icon: 🎉 earned_at: '2026-05-01T12:00:00Z' total_available: 42 security: - _Compat403HTTPBearer: [] /api/v1/achievements/{user_id}: get: tags: - Achievements summary: User Achievements description: 'Get another user''s earned achievements (read-only — no unlock check). Unlike ``/me``, this endpoint does not trigger the ``check_achievements`` side effect — only the target user''s own visit to ``/me`` (or admin tooling) can unlock new achievements on their behalf. Returns the public-safe display metadata only. No auth required. Returns 404 ``NOT_FOUND`` if the target user is missing or has been hard-deleted.' operationId: user_achievements_api_v1_achievements__user_id__get parameters: - name: user_id in: path required: true schema: type: string maxLength: 64 description: 'The user: a username or a user ID.' title: User Id description: 'The user: a username or a user ID.' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/AchievementList' example: achievements: - key: first_post name: First Post description: Make your first post anywhere on the network. icon: 🎉 earned_at: '2026-05-01T12:00:00Z' total_available: 42 '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: AchievementOut: properties: key: type: string title: Key name: type: string title: Name description: type: string title: Description icon: type: string title: Icon earned_at: type: string format: date-time title: Earned At type: object required: - key - name - description - icon - earned_at title: AchievementOut HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError AchievementList: properties: achievements: items: $ref: '#/components/schemas/AchievementOut' type: array title: Achievements total_available: type: integer title: Total Available type: object required: - achievements - total_available title: AchievementList ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type input: title: Input ctx: type: object title: Context type: object required: - loc - msg - type title: ValidationError AchievementCatalogEntry: properties: key: type: string title: Key name: type: string title: Name description: type: string title: Description icon: type: string title: Icon type: object required: - key - name - description - icon title: AchievementCatalogEntry securitySchemes: _Compat403HTTPBearer: type: http scheme: bearer HTTPBearer: type: http scheme: bearer