Create unified model mapping
/unified-model-resource-method
Add a mapping row for one (resource_name, integration_name, method_name) triple on a base unified model.
This is a team-wide write — every environment that installs the unified model inherits it. To change behaviour for a single environment only, create an environment-unified-model-resource-method row instead.
config string fields that Truto evaluates as JSONata (response_mapping, query_mapping, request_body_mapping, path_mapping, error_mapping, request_header_mapping, response_header_mapping, is_partial_expression, related_resources, resource.expression, method.expression, and the run_if guards on before/after/related_resources steps) are syntax-checked on write and rejected with a 400 naming the field that failed to parse.
Request Body
The mapping configuration for this method.
Static body merged into the integration request.
object · 2 properties
Strategy-specific options (e.g. multipart field name, base64 wrapper key).
multipartbase64upload
Integration method to call.
object · 2 properties
Static query params merged into the integration request.
Object-form (v2) request body schema; values are partial JSON Schema entries.
Integration resource to call. May be a single name, an array of resource fragments, or a { expression, resources } object for dynamic dispatch.
object · 2 properties
JSONata expression (string) or object-form mapping. The object form is keyed by field name with values that may be JSONata strings, nested objects, or JsonSchemaObjectProperties.
arrayitem
Static value returned for this method without making an HTTP call.
The integration slug (e.g. apollo).
apolloThe unified method name (list, get, create, update, delete, or a custom method).
listThe unified resource name (e.g. contacts).
contactsThe base unified model to attach the mapping to. Must belong to one of your teams.
7c5c8cc2-e68e-4af8-84d1-4ceea1489338Response Body
The mapping itself (JSONata expressions, resource/method routing, side loads, …).
Static body merged into the integration request.
object · 2 properties
Strategy-specific options (e.g. multipart field name, base64 wrapper key).
multipartbase64upload
Integration method to call.
object · 2 properties
Static query params merged into the integration request.
Object-form (v2) request body schema; values are partial JSON Schema entries.
Integration resource to call. May be a single name, an array of resource fragments, or a { expression, resources } object for dynamic dispatch.
object · 2 properties
JSONata expression (string) or object-form mapping. The object form is keyed by field name with values that may be JSONata strings, nested objects, or JsonSchemaObjectProperties.
arrayitem
Static value returned for this method without making an HTTP call.
When the mapping was created.
2024-01-10T10:00:00.000ZThe ID of the unified model mapping.
8ed2b6ea-2c2c-4f61-97a1-6b0b0f0f0a11The integration slug this mapping serves (e.g. apollo).
apolloThe unified method this mapping serves (list, get, create, update, delete, or a custom method name).
listThe unified resource this mapping serves (e.g. contacts).
contactsThe base unified model this mapping belongs to.
7c5c8cc2-e68e-4af8-84d1-4ceea1489338When the mapping was last updated.
2024-01-11T12:30:00.000ZOptimistic-concurrency version. Send the current value in a PATCH body; every write increments it.
3Errors
| Status | Description |
|---|---|
400 | Bad request — unified_model_id missing, or a JSONata mapping expression failed to parse. |
403 | Forbidden — the unified model does not belong to your team (sharing grants read access only). |
curl -X POST 'https://api.truto.one/unified-model-resource-method' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"unified_model_id": "7c5c8cc2-e68e-4af8-84d1-4ceea1489338",
"resource_name": "contacts",
"integration_name": "apollo",
"method_name": "list",
"config": {}
}'const body = {
"unified_model_id": "7c5c8cc2-e68e-4af8-84d1-4ceea1489338",
"resource_name": "contacts",
"integration_name": "apollo",
"method_name": "list",
"config": {}
};
const response = await fetch('https://api.truto.one/unified-model-resource-method', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/unified-model-resource-method"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"unified_model_id": "7c5c8cc2-e68e-4af8-84d1-4ceea1489338",
"resource_name": "contacts",
"integration_name": "apollo",
"method_name": "list",
"config": {}
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())