openapi: 3.2.0 info: title: Test Observer Users API description: Test Observer API (see https://github.com/canonical/test_observer) license: name: GNU Affero General Public License v3 url: https://raw.githubusercontent.com/canonical/test_observer/refs/heads/main/backend/LICENSE version: 0.1.0 tags: - name: Users paths: /v1/users/me: get: tags: - Users summary: Get Authenticated User operationId: get_authenticated_user_v1_users_me_get responses: '200': description: Successful Response content: application/json: schema: anyOf: - $ref: '#/components/schemas/UserResponse' - type: 'null' title: Response Get Authenticated User V1 Users Me Get /v1/users: get: tags: - Users summary: Get Users operationId: get_users_v1_users_get parameters: - name: limit in: query required: false schema: type: integer maximum: 1000 minimum: 1 description: 'Maximum number of results to return (default: 50)' default: 50 title: Limit description: 'Maximum number of results to return (default: 50)' - name: offset in: query required: false schema: type: integer minimum: 0 description: 'Number of results to skip for pagination (default: 0)' default: 0 title: Offset description: 'Number of results to skip for pagination (default: 0)' - name: q in: query required: false schema: anyOf: - type: string - type: 'null' description: Search term for user email, name, launchpad handle, or id title: Q description: Search term for user email, name, launchpad handle, or id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UsersResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_user /v1/users/{user_id}: get: tags: - Users summary: Get User operationId: get_user_v1_users__user_id__get parameters: - name: user_id in: path required: true schema: type: integer title: User Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UserResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - view_user delete: tags: - Users summary: Delete User operationId: delete_user_v1_users__user_id__delete parameters: - name: user_id in: path required: true schema: type: integer title: User Id responses: '204': description: Successful Response '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_user patch: tags: - Users summary: Update User operationId: update_user_v1_users__user_id__patch parameters: - name: user_id in: path required: true schema: type: integer title: User Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UserPatch' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/UserResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' x-permissions: - change_user components: schemas: 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 TeamMinimalResponse: properties: id: type: integer title: Id name: type: string title: Name permissions: items: type: string type: array title: Permissions type: object required: - id - name - permissions title: TeamMinimalResponse UserPatch: properties: is_admin: anyOf: - type: boolean - type: 'null' title: Is Admin type: object title: UserPatch UserResponse: properties: id: type: integer title: Id email: type: string title: Email name: type: string title: Name launchpad_handle: anyOf: - type: string - type: 'null' title: Launchpad Handle teams: items: $ref: '#/components/schemas/TeamMinimalResponse' type: array title: Teams is_admin: type: boolean title: Is Admin type: object required: - id - email - name - teams - is_admin title: UserResponse HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError UsersResponse: properties: users: items: $ref: '#/components/schemas/UserResponse' type: array title: Users count: type: integer title: Count limit: type: integer title: Limit offset: type: integer title: Offset type: object required: - users - count - limit - offset title: UsersResponse