Skip to content
POST /unified-model

Create a new unified model for your team. This defines a collection of resources and mappings that can be used across multiple integrations. The model belongs to your team. A new unified model is stored with sharing set to deny, unless the caller is in the root team or one of Truto's catalog publisher teams.

Request Body

categorystring

The category of the unified model.

Example: communication
descriptionstring

A brief description of what this unified model represents.

Example: This model provides a user directory interface for various HRIS integrations.
docsRecord<string, any>

Per-resource documentation (pricing_plan, user_role, scopes, instructions).

namestring

The name of the unified model.

Example: user-directory
resourcesRecord<string, any>

Map of resource name → UnifiedModelResource.

scopesRecord<string, any>

Per-resource OAuth/permission scopes required to call its methods.

sharingstring

Who can install it. Only the root team and Truto's catalog publisher teams can store ask or allow; for anyone else it is stored as deny.

Possible values:
allowaskdeny
webhooksRecord<string, any>

Per-resource webhook routing expression (JSONata).

Response Body

categorystring

The category of the unified model.

Example: hris
created_atstring · date-time

The date and time when the unified model was created.

Example: 2021-08-10T10:00:00.000Z
descriptionstring

A brief description of what this unified model represents.

Example: This model provides a user directory interface for various HRIS integrations.
docsRecord<string, any>

Per-resource documentation (pricing plan / scopes / instructions).

idstring · uuid

The ID of the unified model.

Example: 7c5c8cc2-e68e-4af8-84d1-4ceea1489338
installed_environmentstring[]

A list of environment IDs where this unified model is installed.

namestring

The name of the unified model.

Example: user-directory
resourcesRecord<string, any>

Map of resource name (e.g. users, contacts) → resource definition (UnifiedModelResource).

Example:
{
  "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"
        }
      }
    }
  }
}
scopesRecord<string, any>

Per-resource OAuth/permission scopes required to call its methods.

sharingstring

The sharing policy of the unified model.

Example: deny
Possible values:
allowaskdeny
teamobject
allow_impersonationboolean

Whether the team allows impersonation.

Example: false
created_atstring · date-time

The date and time when the team was created.

Example: 2021-08-10T10:00:00.000Z
domainstring

The domain of the team.

Example: example.com
idstring · uuid

The ID of the team.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
is_verifiedboolean

Whether the team is verified or not.

Example: true
is_white_labelboolean

Whether the team is white-labeled or not.

Example: false
logostring

The URL of the team's logo.

Example: https://example.com/logo.png
namestring

The name of the team.

Example: My Awesome Team
tos_linkstring

A link to the team's Terms of Service, if available.

Example: https://example.com/tos
updated_atstring · date-time

The date and time when the team was last updated.

Example: 2021-08-10T10:00:00.000Z
team_idstring · uuid

The ID of the team that owns this unified model.

Example: 05daecaf-4365-42e8-8370-8127de5dd717
updated_atstring · date-time

The date and time when the unified model was last updated.

Example: 2021-08-10T10:30:00.000Z
versionnumber

The current version of the unified model.

Example: 3
webhooksRecord<string, any>

Per-resource webhook routing expression (JSONata that decides whether an inbound webhook should be delivered to this resource).

Errors

StatusDescription
400name or description is missing or blank, or the body is invalid.
truto unified-models create \
  -b '{
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
}' \
  -o 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": {},
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
};

const result = await truto.unifiedModel.create(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": {},
        "docs": {},
        "scopes": {},
        "webhooks": {},
        "sharing": "allow"
    }

    result = await truto_api.unified_models.create(body)
    print(result)

asyncio.run(main())
curl -X POST 'https://api.truto.one/unified-model' \
  -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": {},
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
}'
const body = {
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
};

const response = await fetch('https://api.truto.one/unified-model', {
  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"
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": {},
    "docs": {},
    "scopes": {},
    "webhooks": {},
    "sharing": "allow"
}

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