---
title: "Add or update a feature control definition"
method: POST
path: "/api/feature-control"
---

# Add or update a feature control definition

`POST /api/feature-control`

Creates a new feature control or updates the definition of an existing one. Immutable fields (name, type, initialValue) cannot be updated.

## Headers

- `x-cdp-request-id` string

## Request body

- PostFeatureControlRequest
  - `name` string, required
  - `type` 'list-string' | 'list-number' | 'boolean' | 'date' | 'string' | 'number', required
  - `initialValue` object, required — Mapping of environment to initial value. Must contain 'default' or all of 'dev', 'test', 'ext-test', 'perf-test', 'prod'.
  - `scopes` string[], required
  - `displayName` string, required
  - `description` string, required
  - `owner` string, required
  - `expiryDate` string, date-time, required
  - `createdBy` string, required
  - `roleRequired` object — Mapping of list of required role to update control value per environment. Can contain 'default' plus any of 'local', 'dev', 'test', 'ext-test', 'perf-test', 'prod'.
  - `environments` string[] — Optional list of environments this feature control applies to.

## Response `202`

Accepted - Feature control created or updated.

## Other responses

- `204` — No Content - No changes made to the existing feature control.
- `400` — Bad Request - Validation error.
- `401` — Unauthorized.
- `409` — Conflict - Attempted to update an immutable field.

---

[API](https://skmtc.net/defra/apis/grants-config-broker-api-2.md) · [All operations](https://skmtc.net/defra/apis/grants-config-broker-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/defra/grants-config-broker-api-2/revisions/81efb0cb4466/schema)
