Create function
Endpoint: POST /api/{organization}/functions
Function can be used to modify input data. You can use it to drop some fields, convert some field's data type, or drop some records.
Request
{
"name": "add_env",
"function": ".env = \"prod\"\n.",
"transType": 0
}Description
| Field name | Data type | Default value | Description |
|---|---|---|---|
| name | string | - | function name, required |
| function | string | - | function body, required. For VRL, a trailing . is added if missing |
| transType | int | 0 | 0 = VRL, 1 = JavaScript |
| params | string | - | optional, function parameters |
Response
{
"code": 200,
"message": "Function saved successfully"
}Was this page helpful?