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

# Import Env Vars

> Bulk upsert environment variables.

Generated service-location keys are skipped and reported in ``skipped``;
they never mutate stored values.



## OpenAPI

````yaml https://api.getfloo.com/openapi.json post /v1/apps/{app_id}/env/import
openapi: 3.1.0
info:
  title: floo API
  version: 0.1.0
servers:
  - url: https://api.getfloo.com
security: []
paths:
  /v1/apps/{app_id}/env/import:
    post:
      tags:
        - env
      summary: Import Env Vars
      description: |-
        Bulk upsert environment variables.

        Generated service-location keys are skipped and reported in ``skipped``;
        they never mutate stored values.
      operationId: env_import_env_vars
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: App Id
        - name: env
          in: query
          required: false
          schema:
            type: string
            title: Env
            default: dev
        - name: preview
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Preview
        - $ref: '#/components/parameters/X-Floo-Org-Id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportEnvVarsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportEnvVarsResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    X-Floo-Org-Id:
      name: X-Floo-Org-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: Organization to act in; defaults to the one joined most recently.
  schemas:
    ImportEnvVarsRequest:
      properties:
        env_vars:
          items:
            $ref: '#/components/schemas/SetEnvVarRequest'
          type: array
          maxItems: 100
          minItems: 1
          title: Env Vars
        service_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Service Id
      type: object
      required:
        - env_vars
      title: ImportEnvVarsRequest
      description: Request body for bulk-importing environment variables.
    ImportEnvVarsResponse:
      properties:
        env_vars:
          items:
            $ref: '#/components/schemas/EnvVarResponse'
          type: array
          title: Env Vars
        created:
          type: integer
          title: Created
        updated:
          type: integer
          title: Updated
        skipped:
          items:
            type: string
          type: array
          title: Skipped
      type: object
      required:
        - env_vars
        - created
        - updated
      title: ImportEnvVarsResponse
      description: Response for bulk-importing environment variables.
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Body of every error response except request validation (422).
    SetEnvVarRequest:
      properties:
        key:
          type: string
          maxLength: 255
          pattern: ^[A-Za-z_][A-Za-z0-9_]*$
          title: Key
        value:
          type: string
          maxLength: 10000
          title: Value
        service_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Service Id
        is_secret:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Secret
      type: object
      required:
        - key
        - value
      title: SetEnvVarRequest
      description: >-
        Request body for setting an environment variable, alone or in an import.


        ``value`` being required is load-bearing for the write-only contract

        (#1018): there is no metadata-only mutation, so ``is_secret`` can never
        be

        flipped without supplying a brand-new value — the old secret value stays

        unreachable by construction. Pinned by

        ``tests/test_env_var_wire_boundary.py``.
    EnvVarResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        app_id:
          type: string
          format: uuid
          title: App Id
        env_id:
          type: string
          format: uuid
          title: Env Id
        service_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Service Id
        key:
          type: string
          title: Key
        masked_value:
          type: string
          title: Masked Value
        is_secret:
          type: boolean
          title: Is Secret
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - app_id
        - env_id
        - service_id
        - key
        - masked_value
        - is_secret
        - created_at
        - updated_at
      title: EnvVarResponse
      description: Response for a single environment variable.
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: true
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: Standard error envelope with operation-specific JSON context.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A `floo_` API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.