---
title: "Switches a kind of data on"
method: PUT
path: "/lambdas/{privateKey}/data/{kind}"
tags: ["Data"]
---

# Switches a kind of data on

`PUT /lambdas/{privateKey}/data/{kind}`

## Request

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

Nothing happens if it is on already. The lambda can use it from its next request on, without being deployed again.

The database is made empty, and the lambda is started again on its next request, so what it does as it starts -
applying its migrations - runs against it. The secrets start empty: their values are entered with
`PUT …/secrets/{name}`.

## Path parameters

- `privateKey` string, required
- `kind` string, required

## Response `200`

The kind of data, switched on

- DataStoreResponse: One kind of data of a lambda, and how full it is.
  - `Kind` string: Which kind: `database`, the SQLite database it keeps its records in; `workspace`, the files it reads and writes; or `secrets`, the API keys and passwords it reads and nobody sees
  - `Enabled` boolean: Whether the lambda has it switched on
  - `Default` boolean: Whether a lambda has it until its owner decides otherwise: the workspace does, the others do not
  - `Changed` string, date-time, nullable: When it was last switched on or off; absent while it is as it came
  - `Items` integer: What it holds: tables, for the database; files, for the workspace; values, for the secrets
  - `UsedBytes` integer: The room that takes, as the allowance counts it; zero for the secrets, which are counted in values
  - `QuotaBytes` integer: The room it may take: for the database and the workspace, the data allowance of the tier less what the other takes; zero for the secrets
  - `MaxItems` integer, nullable: How many it may hold, for a kind counted in values rather than bytes - the secrets

## Other responses

- `204`: A response containing no body
- `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 there is no such kind of data.

---

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