---
title: "Changes the public key or the view of a lambda"
method: PATCH
path: "/lambdas/{privateKey}"
tags: ["Lambdas"]
---

# Changes the public key or the view of a lambda

`PATCH /lambdas/{privateKey}`

## Request

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

What the request leaves out stays as it is.

A new `publicKey` follows the rules of `POST /lambdas` and moves the address the lambda answers at, at once: nothing
answers at the old address any more, and anybody may claim it. A domain of the lambda's own is not affected.

The `view` is only what the editor opens in for somebody who has not picked a view of their own.

## Path parameters

- `privateKey` string, required

## Request body

- UpdateLambdaRequest: The changes to make to a lambda. What is left out stays as it is.
  - `PublicKey` string, nullable: The public key to move the lambda to, under the same rules as when it is created
  - `View` string, nullable: How its editor opens for somebody who has not chosen a view of their own: `Full` or `Simple`

## Response `200`

The lambda afterwards

- LambdaResponse: A lambda, as whoever holds its editor key sees it.
  - `PublicKey` string: Names its address below the hosting domain. Not a secret; its owner may change it.
  - `PrivateKey` string: The editor key, which authorizes every call about the lambda. Treat it like a password.
  - `Tier` string: `Free`, `Premium` or `Demo`, assigned by the operator. Decides its limits, whether it is kept online while nobody uses it, and whether it may answer at a domain of its own.
  - `Created` string, date-time: When it was created
  - `Modified` string, date-time: When something about it last changed: a save, a deployment, a setting
  - `ActiveVersion` integer, nullable: The version that is online; absent while nothing is
  - `LatestVersion` integer, nullable: The newest version saved, which may be ahead of the one online
  - `PublicUrl` string: Its address below the hosting domain, named after its public key: `https://quiz.genhttp.run/`. While it answers at a domain of its own, this address sends its visitors on to the domain.
  - `EditorPath` string: Where its editor is on this site: `/editor/{privateKey}`. Holds the editor key.
  - `DeployedAt` string, date-time, nullable: When the version online went online; absent while nothing is
  - `DeployedUntil` string, date-time, nullable: When it is taken offline unless it is visited or edited before then - each visit and each edit moves this on. Absent while it is offline, and for a tier that keeps it online.
  - `KeptUntil` string, date-time, nullable: When it is deleted unless it is visited or edited before then. Absent for a tier that keeps it.
  - `Domain` string, nullable: The domain of its own it is configured to answer at, whether or not its tier lets it
  - `DomainServed` boolean: Whether it answers at that domain: it has one, and its tier includes it
  - `Address` string: Where to link to it: its domain while that is served, `publicUrl` otherwise
  - `View` string: How its editor opens for somebody who has not chosen a view of their own: `Full` or `Simple`
  - `GitPath` string: Where it is cloned with git and pushed to, on this site. The versions are the commits of `main`, the features the other branches. Holds the editor key, like the editor's path.

## Other responses

- `204`: A response containing no body
- `400`: The key or the view cannot be used. Nothing was changed.
- `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. A key that never existed and the key of a deleted lambda are answered alike.
- `409`: Another lambda has the public key that was asked for.

---

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