---
title: "Apply a code action"
method: POST
path: "/v1/devboxes/{id}/lsp/apply-code-action"
tags: ["rl-language-service"]
---

# Apply a code action

`POST /v1/devboxes/{id}/lsp/apply-code-action`

Apply a code action to a given code segment not all code actions are supported yet

## Path parameters

- `id` string, required

## Request body

- BaseCodeAction
  - `kind` string
  - `isPreferred` boolean
  - `command` BaseCommand
    - `arguments` unknown[]
      - unknown
    - `command` string, required
    - `title` string, required
  - `edit` BaseWorkspaceEdit
    - `changes` RecordStringTextEditArray — Construct a type with a set of properties K of type T
  - `title` string, required

## Response `200`

The result of the code action

- CodeActionApplicationResult
  - `error` string
  - `filesChanged` string[]
  - `success` boolean, required

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/0cb966ca566f/schema)
