BETA
Skip to content

Projects

Create and manage feature flag projects. Projects are top-level containers that group flags, segments, and experiments by application or team.

Base URL: https://app.krafter.dev/api/v1

List Projects

Retrieve all projects.

GET /flags/projects

Required scope: flags:read

Example Request

bash
curl https://app.krafter.dev/api/v1/flags/projects \
  -H "Authorization: Bearer kr_live_abc123def456"

Example Response

json
{
  "data": [
    {
      "id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "Web App",
      "slug": "web-app",
      "environments": ["production", "staging", "development"],
      "settings": {
        "default_environment": "production"
      },
      "created_at": "2025-03-10T08:00:00Z",
      "updated_at": "2025-03-10T08:00:00Z"
    },
    {
      "id": "b2c3d4e5-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
      "name": "Mobile App",
      "slug": "mobile-app",
      "environments": ["production", "staging"],
      "settings": {
        "default_environment": "production"
      },
      "created_at": "2025-03-12T14:20:00Z",
      "updated_at": "2025-03-12T14:20:00Z"
    }
  ]
}

Create Project

Create a new project.

POST /flags/projects

Required scope: flags:write

Per-project API key scoping

Once a project exists you can restrict an API key to only this project by adding a flag_project permission with the project's UUID as the resource id. See Authentication and per-project permissions for the pass-through rule and how the per-project plug enforces 403 Forbidden on mismatched keys.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name for the project.
slugstringNoURL-friendly identifier. Auto-generated from name if omitted.
environmentsstring[]NoList of environment names. Defaults to ["production", "staging", "development"].
settingsobjectNoProject-level settings (e.g., default_environment).

Example Request

bash
curl -X POST https://app.krafter.dev/api/v1/flags/projects \
  -H "Authorization: Bearer kr_live_abc123def456" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Web App",
    "slug": "web-app",
    "environments": ["production", "staging", "development"],
    "settings": {
      "default_environment": "production"
    }
  }'

Example Response

json
// 201 Created
{
  "data": {
    "id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "name": "Web App",
    "slug": "web-app",
    "environments": ["production", "staging", "development"],
    "settings": {
      "default_environment": "production"
    },
    "created_at": "2025-03-10T08:00:00Z",
    "updated_at": "2025-03-10T08:00:00Z"
  }
}

Get Project

Retrieve details of a specific project.

GET /flags/projects/:project_id

Required scope: flags:read

Example Request

bash
curl https://app.krafter.dev/api/v1/flags/projects/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d \
  -H "Authorization: Bearer kr_live_abc123def456"

Example Response

json
{
  "data": {
    "id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "name": "Web App",
    "slug": "web-app",
    "environments": ["production", "staging", "development"],
    "settings": {
      "default_environment": "production"
    },
    "created_at": "2025-03-10T08:00:00Z",
    "updated_at": "2025-03-10T08:00:00Z"
  }
}

Update Project

Update an existing project. Only provided fields are changed.

PATCH /flags/projects/:project_id

Required scope: flags:write

Request Body

FieldTypeRequiredDescription
namestringNoDisplay name for the project.
slugstringNoURL-friendly identifier.
environmentsstring[]NoList of environment names.
settingsobjectNoProject-level settings.

Example Request

bash
curl -X PATCH https://app.krafter.dev/api/v1/flags/projects/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d \
  -H "Authorization: Bearer kr_live_abc123def456" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Web Application",
    "environments": ["production", "staging", "development", "qa"]
  }'

Example Response

json
{
  "data": {
    "id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "name": "Web Application",
    "slug": "web-app",
    "environments": ["production", "staging", "development", "qa"],
    "settings": {
      "default_environment": "production"
    },
    "created_at": "2025-03-10T08:00:00Z",
    "updated_at": "2025-03-15T11:45:00Z"
  }
}

Delete Project

Permanently delete a project and all associated flags, rules, segments, and experiments.

DELETE /flags/projects/:project_id

Required scope: flags:write

Example Request

bash
curl -X DELETE https://app.krafter.dev/api/v1/flags/projects/a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d \
  -H "Authorization: Bearer kr_live_abc123def456"

Example Response

// 204 No Content

Built by Krafter Studio