---
title: "Starts a feature"
method: POST
path: "/lambdas/{privateKey}/features"
tags: ["Features"]
---

# Starts a feature

`POST /lambdas/{privateKey}/features`

## Request

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

The feature starts from the version named as `base`, or the newest. It gets a copy of the version's files, and a
copy of the lambda's database, workspace and secrets as they are now - which may take a moment for a lot of data.
Its preview is not online until it is started, or a save asks for it (`?deploy=true`). The lambda itself is not
touched.

It is given a `key`, which every call about it takes, and a `branch`, which is where it is in the lambda's git
repository. Only so many features may be open at once, as the tier of the lambda allows.

## Path parameters

- `privateKey` string, required

## Request body

- CreateFeatureRequest: Starts a feature: a copy of a version's files, and of the lambda's data, to work on without touching the lambda.
  - `Name` string, nullable: What it is, in a few words - "Leaderboard", "Dark mode". One line, 80 characters at most.
  - `Specification` string, nullable: What the user wants from it and why. The version it is merged into keeps it.
  - `Base` integer, nullable: The number of the version to start from; left out, the newest

## Response `201`

The feature was started.

- 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.

## Other responses

- `400`: The name is missing, too long (80 characters at most) or more than one line, or the lambda has no version yet.
- `403`: The lambda is a demo, which anybody may read and nobody may change. Create a lambda of your own from it instead: `POST /lambdas` with the demo's id as `template`.
- `404`: No lambda has this editor key, or it has no such version to start from.
- `409`: The lambda has as many features open as its tier allows. Merge or delete one first.

---

[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)
