Skip to content

Update a model (schema, strategy, output tags…)

PUT
/api/models/{modelId}
curl --request PUT \
--url https://api.langparse.dev/api/models/example \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <X-Api-Key>' \
--data '{ "name": "Invoice", "fields": [ { "title": "Invoice Number", "name": "example", "type": "text", "required": true, "multiple": true, "transform": "example", "children": [] } ], "rule": "example", "outputTags": [ { "name": "InvoiceTotal", "expression": "${data.invoice_total}", "toSource": true, "toDestination": true } ], "strategy": {} }'
modelId
required
string
Media typeapplication/json
object
name
required
string
Example
Invoice
fields
Array<object>
object
title
required
string
Example
Invoice Number
name

Output JSON key. Any style (e.g. camelCase) — kept verbatim; snake_case is auto-derived from title only when omitted.

string
type
required
string
Allowed values: text number date boolean select list object image synthesize
required
boolean
multiple

List: repeated rows (default true). object: array of objects (default false = one object).

boolean
transform

Per-field JS (value, doc) => newValue.

string
children
Array<object> recursive
rule

Document validation JS (doc, ctx) => void.

string
outputTags
Array<object>

An S3 object tag projected from parsed data. Use ${data.field}, ${dest.uri/bucket/key} or literals.

object
name
required
string
Example
InvoiceTotal
expression
required
string
Example
${data.invoice_total}
toSource

Tag the original source file (S3 sources).

boolean
toDestination

Tag the delivered output object.

boolean
strategy

{ kind: single|consensus, extractors: […], judge? }

object
key
additional properties
any

Updated model

Media typeapplication/json

A model (schema + strategy + output tags).

object
key
additional properties
any
Examplegenerated
{}