Popsink admin API

The admin API from Popsink — 2 operation(s) for admin.

OpenAPI Specification

popsink-admin-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fast admin API
  version: 0.1.0
servers:
- url: /api
tags:
- name: admin
paths:
  /users/export-all:
    get:
      tags:
      - admin
      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:
      - admin
      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: []
components:
  schemas:
    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.
    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.
    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.
    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.
    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.
    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.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: auth/jwt/login