---
title: "Suggests what could be written"
method: POST
path: "/lambdas/{privateKey}/code/completions"
tags: ["Code analysis"]
---

# Suggests what could be written

`POST /lambdas/{privateKey}/code/completions`

## Request

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

At `line` and `column` of the file named by `file`: the members, types and keywords the compiler would accept there.

## Path parameters

- `privateKey` string, required

## Request body

- CodeRequest: The files a question about code is asked of, and where in them to look.
  - `Files` LambdaFile[], nullable: The files of the lambda, `lambda.cs` first, as they would be saved
    - `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
  - `File` string, nullable: The file a question about one file is about; left out, the first
  - `Line` integer: The line of the position, counting from zero
  - `Column` integer: The column of the position, counting from zero

## Response `200`

What could be written there

- CompletionsResponse: Everything that could be written at a position.
  - `Completions` ResolvedCompletionResponse[]: The suggestions
    - `Label` string: What to write
    - `Kind` string: What it is: `class`, `interface`, `struct`, `enum`, `method`, `property`, `field`, `parameter`, `variable` or `text`
    - `Detail` string: Its signature, as C# writes it
    - `Documentation` string, nullable: What its documentation says about it, where it has any

## Other responses

- `204`: A response containing no body
- `400`: There is no file of that name in the request.
- `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)
