Models

Create Model

POST

Query parameters

asyncbooleanOptional

Request

This endpoint expects an object.
configuration
map from strings to anyRequired
connection_id
stringRequired
name
stringRequired
additional_fields
list of objectsOptional
enricher
objectOptional
fields
list of stringsOptional
identifier
stringOptional
labels
list of stringsOptional
organization_id
stringOptional
policies
list of stringsOptional
relations
list of objectsOptional
tracking_columns
list of stringsOptional

Response

This endpoint returns an object
data
objectOptional
job
objectOptional

Errors

POST
1curl -X POST https://app.polytomic.com/api/models \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "configuration": {
6 "table": "public.users"
7 },
8 "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
9 "name": "Users"
10}'
1{
2 "data": {
3 "configuration": {
4 "table": "public.contacts"
5 },
6 "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
7 "enricher": {
8 "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
9 "enricher_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
10 "fields": [
11 {
12 "description": "Unique identifier",
13 "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
14 "label": "ID",
15 "name": "phone_number",
16 "remote_type": "string",
17 "type": "string",
18 "unique": true,
19 "user_added": false
20 }
21 ],
22 "mappings": {
23 "mappings": "mappings"
24 }
25 },
26 "fields": [
27 {
28 "description": "Unique identifier",
29 "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
30 "label": "ID",
31 "name": "id",
32 "remote_type": "string",
33 "type": "string",
34 "unique": true,
35 "user_added": false
36 }
37 ],
38 "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
39 "identifier": "id",
40 "labels": [
41 {}
42 ],
43 "name": "Contacts",
44 "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
45 "policies": [
46 "248df4b7-aa70-47b8-a036-33ac447e668d"
47 ],
48 "relations": [
49 {
50 "from": "id"
51 }
52 ],
53 "tracking_columns": [
54 "tracking_columns"
55 ],
56 "type": "postgresql",
57 "version": 1
58 },
59 "job": {
60 "error": "error message",
61 "job_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
62 "result": {
63 "key": "value"
64 },
65 "status": "running",
66 "type": "createmodel"
67 }
68}