Update a model (schema, strategy, output tags…)
PUT
/api/models/{modelId}
const url = 'https://api.langparse.dev/api/models/example';const options = { method: 'PUT', headers: {'X-Api-Key': '<X-Api-Key>', 'Content-Type': 'application/json'}, body: '{"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":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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": {} }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”modelId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
Example
Invoicefields
Array<object>
object
title
required
string
Example
Invoice Numbername
Output JSON key. Any style (e.g. camelCase) — kept verbatim; snake_case is auto-derived from title only when omitted.
string
type
required
string
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
InvoiceTotalexpression
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
Responses
Section titled “Responses”Updated model
Media typeapplication/json
A model (schema + strategy + output tags).
object
key
additional properties
any
Examplegenerated
{}