Flags API reference

Flags API · Imports

post/v1/workspaces/{workspace_id}/importsAuth

Import from ConfigCat

Reads a ConfigCat product through ConfigCat's Public Management API with credentials you send for this one request (never stored, logged or cached), and maps it to a new Flags project: environments, configs, feature flags and settings (seed = the ConfigCat key, so every user stays in the same percentage bucket), segments, targeting rules, percentage options and prerequisite flags; sensitive comparators become confidential comparators re-hashed under the project salt. Send `dry_run: true` first: it reads and reports (`counts`, `mapped`, `unsupported`, `warnings`) and writes nothing. A real run (`dry_run: false`) creates the project and answers 201; while the report lists `unsupported` items it answers 422 `IMPORT_UNSUPPORTED` unless `skip_unsupported: true`. One synchronous call with a 120 s budget for the ConfigCat reads (paced to ConfigCat's rate limits). Needs `flags.project.manage` and `flags.create`. No Idempotency-Key: the body carries credentials, and a retry of a finished import answers 409 `KEY_ALREADY_EXISTS` (the project name is taken).

Path parameters

workspace_id*string · uuid

Id of the workspace.

Request body

source*object

Where to import from. Only `configcat` today.

Example: "configcat"

credentials*object

ConfigCat Public Management API credentials (Basic auth). Write-only.

configcat_product_id*string · uuid

Id of the ConfigCat product to import (Product settings in the ConfigCat dashboard, or `GET /v1/products`).

Example: "08d8a0b0-0000-4c1f-8a1c-1a2b3c4d5e6f"

dry_run*boolean

`true`: read and report only, write nothing (the first step). `false`: create the project.

Example: true

target_project_namestring

Name of the new project. Defaults to the ConfigCat product's name; another project with this name is a 409.

Example: "Checkout"

skip_unsupportedboolean

Import even when the dry run lists `unsupported` items: those rules (or segments, settings) are left out and named in the history. Without it, a real run with unsupported items answers 422 `IMPORT_UNSUPPORTED`.

Response · 200 Dry run: the report; nothing was written.

dry_run*boolean

Echo of the request: true when nothing was written.

Example: true

configcat_product_id*string · uuid

The ConfigCat product that was read.

Example: "08d8a0b0-0000-4c1f-8a1c-1a2b3c4d5e6f"

report*object

The mapping report (the same on the dry run and the real run).

project*object

The new project (real run); null on a dry run.

Example

Request

POST https://api.flags.productcraft.co/v1/workspaces/{workspace_id}/imports
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "source": "configcat",
  "credentials": {},
  "configcat_product_id": "08d8a0b0-0000-4c1f-8a1c-1a2b3c4d5e6f",
  "dry_run": true,
  "target_project_name": "Checkout",
  "skip_unsupported": false
}

Response

{
  "dry_run": true,
  "configcat_product_id": "08d8a0b0-0000-4c1f-8a1c-1a2b3c4d5e6f",
  "report": {},
  "project": {}
}