Skip to content
POST /environment-unified-model-resource-method

Add an environment-scoped mapping override for one (resource_name, integration_name, method_name) triple. The config is deep-merged on top of the base unified model mapping when the unified API runs, so only the fields you want to change need to be sent. This is the correct write for "change the mapping for this installed integration" — it leaves the base unified model, and therefore every other environment, untouched. Do not reach for PATCH /unified-model/{id} for that: it edits the team-wide definition every environment reads from. 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

configobject

The override mapping for this method, deep-merged on top of the base mapping.

afterstring | object[]
base_url_mappingstring
beforestring | object[]
bodyRecord<string, any>

Static body merged into the integration request.

documentation_linkstring
error_mappingstring
file_uploadstring | object | object[]
One of
object · 2 properties
configRecord<string, any>

Strategy-specific options (e.g. multipart field name, base64 wrapper key).

file_uploadstring
Possible values:
multipartbase64upload
is_partial_expressionstring
is_partial_responseboolean
mapping_versionnumber
methodstring | object[] | object

Integration method to call.

One of
object · 2 properties
expressionstring
methodsstring[]
path_mappingstring
queryRecord<string, any>

Static query params merged into the integration request.

query_mappingstring | Record<string, any>
query_schemastring | Record<string, any>
related_resourcesstring | object[]
request_body_mappingstring | Record<string, any>
request_body_schemaRecord<string, any>

Object-form (v2) request body schema; values are partial JSON Schema entries.

request_header_mappingstring
resourcestring | object[] | object

Integration resource to call. May be a single name, an array of resource fragments, or a { expression, resources } object for dynamic dispatch.

One of
object · 2 properties
expressionstring
resourcesstring[]
response_header_mappingstring
response_mappingstring | Record<string, any>

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.

response_mapping_methodstring
Possible values:
arrayitem
side_loadRecord<string, any>
static

Static value returned for this method without making an HTTP call.

environment_unified_model_idstring · uuid

The environment_unified_model record to attach the override to — get it from GET /environment-unified-model?unified_model_id=…. Must belong to an environment you have access to.

Example: 4af1e38e-1d84-4bea-8ef4-2d705aec43bc
integration_namestring

The integration slug (e.g. apollo).

Example: apollo
method_namestring

The unified method name (list, get, create, update, delete, or a custom method).

Example: list
resource_namestring

The unified resource name (e.g. contacts).

Example: contacts

Response Body

configobject

The override mapping, deep-merged on top of the base unified model mapping's config for the same (resource, integration, method) triple.

afterstring | object[]
base_url_mappingstring
beforestring | object[]
bodyRecord<string, any>

Static body merged into the integration request.

documentation_linkstring
error_mappingstring
file_uploadstring | object | object[]
One of
object · 2 properties
configRecord<string, any>

Strategy-specific options (e.g. multipart field name, base64 wrapper key).

file_uploadstring
Possible values:
multipartbase64upload
is_partial_expressionstring
is_partial_responseboolean
mapping_versionnumber
methodstring | object[] | object

Integration method to call.

One of
object · 2 properties
expressionstring
methodsstring[]
path_mappingstring
queryRecord<string, any>

Static query params merged into the integration request.

query_mappingstring | Record<string, any>
query_schemastring | Record<string, any>
related_resourcesstring | object[]
request_body_mappingstring | Record<string, any>
request_body_schemaRecord<string, any>

Object-form (v2) request body schema; values are partial JSON Schema entries.

request_header_mappingstring
resourcestring | object[] | object

Integration resource to call. May be a single name, an array of resource fragments, or a { expression, resources } object for dynamic dispatch.

One of
object · 2 properties
expressionstring
resourcesstring[]
response_header_mappingstring
response_mappingstring | Record<string, any>

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.

response_mapping_methodstring
Possible values:
arrayitem
side_loadRecord<string, any>
static

Static value returned for this method without making an HTTP call.

created_atstring · date-time

When the override was created.

Example: 2024-01-10T10:00:00.000Z
environment_unified_model_idstring · uuid

The environment_unified_model record (environment + unified model pair) this override belongs to.

Example: 4af1e38e-1d84-4bea-8ef4-2d705aec43bc
idstring · uuid

The ID of the override.

Example: 3cb4223d-8e2f-4a55-9a3f-5f2c9d0a17bd
integration_namestring

The integration slug this override serves (e.g. apollo).

Example: apollo
method_namestring

The unified method this override serves (list, get, create, update, delete, or a custom method name).

Example: list
resource_namestring

The unified resource this override serves (e.g. contacts).

Example: contacts
updated_atstring · date-time

When the override was last updated.

Example: 2024-01-11T12:30:00.000Z
versionnumber

Optimistic-concurrency version. Send the current value in a PATCH body; every write increments it.

Example: 2

Errors

StatusDescription
400Bad request — environment_unified_model_id missing, or a JSONata mapping expression failed to parse.
403Forbidden — the environment unified model is not in an environment you can access.
curl -X POST 'https://api.truto.one/environment-unified-model-resource-method' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "environment_unified_model_id": "4af1e38e-1d84-4bea-8ef4-2d705aec43bc",
  "resource_name": "contacts",
  "integration_name": "apollo",
  "method_name": "list",
  "config": {}
}'
const body = {
  "environment_unified_model_id": "4af1e38e-1d84-4bea-8ef4-2d705aec43bc",
  "resource_name": "contacts",
  "integration_name": "apollo",
  "method_name": "list",
  "config": {}
};

const response = await fetch('https://api.truto.one/environment-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/environment-unified-model-resource-method"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "environment_unified_model_id": "4af1e38e-1d84-4bea-8ef4-2d705aec43bc",
    "resource_name": "contacts",
    "integration_name": "apollo",
    "method_name": "list",
    "config": {}
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())