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

# Upsert Firebase Config



## OpenAPI

````yaml https://api.vellaro.io/openapi.json put /api/v1/admin/firebase
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/admin/firebase:
    put:
      tags:
        - admin:firebase
      summary: Upsert Firebase Config
      operationId: upsert_firebase_config_api_v1_admin_firebase_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FirebaseConfigUpsert'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_FirebaseConfigOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    FirebaseConfigUpsert:
      properties:
        service_account_json:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Account Json
          description: Full Google service-account JSON, pasted as a string.
        android_apps:
          items:
            $ref: '#/components/schemas/AndroidApp'
          type: array
          title: Android Apps
        ios_apps:
          items:
            $ref: '#/components/schemas/IosApp'
          type: array
          title: Ios Apps
        web_apps:
          items:
            $ref: '#/components/schemas/WebApp'
          type: array
          title: Web Apps
        web_push_vapid_key:
          anyOf:
            - type: string
              maxLength: 300
            - type: 'null'
          title: Web Push Vapid Key
        default_channel_id:
          type: string
          maxLength: 60
          minLength: 1
          title: Default Channel Id
          default: default
        default_channel_name:
          type: string
          maxLength: 120
          minLength: 1
          title: Default Channel Name
          default: Notifications
        is_active:
          type: boolean
          title: Is Active
          default: true
      additionalProperties: false
      type: object
      title: FirebaseConfigUpsert
      description: |-
        Body of PUT /admin/firebase.

        The `service_account_json` field accepts the raw text the operator
        pastes from the Firebase console "Generate new private key" dialog.
        We validate the structure (must look like a Google service-account
        file) before encrypting it.

        Following the keep-on-omit pattern from `tenant_integrations`:
        omitting `service_account_json` preserves the existing one. To
        fully reset (e.g. compromised key), pass an explicit "" — the
        upsert refuses and forces a re-paste.
    ApiResponse_FirebaseConfigOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/FirebaseConfigOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[FirebaseConfigOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AndroidApp:
      properties:
        app_id:
          type: string
          pattern: ^1:\d+:android:[a-f0-9]+$
          title: App Id
        package_name:
          type: string
          maxLength: 200
          minLength: 3
          title: Package Name
        sha1_fingerprints:
          items:
            type: string
          type: array
          title: Sha1 Fingerprints
      type: object
      required:
        - app_id
        - package_name
      title: AndroidApp
      description: One row of `tenant_firebase_config.android_apps`.
    IosApp:
      properties:
        app_id:
          type: string
          pattern: ^1:\d+:ios:[a-f0-9]+$
          title: App Id
        bundle_id:
          type: string
          maxLength: 200
          minLength: 3
          title: Bundle Id
        team_id:
          anyOf:
            - type: string
              maxLength: 10
              minLength: 10
            - type: 'null'
          title: Team Id
        app_store_id:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: App Store Id
      type: object
      required:
        - app_id
        - bundle_id
      title: IosApp
    WebApp:
      properties:
        app_id:
          type: string
          pattern: ^1:\d+:web:[a-f0-9]+$
          title: App Id
        api_key:
          type: string
          maxLength: 120
          minLength: 10
          title: Api Key
        auth_domain:
          type: string
          minLength: 5
          title: Auth Domain
        messaging_sender_id:
          type: string
          pattern: ^\d{6,20}$
          title: Messaging Sender Id
      type: object
      required:
        - app_id
        - api_key
        - auth_domain
        - messaging_sender_id
      title: WebApp
      description: |-
        Client-side Firebase config emitted to the browser.

        `api_key` here is the **web** API key — public by design (it
        appears in every Firebase web client). Acts as a project locator,
        not a secret. Real security comes from Firebase rules + App Check.
    FirebaseConfigOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
        project_id:
          type: string
          title: Project Id
        service_account_client_email:
          type: string
          title: Service Account Client Email
        has_service_account:
          type: boolean
          title: Has Service Account
        android_apps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Android Apps
        ios_apps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Ios Apps
        web_apps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Web Apps
        web_push_vapid_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Web Push Vapid Key
        default_channel_id:
          type: string
          title: Default Channel Id
        default_channel_name:
          type: string
          title: Default Channel Name
        is_active:
          type: boolean
          title: Is Active
        last_validated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Validated At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - tenant_id
        - project_id
        - service_account_client_email
        - has_service_account
        - android_apps
        - ios_apps
        - web_apps
        - web_push_vapid_key
        - default_channel_id
        - default_channel_name
        - is_active
        - last_validated_at
        - created_at
        - updated_at
      title: FirebaseConfigOut
      description: Redacted view — never includes the encrypted service-account.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````