---
title: "Validate VRL function syntax"
method: POST
path: "/api/{org_id}/functions/test"
tags: ["Functions"]
---

# Validate VRL function syntax

`POST /api/{org_id}/functions/test`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/functions/test`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/functions/test/post.ts> (a function with typed inputs; its response is checked against the schema)

Validates VRL (Vector Remap Language) transformation function syntax by testing it against sample events. Returns validation results with any syntax errors or successful transformation output. Use this to verify VRL code is correct before creating or updating a function. Accepts function code, sample events to test against, and optional trans_type (0 for VRL, 1 for JS).

## Path parameters

- `org_id` string, required

## Request body

- object
  - `events` unknown[], required
    - unknown
  - `function` string, required
  - `trans_type` integer, nullable

## Response `200`

Success

- TestVRLResponse
  - `results` VRLResult[], required
    - `event` unknown, required
    - `message` string, required

## Other responses

- `400`: Failure

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
