Update unified model
/unified-model/{id}
Path Parameters
The ID of the unified model to update.
7c5c8cc2-e68e-4af8-84d1-4ceea1489338Request Body
The new category, if you want to change it.
communicationA brief description of what this unified model represents.
This model provides a user directory interface for various HRIS integrations.Per-resource documentation.
The new name of the unified model, if you want to rename it.
user-directoryUpdated map of resource name → UnifiedModelResource.
Per-resource OAuth/permission scopes required to call its methods.
The ID of the team that owns this unified model.
05daecaf-4365-42e8-8370-8127de5dd717The current version of the unified model. Required to prevent version conflicts.
3Per-resource webhook routing expression (JSONata).
Response Body
The category of the unified model.
hrisThe date and time when the unified model was created.
2021-08-10T10:00:00.000ZA brief description of what this unified model represents.
This model provides a user directory interface for various HRIS integrations.Per-resource documentation (pricing plan / scopes / instructions).
The ID of the unified model.
7c5c8cc2-e68e-4af8-84d1-4ceea1489338A list of environment IDs where this unified model is installed.
The name of the unified model.
user-directoryMap of resource name (e.g. users, contacts) → resource definition (UnifiedModelResource).
{
"users": {
"description": "A resource representing user objects",
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
}
}
},
"integration_mapping": {
"my_integration": {
"list": {
"resource": "/users",
"method": "get"
}
}
}
}
}Per-resource OAuth/permission scopes required to call its methods.
The sharing policy of the unified model.
denyallowaskdeny
Whether the team allows impersonation.
falseThe date and time when the team was created.
2021-08-10T10:00:00.000ZThe domain of the team.
example.comThe ID of the team.
05daecaf-4365-42e8-8370-8127de5dd717Whether the team is verified or not.
trueWhether the team is white-labeled or not.
falseThe URL of the team's logo.
https://example.com/logo.pngThe name of the team.
My Awesome TeamA link to the team's Terms of Service, if available.
https://example.com/tosThe date and time when the team was last updated.
2021-08-10T10:00:00.000ZThe ID of the team that owns this unified model.
05daecaf-4365-42e8-8370-8127de5dd717The date and time when the unified model was last updated.
2021-08-10T10:30:00.000ZThe current version of the unified model.
3Per-resource webhook routing expression (JSONata that decides whether an inbound webhook should be delivered to this resource).
curl -X PATCH 'https://api.truto.one/unified-model/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "user-directory",
"category": "communication",
"description": "This model provides a user directory interface for various HRIS integrations.",
"resources": {},
"team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
"version": 3,
"docs": {},
"scopes": {},
"webhooks": {}
}'const body = {
"name": "user-directory",
"category": "communication",
"description": "This model provides a user directory interface for various HRIS integrations.",
"resources": {},
"team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
"version": 3,
"docs": {},
"scopes": {},
"webhooks": {}
};
const response = await fetch('https://api.truto.one/unified-model/{id}', {
method: 'PATCH',
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/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"name": "user-directory",
"category": "communication",
"description": "This model provides a user directory interface for various HRIS integrations.",
"resources": {},
"team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
"version": 3,
"docs": {},
"scopes": {},
"webhooks": {}
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())import Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const body = {
"name": "user-directory",
"category": "communication",
"description": "This model provides a user directory interface for various HRIS integrations.",
"resources": {},
"team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
"version": 3,
"docs": {},
"scopes": {},
"webhooks": {}
};
const result = await truto.unifiedModel.update('<id>', body);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
body = {
"name": "user-directory",
"category": "communication",
"description": "This model provides a user directory interface for various HRIS integrations.",
"resources": {},
"team_id": "05daecaf-4365-42e8-8370-8127de5dd717",
"version": 3,
"docs": {},
"scopes": {},
"webhooks": {}
}
result = await truto_api.unified_models.update("<id>", body)
print(result)
asyncio.run(main())