Flags API reference

Flags API · Configs

post/v1/workspaces/{workspace_id}/projects/{project_id}/configsAuth

Create a config

Adds a config to the project, with a published state in every environment. Each (config, environment) pair has its own SDK key. Needs `flags.project.manage`.

Path parameters

project_id*string · uuid

Id of the project.

workspace_id*string · uuid

Id of the workspace.

Headers

Idempotency-Keystring

Idempotency key (1-256 characters, `[A-Za-z0-9._:-]`). A retry with the same key and body returns the first response for 24 h.

Request body

key*string

Stable key, unique in the project; must be a lowercase slug: a-z, 0-9 and "-", 1-63 characters, not starting with "-".

Example: "checkout"

name*string

Display name, 1-100 characters.

Example: "Checkout"

descriptionstring

Free-text description, at most 1000 characters.

Example: ""

ordinalinteger

Sort position. Defaults to after the last one.

Example: 1

notestring

A change note (at most 500 characters), saved on the history entry. Environments with `require_note` refuse value writes without one.

Example: "Ticket FLAG-142"

Response · 201 The new config.

id*string · uuid

The config's id.

workspace_id*string · uuid

The workspace that owns the config.

project_id*string · uuid

The project the config belongs to.

key*string

Stable key, unique in the project.

Example: "main"

name*string

Display name.

Example: "Main"

description*string

Free-text description (may be empty).

Example: ""

ordinal*integer

Sort position in the project (ascending).

Example: 0

created_at*string · date-time

When the config was created.

updated_at*string · date-time

When the config last changed.

Example

Request

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

{
  "key": "checkout",
  "name": "Checkout",
  "description": "",
  "ordinal": 1,
  "note": "Ticket FLAG-142"
}

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "project_id": "00000000-0000-0000-0000-000000000000",
  "key": "main",
  "name": "Main",
  "description": "",
  "ordinal": 0,
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z"
}