---
title: "Compile a custom indicator and save it. One of four source languages"
method: POST
path: "/v1/indicators"
---

# Compile a custom indicator and save it. One of four source languages

`POST /v1/indicators`

## Request

- Base URL: `https://app.texttoquant.com/api`
- URL: `https://app.texttoquant.com/api/v1/indicators`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

One endpoint, four source types: send exactly one of pine_code (compiled via the TV Oracle), js_code, py_code, or csv_data (precomputed values). Whichever is present decides the compile pipeline; sending zero or more than one is a validation error.

## Request body

- object
  - `name` string, required
  - `pine_code` string: Pine Script source. Exactly one of pine_code/js_code/py_code/csv_data is required.
  - `js_code` string: JavaScript indicator source (sandboxed), under 128KB.
  - `py_code` string: Python indicator source (sandboxed), under 128KB.
  - `csv_data` string: Precomputed indicator values as CSV text, under 1.5MB once JSON encoded.
  - `symbol` string
  - `timeframe` string
  - `bars` integer

## Response `200`

Success

- object
  - `success` true, required
  - `data` object, required

## Other responses

- `400`: validation_error — zero or more than one source field, or a field over its size cap
- `402`: feature_not_included — the plan gate for the language sent (customIndicators for js/py/csv, pineIndicators for pine_code)
- `422`: Compile/validation failure

---

[API](https://skmtc.dev/texttoquant/apis/texttoquant-api.md) · [All operations](https://skmtc.dev/texttoquant/apis/texttoquant-api/llms.txt) · [OpenAPI document](https://skmtc.dev/texttoquant/apis/texttoquant-api/revisions/d417fc3f4a7d?raw)
