Skip to content

feat(api): environment cloning and flag import/export #38

Description

@trinhvandat

Context (P2 — product)

Setting up a new environment or promoting flag config between environments is manual, flag by flag.

Scope

  • POST /api/v1/environments/{id}/clone — new environment copying all flag states (new API key generated)
  • GET /api/v1/environments/{id}/export — JSON snapshot of flags + states (schema-versioned envelope)
  • POST /api/v1/environments/{id}/import — apply snapshot with dry-run mode and conflict strategy (skip/overwrite)
  • Permission: ADMIN+ on the org

Acceptance criteria

  • Clone produces identical flag states with a fresh API key
  • Export→import round-trip is lossless (test)
  • Import dry-run reports the change set without applying
  • Import validates the schema version and rejects unknown versions cleanly

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions