api.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. openapi: 3.0.3
  2. info:
  3. title: User Management API
  4. description: API that provides management functionality for Retro AIM Server operators.
  5. version: 1.0.0
  6. paths:
  7. /user:
  8. get:
  9. summary: Get all users
  10. description: Retrieve a list of all user accounts without passwords.
  11. responses:
  12. '200':
  13. description: Successful response containing a list of users without passwords.
  14. content:
  15. application/json:
  16. schema:
  17. type: array
  18. items:
  19. type: object
  20. properties:
  21. screen_name:
  22. type: string
  23. description: The user's screen name.
  24. post:
  25. summary: Create a new user
  26. description: Create a new user account with a screen name and password.
  27. requestBody:
  28. required: true
  29. content:
  30. application/json:
  31. schema:
  32. type: object
  33. properties:
  34. screen_name:
  35. type: string
  36. description: The user's screen name.
  37. password:
  38. type: string
  39. description: The user's password for account creation.
  40. responses:
  41. '201':
  42. description: User account created successfully.
  43. '400':
  44. description: Bad request. Invalid input data.
  45. '409':
  46. description: Conflict. A user with the specified screen name already exists.
  47. delete:
  48. summary: Delete a user
  49. description: Delete a user account specified by their screen name.
  50. requestBody:
  51. required: true
  52. content:
  53. application/json:
  54. schema:
  55. type: object
  56. properties:
  57. screen_name:
  58. type: string
  59. description: The screen name of the user to delete.
  60. responses:
  61. '204':
  62. description: User deleted successfully.
  63. '404':
  64. description: User not found.
  65. /session:
  66. get:
  67. summary: Get active sessions
  68. description: Retrieve a list of active sessions of logged in users.
  69. responses:
  70. '200':
  71. description: Successful response containing a list of active sessions.
  72. content:
  73. application/json:
  74. schema:
  75. type: object
  76. properties:
  77. count:
  78. type: integer
  79. description: The number of active sessions.
  80. sessions:
  81. type: array
  82. items:
  83. type: object
  84. properties:
  85. screen_name:
  86. type: string
  87. description: The screen name associated with the session.
  88. /user/password:
  89. put:
  90. summary: Set a user's password
  91. description: Update the password for a user specified by their screen name.
  92. requestBody:
  93. required: true
  94. content:
  95. application/json:
  96. schema:
  97. type: object
  98. properties:
  99. screen_name:
  100. type: string
  101. description: The screen name of the user whose password is to be updated.
  102. password:
  103. type: string
  104. description: The new password for the user.
  105. responses:
  106. '204':
  107. description: Password updated successfully.
  108. '400':
  109. description: Bad request. Invalid input data.
  110. '404':
  111. description: User not found.