---
title: "Reads how a change is getting on"
method: GET
path: "/lambdas/{privateKey}/agent"
tags: ["Changes"]
---

# Reads how a change is getting on

`GET /lambdas/{privateKey}/agent`

## Request

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

Asked again while a change runs. The agent remembers a change for an hour after it was asked for; after that there
is nothing to report, and what it saved is in the history of the lambda and its features.

## Path parameters

- `privateKey` string, required

## Response `200`

Whether there is an agent, how many changes this caller has left today, and the change under way or the last one

- AgentState: Whether a change can be asked for, and the change under way or the last one.
  - `Available` boolean: Whether changes can be asked for: there is an agent, and the operator has not switched the box off
  - `PerDay` integer: How many builds and changes one address may ask for in a day
  - `Left` integer: How many of those this caller has left today
  - `SecondModel` boolean: Whether a second model is on offer, behind a password
  - `Job` ChangeProgress: A change the agent was asked for, and how it is getting on.
    - `Id` string: What the agent knows it by
    - `State` string: `queued`, `running`, `done`, `failed` or `cancelled`
    - `Prompt` string: What was asked for
    - `Deploy` boolean: Whether it was asked to merge the change and put it online
    - `Model` string: Which of the offered models is making it
    - `Before` integer, nullable: The version that was online when it was asked for
    - `Steps` AgentStep[]: What it has done so far
      - `At` integer: Seconds into the run
      - `Kind` string: What it did: `say`, `guide`, `demos`, `read`, `logs`, `create`, `write`, `check`, `deploy`, `upload`, `delete`, `list`, `feature` (started one), `update` (changed a feature's notes or base), `merge`, `discard` (deleted a feature), `data` (switched a kind of data on), `records` (read the database), `secrets` (listed the secrets) or `other`
      - `Text` string, nullable: What the agent said, for a step of kind `say`
      - `Tool` string, nullable: The tool, for a step of kind `other`
      - `Files` string[], nullable: The files written or read
      - `Removed` string[], nullable: The files a write removed
      - `Whole` boolean, nullable: Whether a write replaced every file rather than some
      - `Path` string, nullable: The workspace path of an upload or a removal
      - `Done` boolean, nullable: Whether the tool has answered
      - `Version` integer, nullable: The version read, saved, merged into, put online, or made a feature's base
      - `Online` boolean, nullable: Whether a write or a deployment went online - at the preview address, for a feature
      - `Errors` integer, nullable: How many errors the compiler found
      - `Problems` integer, nullable: How many errors the log holds
      - `Problem` string, nullable: Why the platform refused the step, in its words
      - `Feature` string, nullable: The name of the feature the step was about
      - `Preview` boolean, nullable: Whether the step was about a feature rather than the lambda itself
      - `Data` string, nullable: The kind of data a step of kind `data` switched on: `database`, `secrets` or `workspace`
    - `Result` ChangeResult: How a change ended, from what the tools answered rather than from what the model said about them.
      - `Ok` boolean: Whether it saved anything - into a feature, or as a version
      - `Version` integer, nullable: The newest version it saved, merging included
      - `Online` integer, nullable: The version it put online, if it put one there
      - `Deployed` boolean, nullable: Whether it put a version online
      - `Compiles` boolean, nullable: Whether the last code it compiled compiles, where it is known
      - `Before` integer, nullable: The version that was online when it started - to put back, if the change is not wanted
      - `Unchanged` boolean, nullable: Whether it saved nothing
      - `Cancelled` boolean, nullable: Whether somebody stopped it
      - `Reason` string, nullable: What cut it short: `timeout`, `turns` (it used up its steps) or `unauthorised`; `declined` where the agent would not make the change at all
      - `Summary` string, nullable: What the agent said at the end, for the owner - or, where it declined, why
      - `Error` string, nullable: What went wrong, in English
      - `Detail` string, nullable: What went wrong, in the words of whatever it went wrong in
      - `Feature` string, nullable: The key of the feature the change was left in, where it was not merged
      - `FeatureName` string, nullable: What that feature is called
      - `Preview` boolean, nullable: Whether that feature's preview is online, to be tried
      - `Declined` boolean, nullable: Whether the agent would not make the change; `summary` says why
    - `Waiting` integer: Its place in the queue; zero once it runs
    - `Seconds` integer: How long it has been running, in seconds
    - `Limit` integer, nullable: How long it may run, in seconds; absent when there is no clock on it
    - `Feature` string, nullable: The key of the feature it was asked to go on with; absent when it starts one of its own

## 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. A key that never existed and the key of a deleted lambda are answered alike.

---

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