Upsert Transform

POST /pipelines/save-transform

Creates or updates a pipeline transform

Request

Headers

An API Key is required to access this endpoint.

NameValue

x-api-key

your_api_key

Body

NameTypeDescription

id

string

Unique ID for the pipeline.

transform

Transform object.

Transform

Transform ID is required when updating an existing transform.

NameTypeDescription

id

string

Unique ID for the transform.

modelConfig

Config options specific to the model.

modelType

enum

Supported enums: OCR CATEGORIZE CHAPTERIZE CUSTOM_PROMPT EXTRACT SENTIMENT SUMMARIZE TRANSLATE

name

string

Field name for the transform.

parentFieldIds

string[]

Array of ids to the parameters (or other transforms) used in the transform input.

ModelConfig

The config varies based on the type of model being used. CHAPTERIZE and OCR does not require a config.

CATEGORIZE

NameTypeDescription

defaultValue

string (optional)

Default is null if not specified.

options

string[]

List of options for categorization.

CUSTOM_PROMPT

NameTypeDescription

defaultValue

string (optional)

Default is null if not specified.

prompt

string

Prompt to use.

type

enum

Supported enums:

boolean date number string

EXTRACT

NameTypeDescription

defaultValue

string (optional)

Default is null if not specified.

description

string

Description of the extracted value.

prompt

string (optional)

Additional context for the prompt.

type

enum

Supported enums:

boolean date number string

SENTIMENT

NameTypeDescription

defaultValue

string (optional)

Default is null if not specified.

sentimentType

enum

Supported enums:

enum scale

SUMMARIZE

NameTypeDescription

prompt

string (optional)

Additional context for the prompt.

summaryLength

number

Number indicating summary length: 1 for short, 2 for medium, and 3 for long.

summaryType

enum

Supported enums:

bullets headline paragraph

TRANSLATE

NameTypeDescription

translateFrom

string

Source language for translation. Use two-letter lowercase abbreviation.

translateTo

string

Target language for translation. Use two-letter lowercase abbreviation.

Example

{
  "transform": {
    "modelConfig": {
      "sentimentType": "enum"
    },
    "modelType": "SENTIMENT",
    "name": "review_sentiment"
  },
}

Response

The API returns the response in JSON format.

Each response includes a success boolean and transformId.

Example

{
  "transformId": "5cc8993c-5e5a-4cf9-9816-46eb16228b4e",
  "success": true
}

Last updated