Skip to content
PATCH /unified-model/{id}

Update an existing unified model. You can rename it, modify its category, or update resource definitions, etc. Only the root team and Truto's catalog publisher teams can change sharing to ask or allow; anyone else gets a 403. Sending back the stored sharing, or deny, is always allowed.

Path Parameters

idstring · uuid
required·

The ID of the unified model to update.

Example: 7c5c8cc2-e68e-4af8-84d1-4ceea1489338

Request Body

categorystring

The new category, if you want to change it.

Example: communication
change_messagestring

Why this change is being made. Optional, at most 2000 characters, recorded with the version this save creates (see GET /unified-model/{id}/versions). Not saved on the object.

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.

namestring

The new name of the unified model, if you want to rename it.

Example: user-directory
resourcesRecord<string, any>

Updated map of resource name → UnifiedModelResource.

scopesRecord<string, any>

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

sharingstring

Only the root team and Truto's catalog publisher teams can change it to ask or allow; anyone else gets a 403. Sending the stored value or deny is always allowed.

Possible values:
allowaskdeny
versionnumber

The current version of the unified model. Required to prevent version conflicts.

Example: 3
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
400Version mismatch or name conflict
403The request changes sharing to ask or allow, and the caller is not in the root team or a catalog publisher team
404Unified Model not found
truto unified-models update '<id>' \
  -b '{
  "change_message": "your_change_message",
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "version": 3,
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
}' \
  -o json
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const body = {
  "change_message": "your_change_message",
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "version": 3,
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
};

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 = {
        "change_message": "your_change_message",
        "name": "user-directory",
        "category": "communication",
        "description": "This model provides a user directory interface for various HRIS integrations.",
        "resources": {},
        "version": 3,
        "docs": {},
        "scopes": {},
        "webhooks": {},
        "sharing": "allow"
    }

    result = await truto_api.unified_models.update("<id>", body)
    print(result)

asyncio.run(main())
curl -X PATCH 'https://api.truto.one/unified-model/{id}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "change_message": "your_change_message",
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "version": 3,
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
}'
const body = {
  "change_message": "your_change_message",
  "name": "user-directory",
  "category": "communication",
  "description": "This model provides a user directory interface for various HRIS integrations.",
  "resources": {},
  "version": 3,
  "docs": {},
  "scopes": {},
  "webhooks": {},
  "sharing": "allow"
};

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 = {
    "change_message": "your_change_message",
    "name": "user-directory",
    "category": "communication",
    "description": "This model provides a user directory interface for various HRIS integrations.",
    "resources": {},
    "version": 3,
    "docs": {},
    "scopes": {},
    "webhooks": {},
    "sharing": "allow"
}

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