---
title: "Changes some files of a feature"
method: POST
path: "/lambdas/{privateKey}/features/{feature}/changes"
tags: ["Features"]
---

# Changes some files of a feature

`POST /lambdas/{privateKey}/features/{feature}/changes`

## Request

- Base URL: `https://genhttp.dev/api/v1`
- URL: `https://genhttp.dev/api/v1/lambdas/{privateKey}/features/{feature}/changes`
- Auth: none declared

Files that are not named stay as they are. As for a version: `remove` takes files out, `files` adds or replaces
them, and `edits` replaces text within them, each `find` occurring exactly once. The changes are made on top of
what the feature holds as the request arrives.

## Path parameters

- `privateKey` string, required
- `feature` string, required

## Query parameters

- `deploy` boolean

## Request body

- VersionChangeRequest: Changes to make to some files, saved as the next version or into a feature.
  - `Files` LambdaFile[], nullable: Files to add, or to replace where one of that name exists
    - `Name` string: Its path, with forward slashes: `lambda.cs`, `Store.cs`, `resources/web/index.html`, `docs/product.md`. Case sensitive, and also what the compiler's messages name.
    - `Code` string: Its content: the text itself, or base64 where `encoding` says so
    - `Encoding` string, nullable: `base64` for a file that is not text - a picture, a font; left out for text. C# files are always text.
    - `IsCompiled` boolean
    - `IsCode` boolean
    - `IsResource` boolean
    - `Bytes` string, byte
  - `Remove` string[], nullable: Names of files to remove. Each has to exist.
  - `Edits` FileEdit[], nullable: Replacements of text within files, applied after the files were added and removed
    - `File` string: The name of the file to change, which has to be text
    - `Find` string: The text to replace, exactly as it is in the file. It has to occur exactly once - include more of what surrounds it where it occurs more often.
    - `Replace` string: What to put in its place; empty removes it
  - `Specification` string, nullable: What the user wants from this change and why. Optional, and cut past 4000 characters.
  - `Change` string, nullable: What this change does, in one line for the owner. Optional, and cut past 500 characters.

## Response `200`

The feature afterwards, and what came of its preview where that was asked for

- FeatureSavedResponse: A feature that was just saved.
  - `Feature` FeatureResponse: A feature: a change being worked on beside the lambda.
    - `Key` string: What every call about it takes, and what its preview is reached by
    - `Name` string: What it is, in a few words
    - `Branch` string: The branch it is in the lambda's git repository - given when it starts, and kept when it is renamed
    - `Specification` string, nullable: What the user wants from it and why
    - `Change` string, nullable: What it changes, in one line
    - `Base` integer: The version it is based on
    - `Newest` integer, nullable: The newest version of the lambda
    - `Mergeable` boolean: Whether it can be merged: it is based on the newest version
    - `Origin` string, nullable: How it was started: `api`, `agent` or `git`
    - `Created` string, date-time: When it was started
    - `Modified` string, date-time: When it was last saved or changed
    - `Online` boolean: Whether its preview is online
    - `Current` boolean: Whether its preview is online and serves what the feature holds now, rather than an earlier save
    - `Previewed` string, date-time, nullable: When its preview was last put online, while it is
    - `PreviewPath` string: Where its preview answers on this site, whether it is online or not: `/features/{key}/`
    - `Revision` integer: How many times its files were saved, counting the ones it began with. Passed back with a save, it keeps that save from replacing one made elsewhere.
  - `Preview` FeaturePreviewResponse: What came of putting the preview of a feature online.
    - `Success` boolean: Whether it compiled and the preview is online with it
    - `Feature` FeatureResponse: A feature: a change being worked on beside the lambda.
      - `Key` string: What every call about it takes, and what its preview is reached by
      - `Name` string: What it is, in a few words
      - `Branch` string: The branch it is in the lambda's git repository - given when it starts, and kept when it is renamed
      - `Specification` string, nullable: What the user wants from it and why
      - `Change` string, nullable: What it changes, in one line
      - `Base` integer: The version it is based on
      - `Newest` integer, nullable: The newest version of the lambda
      - `Mergeable` boolean: Whether it can be merged: it is based on the newest version
      - `Origin` string, nullable: How it was started: `api`, `agent` or `git`
      - `Created` string, date-time: When it was started
      - `Modified` string, date-time: When it was last saved or changed
      - `Online` boolean: Whether its preview is online
      - `Current` boolean: Whether its preview is online and serves what the feature holds now, rather than an earlier save
      - `Previewed` string, date-time, nullable: When its preview was last put online, while it is
      - `PreviewPath` string: Where its preview answers on this site, whether it is online or not: `/features/{key}/`
      - `Revision` integer: How many times its files were saved, counting the ones it began with. Passed back with a save, it keeps that save from replacing one made elsewhere.
    - `Diagnostics` CompilationDiagnostic[]: What the compiler said: the errors that kept it offline, or the warnings of a preview that went online
      - `Severity` string: `Error`, which keeps the code from going online, or `Warning`
      - `Id` string: What kind of message it is: the C# compiler's (`CS1002`), `LAMBDA0001` for something lambdas may not do, `LAMBDA0002` for a handler the platform cannot serve, or `LAMBDA` for anything else the platform refused
      - `Message` string: What is wrong, and often what to do about it
      - `Line` integer: The line in the file, counting from 1; 0 when it is about no line
      - `Column` integer: The column in the line, counting from 1; 0 when it is about no line
      - `File` string, nullable: The name of the file it is in, as the lambda names it; absent when it is about none of them

## Other responses

- `204`: A response containing no body
- `400`: Nothing to change, a file to remove or edit that does not exist, a `find` that occurs never or more than once, or a result that cannot be a lambda. Nothing was saved.
- `404`: No lambda has this editor key, or the lambda has no feature with this key: it never existed, or it was merged or deleted.
- `409`: The feature was saved by somebody else while this change was being made. Try again.

---

[API](https://skmtc.dev/genhttp/apis/genhttp-lambda-api.md) · [All operations](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/revisions/8b36699e03df?raw)
