Skip to navigation

Update Model

Updates a model’s configuration.

Updating a model is a full replacement of its configuration. Every field in the request body is written to the model; any field you omit is cleared or reset to its default value, with two exceptions: an empty or omitted policies list leaves policies unchanged, and omitted field_overrides entries retain their current types.

To make a partial change, fetch the current model with GET /api/models/{id}, modify the fields you want to change, and send the complete object back in the update request.

Changes to source fields, filters, or the identity column take effect on the next sync execution that uses this model.

Field type overrides

Use field_overrides to choose types for detected source fields on CSV file, HTTP API, Google Sheets, and MongoDB models. Other model types reject overrides. Keep additional_fields for user-defined fields.

For example, include this fragment in a complete model request to treat amount as a number:

{
"field_overrides": {
"amount": { "type": "number" }
}
}

Use fields separately to choose which fields to publish. The response’s fields[].type contains each published field’s effective type.

On update, only supplied override entries change types. Omitted entries, an empty map, or null preserve current types, including types chosen in the UI. Removing an entry does not restore its inferred type; supply another concrete type to change it. There is no separate inferred-type or override-state map in the response.

Authentication

AuthorizationBearer
Bearer user API key
OR
AuthorizationBasic

Basic organization-scoped API key

Path parameters

idstringRequiredformat: "uuid"
Model ID

Headers

X-Polytomic-VersionstringOptional

Query parameters

asyncbooleanOptional
Run in the background and return a job instead of the result.

Request

This endpoint expects an object.
configurationmap from strings to anyRequired
Model configuration for the source connection type
connection_idstringRequiredformat: "uuid"
Connection ID of the model's source, which cannot be changed after the model is created
namestringRequired
Model name
additional_fieldslist of objects or nullOptional

User-defined fields to add to the model alongside its source fields

enricherobjectOptional
Enrichment to apply to the model
field_overridesmap from strings to objects or nullOptional

Type updates keyed by exact source field name, for models that support type selection. Applies only to detected source fields and does not publish them. Omitted entries retain their current types; an empty or omitted map leaves all types unchanged.

fieldslist of strings or nullOptional

Technical/source field names to publish in the model. Use source names, not model-field UUIDs or display labels. For example, use dealname rather than Deal Name. Omit or pass an empty array to publish all standard source fields.

identifierstringOptional
Source field name of the model's unique identifier
organization_idstring or nullOptionalformat: "uuid"

Ignored for user and organization-scoped API keys, which always act in their own organization

policieslist of strings or nullOptional

Permissions policy IDs applied to the model. On update, a non-empty list replaces the model’s policies and an empty or omitted list leaves them unchanged.

refreshbooleanOptional
Whether to refresh the enricher's fields and example values
relationslist of objects or nullOptional
Joins from this model's fields to fields on other models
tracking_columnslist of strings or nullOptional
Source field names used to detect changed records
labelslist of strings or nullOptionalDeprecated

Deprecated; ignored

Response

OK
dataobjectOptional
The model
jobobjectOptional
Background job running the request when async is true

Errors

400
Bad Request Error
404
Not Found Error
500
Internal Server Error