Popsink users API
The users API from Popsink — 7 operation(s) for users.
The users API from Popsink — 7 operation(s) for users.
openapi: 3.1.0
info:
title: Fast admin users API
version: 0.1.0
servers:
- url: /api
tags:
- name: users
paths:
/users:
get:
tags:
- users
summary: Users:List Users
description: Get all users.
operationId: users_list_users_users_get
security:
- OAuth2PasswordBearer: []
parameters:
- name: page
in: query
required: false
schema:
type: integer
minimum: 1
default: 1
title: Page
- name: size
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 50
title: Size
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Page_UserRead_'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/users/me/change-password:
post:
tags:
- users
summary: Users:Change Password
description: "Change the current user's password.\n\nArgs:\n password_data: Password change data\n user: Current authenticated user\n\nReturns:\n Updated user information"
operationId: users_change_password_users_me_change_password_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserPasswordChange'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UserRead'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- OAuth2PasswordBearer: []
/users/export-all:
get:
tags:
- users
summary: Export all users, envs, teams, and their relations
description: Export all users, environments, teams, and their relationships as a structured data object. Requires admin privileges.
operationId: export_all_data_users_export_all_get
responses:
'200':
description: A data structure containing users, environments, teams, and their relationships
content:
application/json:
schema:
$ref: '#/components/schemas/ExportData-Output'
security:
- OAuth2PasswordBearer: []
/users/import-all:
post:
tags:
- users
summary: Import all users, envs, teams, and their relations
description: Import all users, environments, teams, and their relationships from a structured data object. Requires admin privileges. This will overwrite all existing data.
operationId: import_all_data_users_import_all_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ExportData-Input'
description: Exported data to import
required: true
responses:
'204':
description: Import completed successfully.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- OAuth2PasswordBearer: []
/users/me:
get:
tags:
- users
summary: Users:Current User
operationId: users_current_user_users_me_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UserRead'
'401':
description: Missing token or inactive user.
security:
- OAuth2PasswordBearer: []
patch:
tags:
- users
summary: Users:Patch Current User
operationId: users_patch_current_user_users_me_patch
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserSafeUpdate'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UserRead'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorModel'
examples:
UPDATE_USER_EMAIL_ALREADY_EXISTS:
summary: A user with this email already exists.
value:
detail: UPDATE_USER_EMAIL_ALREADY_EXISTS
UPDATE_USER_INVALID_PASSWORD:
summary: Password validation failed.
value:
detail:
code: UPDATE_USER_INVALID_PASSWORD
reason: Password should beat least 3 characters
'401':
description: Missing token or inactive user.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- OAuth2PasswordBearer: []
/users/{id}:
get:
tags:
- users
summary: Users:User
operationId: users_user_users__id__get
security:
- OAuth2PasswordBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
title: Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UserRead'
'401':
description: Missing token or inactive user.
'403':
description: Not a superuser.
'404':
description: The user does not exist.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
patch:
tags:
- users
summary: Users:Patch User
operationId: users_patch_user_users__id__patch
security:
- OAuth2PasswordBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
title: Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserSafeUpdate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UserRead'
'400':
content:
application/json:
examples:
UPDATE_USER_EMAIL_ALREADY_EXISTS:
summary: A user with this email already exists.
value:
detail: UPDATE_USER_EMAIL_ALREADY_EXISTS
UPDATE_USER_INVALID_PASSWORD:
summary: Password validation failed.
value:
detail:
code: UPDATE_USER_INVALID_PASSWORD
reason: Password should beat least 3 characters
schema:
$ref: '#/components/schemas/ErrorModel'
description: Bad Request
'401':
description: Missing token or inactive user.
'403':
description: Not a superuser.
'404':
description: The user does not exist.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- users
summary: Users:Delete User
operationId: users_delete_user_users__id__delete
security:
- OAuth2PasswordBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
title: Id
responses:
'204':
description: Successful Response
'401':
description: Missing token or inactive user.
'403':
description: Not a superuser.
'404':
description: The user does not exist.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/users/me/:
get:
summary: Get Me
description: Get the current user.
operationId: get_me_users_me__get
parameters:
- required: false
schema:
title: Authorization
type: string
default: ''
name: authorization
in: header
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- users
components:
schemas:
UserRead:
properties:
id:
type: string
format: uuid
title: Id
email:
type: string
format: email
title: Email
is_active:
type: boolean
title: Is Active
default: true
is_superuser:
type: boolean
title: Is Superuser
default: false
is_verified:
type: boolean
title: Is Verified
default: false
active_env_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Active Env Id
type: object
required:
- id
- email
- active_env_id
title: UserRead
description: Read a user.
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
type: object
required:
- loc
- msg
- type
title: ValidationError
BrokerConfiguration:
properties:
bootstrap_server:
type: string
title: Bootstrap Server
security_protocol:
type: string
enum:
- PLAINTEXT
- SASL_PLAINTEXT
- SASL_SSL
- SSL
title: Security Protocol
sasl_mechanism:
type: string
enum:
- OAUTHBEARER
- PLAIN
- SCRAM-SHA-256
- SCRAM-SHA-512
- GSSAPI
title: Sasl Mechanism
sasl_username:
type: string
title: Sasl Username
sasl_password:
type: string
title: Sasl Password
ca_cert:
type: string
title: Ca Cert
default: ''
type: object
required:
- bootstrap_server
- security_protocol
- sasl_mechanism
- sasl_username
- sasl_password
title: BrokerConfiguration
description: Broker configuration.
EnvExport:
properties:
name:
type: string
title: Name
description: Name of the environment
examples:
- staging
use_retention:
type: boolean
title: Use Retention
description: Whether message retention is enabled for this environment
examples:
- true
retention_configuration:
anyOf:
- $ref: '#/components/schemas/BrokerConfiguration'
- type: 'null'
description: Retention policy configuration if retention is enabled
id:
type: string
format: uuid
title: Id
description: Unique identifier of the environment
type: object
required:
- name
- use_retention
- id
title: EnvExport
description: Environment export data model.
ExportData-Input:
properties:
users:
items:
$ref: '#/components/schemas/UserExport'
type: array
title: Users
description: List of all users in the system
envs:
items:
$ref: '#/components/schemas/EnvExport'
type: array
title: Envs
description: List of all environments in the system
teams:
items:
$ref: '#/components/schemas/TeamExport'
type: array
title: Teams
description: List of all teams in the system
env_members:
items:
$ref: '#/components/schemas/EnvMemberExport'
type: array
title: Env Members
description: List of all user-environment membership relationships
team_members:
items:
$ref: '#/components/schemas/TeamMemberExport'
type: array
title: Team Members
description: List of all user-team membership relationships
type: object
required:
- users
- envs
- teams
- env_members
- team_members
title: ExportData
description: Complete data export model containing all system entities and their relationships.
EnvMemberExport:
properties:
user_id:
type: string
format: uuid
title: User Id
description: Unique identifier of the user being added
examples:
- d290f1ee-6c54-4b01-90e6-d701748f0851
env_id:
type: string
format: uuid
title: Env Id
description: Unique identifier of the env
examples:
- a7d1f2fc-6e92-4dcd-b1f6-4200e4e9f1f3
admin:
type: boolean
title: Admin
description: Whether the user has admin privileges in the env
examples:
- true
type: object
required:
- user_id
- env_id
- admin
title: EnvMemberExport
description: Environment member export data model.
Page_UserRead_:
properties:
items:
items:
$ref: '#/components/schemas/UserRead'
type: array
title: Items
total:
anyOf:
- type: integer
minimum: 0
- type: 'null'
title: Total
page:
anyOf:
- type: integer
minimum: 1
- type: 'null'
title: Page
size:
anyOf:
- type: integer
minimum: 1
- type: 'null'
title: Size
pages:
anyOf:
- type: integer
minimum: 0
- type: 'null'
title: Pages
type: object
required:
- items
- total
- page
- size
title: Page[UserRead]
ExportData-Output:
properties:
users:
items:
$ref: '#/components/schemas/UserExport'
type: array
title: Users
description: List of all users in the system
envs:
items:
$ref: '#/components/schemas/EnvExport'
type: array
title: Envs
description: List of all environments in the system
teams:
items:
$ref: '#/components/schemas/TeamExport'
type: array
title: Teams
description: List of all teams in the system
env_members:
items:
$ref: '#/components/schemas/EnvMemberExport'
type: array
title: Env Members
description: List of all user-environment membership relationships
team_members:
items:
$ref: '#/components/schemas/TeamMemberExport'
type: array
title: Team Members
description: List of all user-team membership relationships
type: object
required:
- users
- envs
- teams
- env_members
- team_members
title: ExportData
description: Complete data export model containing all system entities and their relationships.
UserSafeUpdate:
properties:
password:
anyOf:
- type: string
- type: 'null'
title: Password
email:
anyOf:
- type: string
format: email
- type: 'null'
title: Email
is_active:
anyOf:
- type: boolean
- type: 'null'
title: Is Active
is_superuser:
anyOf:
- type: boolean
- type: 'null'
title: Is Superuser
is_verified:
anyOf:
- type: boolean
- type: 'null'
title: Is Verified
active_env_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Active Env Id
type: object
title: UserSafeUpdate
description: Update a user without password.
UserExport:
properties:
id:
type: string
format: uuid
title: Id
email:
type: string
format: email
title: Email
is_active:
type: boolean
title: Is Active
default: true
is_superuser:
type: boolean
title: Is Superuser
default: false
is_verified:
type: boolean
title: Is Verified
default: false
active_env_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Active Env Id
type: object
required:
- id
- email
- active_env_id
title: UserExport
description: User export data model.
TeamMemberExport:
properties:
user_id:
type: string
format: uuid
title: User Id
description: Unique identifier of the user being added
examples:
- d290f1ee-6c54-4b01-90e6-d701748f0851
team_id:
type: string
format: uuid
title: Team Id
description: Unique identifier of the team
examples:
- a7d1f2fc-6e92-4dcd-b1f6-4200e4e9f1f3
admin:
type: boolean
title: Admin
description: Whether the user has admin privileges in the team
examples:
- true
type: object
required:
- user_id
- team_id
- admin
title: TeamMemberExport
description: Team member export data model.
UserPasswordChange:
properties:
old_password:
type: string
title: Old Password
new_password:
type: string
title: New Password
type: object
required:
- old_password
- new_password
title: UserPasswordChange
description: Change user password.
TeamExport:
properties:
name:
type: string
title: Name
description: Name of the team
examples:
- Data Avengers
description:
type: string
title: Description
description: Short description of the team
examples:
- Team managing data pipelines and infrastructure.
env_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Env Id
description: Optional environment ID the team is associated with
examples:
- bfe91314-1234-4c6f-bb0c-01867487cc23
id:
type: string
format: uuid
title: Id
description: Unique identifier for the team
examples:
- 8c18a0db-3b10-4f9b-a7d3-6e837bafacb0
type: object
required:
- name
- description
- id
title: TeamExport
description: Team export data model.
ErrorModel:
properties:
detail:
anyOf:
- type: string
- additionalProperties:
type: string
type: object
title: Detail
type: object
required:
- detail
title: ErrorModel
securitySchemes:
OAuth2PasswordBearer:
type: oauth2
flows:
password:
scopes: {}
tokenUrl: auth/jwt/login