For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • API Reference
      • GETGet Enrichment Source
      • POSTEnrichment Fields
      • POSTPreview Model
      • GETList Models
      • POSTCreate Model
      • GETGet Model
      • PUTUpdate Model
      • DELDelete Model
      • GETSample Records
Logo
Log inBook a demo
API ReferenceModels

Update Model

PUT
https://app.polytomic.com/api/models/:id
PUT
/api/models/:id
$curl -X PUT https://app.polytomic.com/api/models/248df4b7-aa70-47b8-a036-33ac447e668d \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "configuration": {
> "table": "public.users"
> },
> "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
> "name": "Users"
>}'
1{
2 "data": {
3 "configuration": {
4 "table": "public.contacts"
5 },
6 "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
7 "created_at": "2024-01-15T09:30:00Z",
8 "created_by": {
9 "id": "12345678-1234-1234-1234-123456789012",
10 "name": "John Doe",
11 "type": "user"
12 },
13 "enricher": {
14 "configuration": {},
15 "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
16 "enricher_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
17 "fields": [
18 {
19 "name": "phone_number"
20 }
21 ],
22 "mappings": {}
23 },
24 "fields": [
25 {
26 "created_at": "2024-01-15T09:30:00Z",
27 "created_by": {
28 "id": "12345678-1234-1234-1234-123456789012",
29 "name": "John Doe",
30 "type": "user"
31 },
32 "description": "Unique identifier",
33 "example": null,
34 "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
35 "label": "ID",
36 "name": "id",
37 "remote_type": "string",
38 "type": "string",
39 "unique": true,
40 "updated_at": "2024-01-15T09:30:00Z",
41 "user_added": false
42 }
43 ],
44 "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
45 "identifier": "id",
46 "labels": [
47 {}
48 ],
49 "name": "Contacts",
50 "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
51 "policies": [
52 "248df4b7-aa70-47b8-a036-33ac447e668d"
53 ],
54 "relations": [
55 {
56 "from": "id",
57 "to": {
58 "field": "user_id",
59 "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
60 }
61 }
62 ],
63 "tracking_columns": [
64 "string"
65 ],
66 "type": "postgresql",
67 "updated_at": "2024-01-15T09:30:00Z",
68 "updated_by": {
69 "id": "12345678-1234-1234-1234-123456789012",
70 "name": "John Doe",
71 "type": "user"
72 },
73 "version": 1
74 },
75 "job": {
76 "error": "error message",
77 "job_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
78 "result": null,
79 "status": "created",
80 "type": "createmodel"
81 }
82}
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. To make a partial change, fetch the current model with [`GET /api/models/{id}`](../../../api-reference/models/get), 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.
Was this page helpful?
Previous

Delete Model

Next

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.

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.

Authentication

AuthorizationBearer
Bearer user API key
OR
AuthorizationBasic

Basic organization-scoped API key

Path parameters

idstringRequiredformat: "uuid"

Headers

X-Polytomic-VersionstringOptional

Query parameters

asyncbooleanOptional

Request

This endpoint expects an object.
configurationmap from strings to anyRequired
connection_idstringRequiredformat: "uuid"
namestringRequired
additional_fieldslist of objects or nullOptional
enricherobjectOptional
fieldslist of strings or nullOptional
identifierstringOptional
labelslist of strings or nullOptional
organization_idstring or nullOptionalformat: "uuid"
policieslist of strings or nullOptional
refreshbooleanOptional
relationslist of objects or nullOptional
tracking_columnslist of strings or nullOptional

Response

OK
dataobject
jobobject

Errors

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