---
title: "Compile a script"
method: POST
path: "/api/scripts/_compile"
tags: ["scripts"]
---

# Compile a script

`POST /api/scripts/_compile`

Compile a script

## Request body

- Script — A script to transformer otoroshi requests
  - `code` object, required — The code of the script
  - `desc` object, required — The description of the script
  - `id` string, required — The id of the script
  - `name` string, required — The name of the script

## Response `200`

Successful operation

- ScriptCompilationResult — The result of the compilation of a Script
  - `done` boolean, required — Is the task done or not
  - `error` ScriptCompilationError — The error of the compilation of a Script
    - `column` string, required — The column of the error
    - `file` object, required — The file where the error is located
    - `line` string, required — The line of the error
    - `message` object, required — The message to display for the error
    - `rawMessage` object, required — The raw message from the compiler

## Other responses

- `400` — Bad resource format. Take another look to the swagger, or open an issue :)
- `401` — You have to provide an Api Key. Api Key can be passed with 'Otoroshi-Client-Id' and 'Otoroshi-Client-Secret' headers, or use basic http authentication
- `404` — Resource not found or does not exist

---

[API](https://skmtc.net/maif/apis/otoroshi.md) · [All operations](https://skmtc.net/maif/apis/otoroshi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/maif/otoroshi/versions/276881687271/schema)
