JsonataFunctionResp
Full JSONata function — returned by GET /jsonata-functions/{key}, POST /jsonata-functions, PUT .../versions/draft, and POST .../versions/draft/publish. Carries the function's identity (metadata), signature + body (spec), and audit/publish metadata.
The optimistic-locking handle is returned in the HTTP ETag response header (RFC 7232) — capture it from the response and pass it back as If-Match on the next PUT / DELETE.
- contentType: string
Hash requiredStable hash of the resource's content. Recomputed on every write (Create, Update, Publish), so it's available for both drafts and published versions. Useful for change detection — compare hashes across two snapshots (e.g. "did the draft actually change?" or "is the draft different from the latest published version?").
- createdType: stringFormat: date-time
At requiredWhen this version was created.
- createdType: object
By requiredActor who created this version.
- idType: stringrequired
Stable ID for the actor (UUID for users; the API key's
keyIdfor service accounts). - typeType: stringenumrequiredvalues
- user
- api
_key
- metadataType: objectrequired
The resource's identity and human-facing labels. Shared shape across all five resource kinds (blueprints, templates, schemas, assets, functions). The pair
(key, version)is the canonical handle for any resource within a namespace.- keyType: string
Pattern: ^[a-z][a-z0-9]*(_[a-z0-9]+)*$requiredCaller-supplied identifier, unique within the namespace per kind. Stable across versions — a blueprint's
keydoesn't change when you publish a new version. Snake_case; must start with a lowercase letter. - nameType: stringmax length:200required
Human-readable display name shown in Studio, list responses, and audit trails (max 200 chars).
- versionType: stringrequired
Either
draft(editable; only one draft per key at a time) or a semver like1.2.0(immutable once published). On create you choose: passdraftto iterate, or a semver to publish directly. - descriptionType: stringmax length:1000
Optional longer-form description. Helps both humans and AI assistants pick the right resource when browsing the catalog (max 1000 chars).
- labelsType: object
Arbitrary key/value tags for categorization and filtering — e.g.
{ "team": "people-ops", "env": "prod" }. Filterable on list endpoints via?labels[key]=value.
- specType: objectrequired
Function signature and implementation.
paramsdeclares the inputs (typed, optionally schema-pinned),returnTypedeclares the output, andbodyis the JSONata expression that turns one into the other.Calling the function in JSONata: invoke as
$<alias>(arg1, arg2, ...)from any expression that has the function in scope (templatedata.transform, blueprintinputMap, or another function'sbody). Thealiasis the one declared by the caller in itsfunctions[]entry; if no alias is declared, the function's ownkeyis used. Arguments are positional and must match the declaredparamsorder and types.Calling other custom functions from
body: declare each callee in thefunctions[]array with itsfunctionKey+ pinnedfunctionVersion(and optionalalias). This is the same explicit-registration pattern blueprints and templates use — pinning a version locks the dependency so the function keeps producing the same result even after the dependency publishes a new semver.- bodyType: stringrequired
The JSONata expression that computes the return value from the parameters. Standard JSONata syntax — referenced parameters are scoped variables (no
$prefix), built-in JSONata functions are invoked with the$prefix (e.g.$sum,$now,$fromMillis), and other custom functions are invoked as$<alias>(...)for each callee declared infunctions[](alias defaults tofunctionKeywhen not specified). - returnType: object
Type requiredType the function returns. For primitives (
string,number,boolean), the baretypeis enough. Forobject, pair withschemaKey+schemaVersionto pin the produced shape to a schema. Forarray, pair withitemTypeto declare the element type (and addschemaKey+schemaVersionwhenitemTypeisobject). - functionsType: array object[]
Other JSONata functions this function calls from
body. Each entry pins a specificfunctionKey+functionVersion, with an optionalaliasused at call sites (defaults tofunctionKeywhen not specified). Aliases let you decouple call-site names from resource keys so you can rename or swap the callee later by changing this entry without touchingbody. Same shape used byBlueprintSpec.functionsandTemplateSpec.functions. - paramsType: array object[] · JsonataFunctionParam[]
Ordered list of input parameters. Inside
body, each is referenced by name without the$prefix (e.g.params: [{name: "amount"}]is read asamountin the expression).
- updatedType: stringFormat: date-time
At requiredWhen this version was last modified (drafts only — published versions are immutable).
- apiType: string
Version API version of the resource shape this function was stored against.
- publishedType: stringFormat: date-time
At When this version was published. Absent on drafts.
- publishedType: object
By Actor who published this version. Absent on drafts.
- idType: stringrequired
Stable ID for the actor (UUID for users; the API key's
keyIdfor service accounts). - typeType: stringenumrequiredvalues
- user
- api
_key
