> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qbridge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List a user's achievements

> Returns every achievement the user has earned, most recently earned first.
The list is empty when the user has earned none, and also when no user has this id. It is not paged.

**Who can call it:** The machine key only. No staff role is enough.



## OpenAPI

````yaml /openapi.yaml get /users/{id}/achievements
openapi: 3.1.0
info:
  description: >-
    Authenticated endpoints need a bearer token: `Authorization: Bearer
    <token>`.

    Each endpoint says whether it needs one. Public endpoints need none.

    A person sends the token they signed in with. A machine, such as a Billy Q
    box, sends its machine key the same way.

    Each endpoint ends with who can call it, and "Who can call what" lists every
    endpoint against every role.


    Every response is wrapped the same way: `status` is always present
    (`success` or `error`),

    `message` carries text that is safe to show a user, and `data` holds the
    payload on success.

    One exception: a 410 for a session that has ended carries the status
    `ended`.


    Money is in minor units (pence). Timestamps are RFC 3339 in UTC. Dates are
    `YYYY-MM-DD`.
  title: CueBridge API
  version: 0.1.0
servers:
  - description: Pre-production
    url: https://api.preprod.poolhouse.dev/api
security: []
tags:
  - description: Confirmed bookings at a venue.
    name: Bookings
  - description: A booking's time at its tables, from check-in to the end of play.
    name: Sessions
  - description: The players checked in to a session.
    name: Session players
  - description: Games played during a session, and the game types a venue offers.
    name: Games
  - description: Shots recorded during a game, and the ratings derived from them.
    name: Game shots
  - description: Per-player statistics and the stat types they are measured in.
    name: Stats
  - description: A venue's pool tables.
    name: Pool tables
  - description: The items placed on a venue's floor plan.
    name: Floor plan
  - description: Achievements players have earned.
    name: Achievements
paths:
  /users/{id}/achievements:
    get:
      tags:
        - Achievements
      summary: List a user's achievements
      description: >-
        Returns every achievement the user has earned, most recently earned
        first.

        The list is empty when the user has earned none, and also when no user
        has this id. It is not paged.


        **Who can call it:** The machine key only. No staff role is enough.
      operationId: listAchievementsByUser
      parameters:
        - description: User id
          in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api.ResponseOf-array_handlers_earnedAchievementResponse
          description: The user's achievements.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: The id is not a UUID.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: The bearer token is missing, invalid or expired.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: The caller may not look up achievements by user id.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.Response'
          description: Something went wrong on our side.
      security:
        - BearerAuth: []
components:
  schemas:
    api.ResponseOf-array_handlers_earnedAchievementResponse:
      properties:
        data:
          description: The payload. Left out when there is none.
          items:
            $ref: '#/components/schemas/handlers.earnedAchievementResponse'
          type: array
        message:
          description: Text that is safe to show a user. Left out when there is none.
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/api.Status'
          description: >-
            `success` or `error`. A 410 for a session that has ended says
            `ended` instead.
      type: object
    api.Response:
      properties:
        data:
          description: The payload. Left out when there is none.
        message:
          description: Text that is safe to show a user. Left out when there is none.
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/api.Status'
          description: >-
            `success` or `error`. A 410 for a session that has ended says
            `ended` instead.
      type: object
    handlers.earnedAchievementResponse:
      properties:
        earned_at:
          format: date-time
          type: string
        family:
          $ref: '#/components/schemas/models.AchievementFamily'
        game_id:
          format: uuid
          type: string
        id:
          description: >-
            The id of this earning of the achievement by this player, not of the
            achievement itself.
          format: uuid
          type: string
        name:
          type: string
        session_id:
          format: uuid
          type: string
        slug:
          type: string
        threshold:
          type: integer
        tier:
          type: integer
      type: object
    api.Status:
      enum:
        - success
        - error
        - ended
      type: string
      x-enum-varnames:
        - StatusSuccess
        - StatusError
        - StatusEnded
    models.AchievementFamily:
      enum:
        - visit_number
        - pot_total
        - weekly_warrior
        - pot_streak
        - full_house
      type: string
      x-enum-comments:
        AchievementFamilyFullHouse: played ≥1 ended game of every game type
        AchievementFamilyPotStreak: consecutive successful shots (see streak classifier)
        AchievementFamilyPotTotal: count of successful shots
        AchievementFamilyVisitNumber: count of ended sessions the user was checked into
        AchievementFamilyWeeklyWarrior: consecutive calendar weeks with ≥1 ended session
      x-enum-descriptions:
        - count of ended sessions the user was checked into
        - count of successful shots
        - consecutive calendar weeks with ≥1 ended session
        - consecutive successful shots (see streak classifier)
        - played ≥1 ended game of every game type
      x-enum-varnames:
        - AchievementFamilyVisitNumber
        - AchievementFamilyPotTotal
        - AchievementFamilyWeeklyWarrior
        - AchievementFamilyPotStreak
        - AchievementFamilyFullHouse
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.