Update a constraint
Updates a constraint's validation function, label, or arguments. Partial
update: omitted fields are left unchanged. column_id is ignored, since a
constraint cannot move to another column. arguments, when not empty,
replace all arguments (send the full set). An unknown function returns 400.
https://api.wetransform.com/constraint/{constraintId}
| Parameter | Description | Pattern |
|---|---|---|
{constraintId} |
The constraint UUID ( |
[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12} |
column_id
string
UUID of the column to constrain (column_id of the column endpoints). Required on creation, ignored on update: a constraint cannot move to another column.
"00000000-0000-0000-0000-000000000000"
function
string
The validation function checking each value of the column, by stable name (e.g. is_between) or UUID. Required on creation; an unknown function returns 400.
The function's first argument is the column value itself and is never sent in arguments. Available validation functions:
| begin_by | Checks if begins by a given text | ?begin_by(Value to check,Required prefix) |
| check_ean | Checks that the value is exactly 13 digits with a valid EAN-13 (GS1 modulo-10) check digit | ?check_ean(Value to check) |
| contains | Checks if the value contains a given text | ?contains(Value to check,Text that must be present) |
| date_after | Checks if a date is after another date | ?date_after(Date to check,Minimum allowed date) |
| date_after_equals | Checks if a date is after or equal to another date | ?date_after_equals(Date to check,Minimum allowed date) |
| date_before | Checks if a date is before another date | ?date_before(Date to check,Maximum allowed date) |
| date_before_equals | Checks if a date is before or equal to another date | ?date_before_equals(Date to check,Maximum allowed date) |
| date_between | Checks if a date is between two values | ?date_between(Date to check,Minimum allowed date,Maximum allowed date) |
| ends_by | Checks if the value ends with a given text | ?ends_by(Value to check,Required suffix) |
| equal_to | Checks if a value is exactly equal to another | ?equal_to(Value to check,Expected value) |
| greater_or_equal_to | Checks if the value is greater than or equal to a limit | ?greater_or_equal_to(Value to check,Lower limit (included)) |
| greater_than | Checks if the value is strictly greater than a limit | ?greater_than(Value to check,Lower limit (excluded)) |
| is_between | Checks if a number is between A and B | ?is_between(Value to check,Low value,High value) |
| is_date_position | Check if date is in the future or in the past | ?is_date_position(Date to check,PAST or FUTURE) |
| is_filled_if_other_value_in | Must be filled when @other_column is in list @values_to_check | ?is_filled_if_other_value_in(The value to check,The other column to check,The list of values to check separated by a comma) |
| is_lower | Checks if the value is lowercase | ?is_lower(Text to check) |
| is_number | Checks if is a valid standard number | ?is_number(Value to check) |
| is_positive_number | Checks if a number is positive | ?is_positive_number(Value to check) |
| is_specific_value | Value must belong to the list of values you select | ?is_specific_value(Value to check,List of values to check against) |
| is_unique_key | Combination of values must be unique across the dataset | ?is_unique_key(Column,First key column,Second key column,Third key column,Fourth key column,Fifth key column) |
| is_upper | Checks if is in uppercase | ?is_upper(Text to check) |
| is_valid_postal_code | Check if zip code is valid depending on country ISO2 code | ?is_valid_postal_code(Zip code to validate,Country code ISO 2 format) |
| is_working_hour | Checks whether the server's current hour is within [start..end] (24h, 0-23). When start > end, the range is overnight. | ?is_working_hour(Column to check (ignored — time-of-day predicate),Start hour, 0-23,End hour, 0-23 (inclusive)) |
| json_array_length_equals | Checks if a JSON array has exactly the expected number of items | ?json_array_length_equals(JSON payload containing the array,Expected number of items in the array,Path to the array to check, starting with € at the root (optional)) |
| json_contains | Checks whether a JSON document contains a non-empty value at a given path | ?json_contains(JSON payload in which the value will be searched,Path of the value to check, starting with € at the root) |
| length_between | Checks if the length of the text is between a minimum and a maximum value (inclusive) | ?length_between(Value to check,Minimum length,Maximum length) |
| length_equal_to | Checks if the length of the text is equal to the specified number | ?length_equal_to(Value to check,Expected length) |
| length_is_maximum | Checks if has a maximum length of | ?length_is_maximum(The value to check,The maximum length) |
| length_is_minimum | Checks if has a minimum length of | ?length_is_minimum(The value to check,The minimum length) |
| less_or_equal_to | Checks if the value is less than or equal to a limit | ?less_or_equal_to(Value to check,Upper limit (included)) |
| less_than | Checks if the value is strictly less than a limit | ?less_than(Value to check,Upper limit (excluded)) |
| lookup | Checks if a value matches rows based on cross-row lookup conditions | ?lookup(Value to check on current row,Expected value to match,First additional condition (e.g. #(col)=value or #(col)=!(col)),Second additional condition (e.g. #(col)=value or #(col)=!(col))) |
| match_pattern | Checks if the value matches a wildcard pattern using * and ? | ?match_pattern(Value to check,Pattern to match (supports * and ?)) |
| matches_regex | Check if matches the regex | ?matches_regex(Text to validate,Regex pattern) |
| must_be_empty | Must be empty | ?must_be_empty(The value to check) |
| no_html_tags | Ensures the value contains no HTML tags except those explicitly allowed | ?no_html_tags(Value to check,Allowed tags (e.g. b/p/i)) |
| no_line_breaks | Checks that the content does not contain any carriage returns or newlines | ?no_line_breaks(Value to check) |
| not_begin_by | Checks if value does not begin with a given text | ?not_begin_by(Value to check,Forbidden prefix) |
| not_contains | Checks if the value does not contain a given text | ?not_contains(Value to check,Text that must not be present) |
| not_ends_by | Checks if the value does not end with a given text | ?not_ends_by(Value to check,Forbidden suffix) |
"is_between"
label
string
Error message shown to your customers when a value fails the constraint, at most 70 characters. @<argument name> is replaced by that argument's value.
Ex: "This value must be between @low and @high". Cannot be cleared once set.
"This value must be between @low and @high"
arguments
array
The function arguments, as a list of {name, value} objects: one per argument the function declares, except the first one (the column value).
Ex: is_between expects low and high. On update, a non-empty list replaces all arguments (send the full set); an empty list leaves them unchanged.
arguments[].name
string
Argument name as declared by the function (e.g. low): lowercase letters, digits and underscores.
"low"
arguments[].type
string
EXPRESSION when value is an expression such as #(other_column). For a literal, omit it or send the argument's declared data type (e.g. NUMBER, DATE).
Expressions are refused for COLUMN, CHOICE, LIST_OF_VALUES, VALUE and DATE_FORMAT arguments.
arguments[].value
string
The argument value, always sent as a string: a literal (e.g. "18"), or the expression text when type is EXPRESSION. Expressions may only reference columns of the same template.
"18"
* are nullable.
{
"column_id": "00000000-0000-0000-0000-000000000000",
"function": "is_between",
"label": "This value must be between @low and @high",
"arguments": [
{
"name": "low",
"type": null,
"value": "18"
},
{
"name": "high",
"type": null,
"value": "100"
}
]
}
Copy
success
boolean
Always true on successful responses.
true
payload
object
Payload of the requested resource.
payload.constraint_id
string
nullable
The constraint UUID, used as {constraintId} in the constraint endpoints. Keep it: constraints cannot be listed.
"881a6b1b-0e41-4729-b081-e9308e8fdb9e"
payload.column_id
string
nullable
UUID of the constrained column.
"1e6c0550-9a84-4c9f-b908-58c896f43d23"
payload.function
string
nullable
Stable name of the validation function checking the column values.
Ex: is_between.
"is_between"
payload.label
string
nullable
Error message shown to your customers when a value fails the constraint. @<argument name> is replaced by that argument's value.
"This value must be between @low and @high"
payload.arguments
array
The function arguments, as {name, type, value} objects. type is EXPRESSION for an expression, otherwise the argument's declared data type (e.g. NUMBER).
payload.arguments[].name
string
Argument name as declared by the function (e.g. low): lowercase letters, digits and underscores.
"low"
payload.arguments[].type
string
nullable
EXPRESSION when value is an expression such as #(other_column). For a literal, omit it or send the argument's declared data type (e.g. NUMBER, DATE).
Expressions are refused for COLUMN, CHOICE, LIST_OF_VALUES, VALUE and DATE_FORMAT arguments.
payload.arguments[].value
string
nullable
The argument value, always sent as a string: a literal (e.g. "18"), or the expression text when type is EXPRESSION. Expressions may only reference columns of the same template.
"18"
product
object
nullable
A product needed.
Not null if user requires to buy a specific product (permission or limitation) in order to access a feature.
product.requirement
string
nullable
Whether the user requested a features s/he doesn't have access to,
or the user needs greater limits.
Possible values: permission, limitation
"permission"
product.permission
object
nullable
The required permission.
You will need to know which permission is needed in order to fill up search filters in the shop.
product.permission.description
string
nullable
A human-understandable name for the permission.
product.permission.name
string
A technical permission name (ex: ORGANISATION_UPDATE_SETTINGS).
Possible values depend on the context, check the domain's metadata endpoint.
"X_SOURCE_FORMAT_XML"
product.limitation_type
string
nullable
The limitation that needs to be increased (ex: number of columns).
product.limitation_needed_value
integer
nullable
The needed resource quantity (if receiver uses 9 columns in a template, this value is 9).
product.limitation_current_value
integer
nullable
The current value of the limitation (if receiver is allowed to use 10 columns, this value is 10).
product.limitation_object
object
nullable
The limitation type in a readable format, for example, "lines per file".
product.ai_feature
string
nullable
The AI feature that could not run, when an AI feature is what hit the limitation
(null for any other product).
Possible values: rule_transformation, rule_template, rule_function, rule_constraint, column_constraints, normalizer, chat_db, doc_assistant, api_doc_assistant, autocorrect, autocorrect_fill, invoice_reader, column_match, value_match, power_populate_with_ai, power_extract_from_pdf, power_extract_from_spreadsheet, agent, column_enrichment, column_constraints_batch, agent_compression, agent_workflow_scaffold, agent_phase_fill, push_json_column_match, value_match_embedding, normalizer_debugger, power_extract_from_text, template_format_custom, power_describe_image, power_background_erase, hosted_image_view, value_match_context
product.message
object
nullable
What stopped, on what, and what it would take — translated and ready to display,
with one wording per AI feature: "Matching the values of column «Couleur» with AI
needs 12 AI credits, and 10 are left."
Null whenever ai_feature is, and on the rare AI exposure that has no subject to
name (the template collection's json_column_match_product covers no single
template). Fall back to the generic call-to-action then.
product.is_cta
boolean
nullable
Whether a Call To Action should be displayed.
It may not be displayed if:
- the limitation is on the membership role
- the limitation is on the customer role
- the user is a sender
debug
array
Debug information.
Contains logs about business logic explaining state of the response payload.
Provided in development & admin modes only.
* are nullable.
{
"success": true,
"payload": {
"constraint_id": "881a6b1b-0e41-4729-b081-e9308e8fdb9e",
"column_id": "1e6c0550-9a84-4c9f-b908-58c896f43d23",
"function": "is_between",
"label": "This value must be between @low and @high",
"arguments": [
{
"name": "low",
"type": null,
"value": "18"
},
{
"name": "high",
"type": null,
"value": "100"
}
]
},
"product": {
"requirement": "permission",
"permission": {
"name": "X_SOURCE_FORMAT_XML",
"description": "Can import XML files"
},
"limitation_type": null,
"limitation_needed_value": null,
"limitation_current_value": null,
"limitation_object": null,
"is_cta": false,
"ai_feature": null,
"message": null
},
"debug": []
}
Copy
success
boolean
Always false on error responses.
false
payload
object
Context about the error, if any.
product
object
nullable
A product needed.
Not null if user requires to buy a specific product (permission or limitation) in order to access a feature.
product.requirement
string
nullable
Whether the user requested a features s/he doesn't have access to,
or the user needs greater limits.
Possible values: permission, limitation
"permission"
product.permission
object
nullable
The required permission.
You will need to know which permission is needed in order to fill up search filters in the shop.
product.permission.description
string
nullable
A human-understandable name for the permission.
product.permission.name
string
A technical permission name (ex: ORGANISATION_UPDATE_SETTINGS).
Possible values depend on the context, check the domain's metadata endpoint.
"X_SOURCE_FORMAT_XML"
product.limitation_type
string
nullable
The limitation that needs to be increased (ex: number of columns).
product.limitation_needed_value
integer
nullable
The needed resource quantity (if receiver uses 9 columns in a template, this value is 9).
product.limitation_current_value
integer
nullable
The current value of the limitation (if receiver is allowed to use 10 columns, this value is 10).
product.limitation_object
object
nullable
The limitation type in a readable format, for example, "lines per file".
product.ai_feature
string
nullable
The AI feature that could not run, when an AI feature is what hit the limitation
(null for any other product).
Possible values: rule_transformation, rule_template, rule_function, rule_constraint, column_constraints, normalizer, chat_db, doc_assistant, api_doc_assistant, autocorrect, autocorrect_fill, invoice_reader, column_match, value_match, power_populate_with_ai, power_extract_from_pdf, power_extract_from_spreadsheet, agent, column_enrichment, column_constraints_batch, agent_compression, agent_workflow_scaffold, agent_phase_fill, push_json_column_match, value_match_embedding, normalizer_debugger, power_extract_from_text, template_format_custom, power_describe_image, power_background_erase, hosted_image_view, value_match_context
product.message
object
nullable
What stopped, on what, and what it would take — translated and ready to display,
with one wording per AI feature: "Matching the values of column «Couleur» with AI
needs 12 AI credits, and 10 are left."
Null whenever ai_feature is, and on the rare AI exposure that has no subject to
name (the template collection's json_column_match_product covers no single
template). Fall back to the generic call-to-action then.
product.is_cta
boolean
nullable
Whether a Call To Action should be displayed.
It may not be displayed if:
- the limitation is on the membership role
- the limitation is on the customer role
- the user is a sender
debug
array
Debug information.
Contains logs about business logic explaining state of the response payload.
Provided in development & admin modes only.
* are nullable.
{
"success": false,
"payload": [],
"product": {
"requirement": "permission",
"permission": {
"name": "X_SOURCE_FORMAT_XML",
"description": "Can import XML files"
},
"limitation_type": null,
"limitation_needed_value": null,
"limitation_current_value": null,
"limitation_object": null,
"is_cta": false,
"ai_feature": null,
"message": null
},
"debug": []
}
Copy
The client sent an unexpected request.
It happens if the client sent an invalid JSON payload, or if the JSON payload cannot be mapped to the expected request object.
success
boolean
Always false on error responses.
false
payload
object
Context about the error, if any.
product
object
nullable
A product needed.
Not null if user requires to buy a specific product (permission or limitation) in order to access a feature.
product.requirement
string
nullable
Whether the user requested a features s/he doesn't have access to,
or the user needs greater limits.
Possible values: permission, limitation
"permission"
product.permission
object
nullable
The required permission.
You will need to know which permission is needed in order to fill up search filters in the shop.
product.permission.description
string
nullable
A human-understandable name for the permission.
product.permission.name
string
A technical permission name (ex: ORGANISATION_UPDATE_SETTINGS).
Possible values depend on the context, check the domain's metadata endpoint.
"X_SOURCE_FORMAT_XML"
product.limitation_type
string
nullable
The limitation that needs to be increased (ex: number of columns).
product.limitation_needed_value
integer
nullable
The needed resource quantity (if receiver uses 9 columns in a template, this value is 9).
product.limitation_current_value
integer
nullable
The current value of the limitation (if receiver is allowed to use 10 columns, this value is 10).
product.limitation_object
object
nullable
The limitation type in a readable format, for example, "lines per file".
product.ai_feature
string
nullable
The AI feature that could not run, when an AI feature is what hit the limitation
(null for any other product).
Possible values: rule_transformation, rule_template, rule_function, rule_constraint, column_constraints, normalizer, chat_db, doc_assistant, api_doc_assistant, autocorrect, autocorrect_fill, invoice_reader, column_match, value_match, power_populate_with_ai, power_extract_from_pdf, power_extract_from_spreadsheet, agent, column_enrichment, column_constraints_batch, agent_compression, agent_workflow_scaffold, agent_phase_fill, push_json_column_match, value_match_embedding, normalizer_debugger, power_extract_from_text, template_format_custom, power_describe_image, power_background_erase, hosted_image_view, value_match_context
product.message
object
nullable
What stopped, on what, and what it would take — translated and ready to display,
with one wording per AI feature: "Matching the values of column «Couleur» with AI
needs 12 AI credits, and 10 are left."
Null whenever ai_feature is, and on the rare AI exposure that has no subject to
name (the template collection's json_column_match_product covers no single
template). Fall back to the generic call-to-action then.
product.is_cta
boolean
nullable
Whether a Call To Action should be displayed.
It may not be displayed if:
- the limitation is on the membership role
- the limitation is on the customer role
- the user is a sender
debug
array
Debug information.
Contains logs about business logic explaining state of the response payload.
Provided in development & admin modes only.
* are nullable.
{
"success": false,
"payload": [],
"product": {
"requirement": "permission",
"permission": {
"name": "X_SOURCE_FORMAT_XML",
"description": "Can import XML files"
},
"limitation_type": null,
"limitation_needed_value": null,
"limitation_current_value": null,
"limitation_object": null,
"is_cta": false,
"ai_feature": null,
"message": null
},
"debug": []
}
Copy
User is well authenticated, but not authorized to access the resource.
It can happen if user is trying to use a feature that s/he didn't pay for, access someone else's resource, etc.
These issues are normally fixed by the frontend, which should render features and resources user has access to.
success
boolean
Always false on error responses.
false
payload
object
Context about the error, if any.
product
object
nullable
A product needed.
Not null if user requires to buy a specific product (permission or limitation) in order to access a feature.
product.requirement
string
nullable
Whether the user requested a features s/he doesn't have access to,
or the user needs greater limits.
Possible values: permission, limitation
"permission"
product.permission
object
nullable
The required permission.
You will need to know which permission is needed in order to fill up search filters in the shop.
product.permission.description
string
nullable
A human-understandable name for the permission.
product.permission.name
string
A technical permission name (ex: ORGANISATION_UPDATE_SETTINGS).
Possible values depend on the context, check the domain's metadata endpoint.
"X_SOURCE_FORMAT_XML"
product.limitation_type
string
nullable
The limitation that needs to be increased (ex: number of columns).
product.limitation_needed_value
integer
nullable
The needed resource quantity (if receiver uses 9 columns in a template, this value is 9).
product.limitation_current_value
integer
nullable
The current value of the limitation (if receiver is allowed to use 10 columns, this value is 10).
product.limitation_object
object
nullable
The limitation type in a readable format, for example, "lines per file".
product.ai_feature
string
nullable
The AI feature that could not run, when an AI feature is what hit the limitation
(null for any other product).
Possible values: rule_transformation, rule_template, rule_function, rule_constraint, column_constraints, normalizer, chat_db, doc_assistant, api_doc_assistant, autocorrect, autocorrect_fill, invoice_reader, column_match, value_match, power_populate_with_ai, power_extract_from_pdf, power_extract_from_spreadsheet, agent, column_enrichment, column_constraints_batch, agent_compression, agent_workflow_scaffold, agent_phase_fill, push_json_column_match, value_match_embedding, normalizer_debugger, power_extract_from_text, template_format_custom, power_describe_image, power_background_erase, hosted_image_view, value_match_context
product.message
object
nullable
What stopped, on what, and what it would take — translated and ready to display,
with one wording per AI feature: "Matching the values of column «Couleur» with AI
needs 12 AI credits, and 10 are left."
Null whenever ai_feature is, and on the rare AI exposure that has no subject to
name (the template collection's json_column_match_product covers no single
template). Fall back to the generic call-to-action then.
product.is_cta
boolean
nullable
Whether a Call To Action should be displayed.
It may not be displayed if:
- the limitation is on the membership role
- the limitation is on the customer role
- the user is a sender
debug
array
Debug information.
Contains logs about business logic explaining state of the response payload.
Provided in development & admin modes only.
* are nullable.
{
"success": false,
"payload": [],
"product": {
"requirement": "permission",
"permission": {
"name": "X_SOURCE_FORMAT_XML",
"description": "Can import XML files"
},
"limitation_type": null,
"limitation_needed_value": null,
"limitation_current_value": null,
"limitation_object": null,
"is_cta": false,
"ai_feature": null,
"message": null
},
"debug": []
}
Copy
A violation happens when a property value does not respect the expected constraints.
If a user is making a mistake in a form and frontend is not able to detect it (because of the constraint being tied to some business logic for example), the API will return the invalid properties with the right error messages.
Note: examples are hardcoded in english (no access to the translator in a DTO).
success
boolean
Always false on error responses.
false
payload
object
Context about the error, if any.
payload.error
object
Generic message saying the request contains invalid values, translated in the
request locale. The details are in violations.
payload.error.code
string
A translation key for the given message.
"exception.violation"
payload.error.message
string
object
The translated version of the message.
Click on "Example" to get its translated value.
payload.violations
array
One entry per invalid value: the property path (e.g. format.csv.delimiter) and
the reason. Several entries can target the same property.
payload.violations[].property_path
string
Property having an invalid value.
"title"
payload.violations[].invalid_value
nullable
The invalid value.
""
payload.violations[].message
string
An error message describing the violation.
"This value should not be blank"
product
object
nullable
A product needed.
Not null if user requires to buy a specific product (permission or limitation) in order to access a feature.
product.requirement
string
nullable
Whether the user requested a features s/he doesn't have access to,
or the user needs greater limits.
Possible values: permission, limitation
"permission"
product.permission
object
nullable
The required permission.
You will need to know which permission is needed in order to fill up search filters in the shop.
product.permission.description
string
nullable
A human-understandable name for the permission.
product.permission.name
string
A technical permission name (ex: ORGANISATION_UPDATE_SETTINGS).
Possible values depend on the context, check the domain's metadata endpoint.
"X_SOURCE_FORMAT_XML"
product.limitation_type
string
nullable
The limitation that needs to be increased (ex: number of columns).
product.limitation_needed_value
integer
nullable
The needed resource quantity (if receiver uses 9 columns in a template, this value is 9).
product.limitation_current_value
integer
nullable
The current value of the limitation (if receiver is allowed to use 10 columns, this value is 10).
product.limitation_object
object
nullable
The limitation type in a readable format, for example, "lines per file".
product.ai_feature
string
nullable
The AI feature that could not run, when an AI feature is what hit the limitation
(null for any other product).
Possible values: rule_transformation, rule_template, rule_function, rule_constraint, column_constraints, normalizer, chat_db, doc_assistant, api_doc_assistant, autocorrect, autocorrect_fill, invoice_reader, column_match, value_match, power_populate_with_ai, power_extract_from_pdf, power_extract_from_spreadsheet, agent, column_enrichment, column_constraints_batch, agent_compression, agent_workflow_scaffold, agent_phase_fill, push_json_column_match, value_match_embedding, normalizer_debugger, power_extract_from_text, template_format_custom, power_describe_image, power_background_erase, hosted_image_view, value_match_context
product.message
object
nullable
What stopped, on what, and what it would take — translated and ready to display,
with one wording per AI feature: "Matching the values of column «Couleur» with AI
needs 12 AI credits, and 10 are left."
Null whenever ai_feature is, and on the rare AI exposure that has no subject to
name (the template collection's json_column_match_product covers no single
template). Fall back to the generic call-to-action then.
product.is_cta
boolean
nullable
Whether a Call To Action should be displayed.
It may not be displayed if:
- the limitation is on the membership role
- the limitation is on the customer role
- the user is a sender
debug
array
Debug information.
Contains logs about business logic explaining state of the response payload.
Provided in development & admin modes only.
* are nullable.
{
"success": false,
"payload": {
"error": {
"code": "exception.violation",
"message": "The provided payload contains property violations."
},
"violations": [
{
"property_path": "title",
"invalid_value": "",
"message": "This value should not be blank"
},
{
"property_path": "price",
"invalid_value": -5,
"message": "The amount should be greater than 1"
}
]
},
"product": {
"requirement": "permission",
"permission": {
"name": "X_SOURCE_FORMAT_XML",
"description": "Can import XML files"
},
"limitation_type": null,
"limitation_needed_value": null,
"limitation_current_value": null,
"limitation_object": null,
"is_cta": false,
"ai_feature": null,
"message": null
},
"debug": []
}
Copy