v2
latestOpenAPI 3.1.02026-07-26391214472.7 KBadmin-schema
Validate Formula
Compile a formula expression against an object's current schema and report whether it's valid.
The Setup → Fields → Formula editor calls this on every "Check syntax" click — it lets admins surface compile errors (unknown field, type mismatch, bad syntax) before submitting the create-field form, where the same compile would also run but rejects the whole save instead of just inlining a hint.
Request body::
{"object_type": "Opportunity",
"formula_expression": "TODAY() - close_date",
"return_type": "number"} # optional — when present, the
# endpoint also checks that
# the inferred type matches.
Response on success::
{"valid": true,
"return_type": "number", # inferred from the formula
"referenced_fields": ["close_date"]}
Response on failure (HTTP 200 with valid=false, so the UI can show the error inline)::
{"valid": false, "error": "Unknown field reference: close_dat"}
post/api/v1/admin/fields/validate-formula
Headers
authorizationstring nullable
X-API-Keystring nullable
Request body
object required
Response
Successful Response
{"stackTrail":"paths:/api/v1/admin/fields/validate-formula:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}