|
1 | 1 | --- |
2 | 2 | title: Features |
3 | | -description: List, create, and copy features |
| 3 | +description: List, create, update, delete, and copy features |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | Manage features for your products. |
@@ -231,6 +231,103 @@ curl -X POST "https://api.test.io/customer/v2/features" \ |
231 | 231 |
|
232 | 232 | {% /code %} |
233 | 233 |
|
| 234 | +## Update feature |
| 235 | + |
| 236 | +Updates the top-level fields of a feature. All fields are optional — only the fields you provide are updated. |
| 237 | + |
| 238 | +**Endpoint:** `PUT /features/{feature_id}` |
| 239 | + |
| 240 | +**Parameters:** |
| 241 | + |
| 242 | +- `feature_id` (number, required) - ID of the Feature |
| 243 | + |
| 244 | +All attributes must be provided inside the root object `feature`. |
| 245 | + |
| 246 | +**Request Body:** |
| 247 | + |
| 248 | +- `section_ids` (array[number], optional) - Array of section IDs to assign the feature to, replacing its current sections |
| 249 | +- `feature` (object, optional) - Feature object |
| 250 | + - `title` (string, optional) - Feature title |
| 251 | + - `description` (string, optional) - Feature description |
| 252 | + - `howtofind` (string, optional) - Instructions on how to find the feature |
| 253 | + - `user_stories` (array[object], optional) - User stories to add, update, or remove |
| 254 | + - `id` (number, optional) - ID of an existing user story to update or remove. Omit to create a new user story. |
| 255 | + - `path` (string, optional) - User story description |
| 256 | + - `_destroy` (boolean, optional) - Set to `true` along with `id` to remove the user story |
| 257 | + |
| 258 | +> `user_stories` in the response is always returned as expanded objects (`id`, `path`, `title`, `feature_id`) — there is no `includes[]=user_stories` toggle for this endpoint, unlike [List features](#list-features). |
| 259 | +
|
| 260 | +**Example Request:** |
| 261 | + |
| 262 | +{% code language="bash" showLineNumbers=true %} |
| 263 | + |
| 264 | +```bash |
| 265 | +curl -X PUT "https://api.test.io/customer/v2/features/15" \ |
| 266 | + -H "Authorization: Token YOUR_API_TOKEN" \ |
| 267 | + -H "Content-Type: application/json" \ |
| 268 | + -d '{ |
| 269 | + "feature": { |
| 270 | + "title": "Account Management (updated)" |
| 271 | + } |
| 272 | + }' |
| 273 | +``` |
| 274 | + |
| 275 | +{% /code %} |
| 276 | + |
| 277 | +**Response:** `200 OK` |
| 278 | + |
| 279 | +Returns the updated feature object. See the response shape in [Create feature](#create-feature) above. |
| 280 | + |
| 281 | +**Example Request (managing user stories):** |
| 282 | + |
| 283 | +{% code language="bash" showLineNumbers=true %} |
| 284 | + |
| 285 | +```bash |
| 286 | +curl -X PUT "https://api.test.io/customer/v2/features/15" \ |
| 287 | + -H "Authorization: Token YOUR_API_TOKEN" \ |
| 288 | + -H "Content-Type: application/json" \ |
| 289 | + -d '{ |
| 290 | + "feature": { |
| 291 | + "user_stories": [ |
| 292 | + { "path": "As a user I can reset my password" }, |
| 293 | + { "id": 10, "path": "As a user I can log in (updated)" }, |
| 294 | + { "id": 11, "_destroy": true } |
| 295 | + ] |
| 296 | + } |
| 297 | + }' |
| 298 | +``` |
| 299 | + |
| 300 | +{% /code %} |
| 301 | + |
| 302 | +**Response:** `200 OK` |
| 303 | + |
| 304 | +## Delete feature |
| 305 | + |
| 306 | +Deletes the specified feature. |
| 307 | + |
| 308 | +**Endpoint:** `DELETE /features/{feature_id}` |
| 309 | + |
| 310 | +**Parameters:** |
| 311 | + |
| 312 | +- `feature_id` (number, required) - ID of the Feature |
| 313 | + |
| 314 | +{% callout type="note" %} |
| 315 | +If the feature is already in use by a test cycle, it is not permanently deleted — it is hidden instead so historical test results remain intact. Hidden features no longer appear in [List features](#list-features). |
| 316 | +{% /callout %} |
| 317 | + |
| 318 | +**Example Request:** |
| 319 | + |
| 320 | +{% code language="bash" showLineNumbers=true %} |
| 321 | + |
| 322 | +```bash |
| 323 | +curl -X DELETE "https://api.test.io/customer/v2/features/15" \ |
| 324 | + -H "Authorization: Token YOUR_API_TOKEN" |
| 325 | +``` |
| 326 | + |
| 327 | +{% /code %} |
| 328 | + |
| 329 | +**Response:** `204 No Content` |
| 330 | + |
234 | 331 | ## Copy features |
235 | 332 |
|
236 | 333 | Copy all features (including their user stories) from one product to another. The features are duplicated into the destination product. |
|
0 commit comments