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
  • Getting started
    • Introduction
    • Obtaining API keys
    • Quickstart
    • Native clients
    • Concepts
    • Embedding authentication
    • Versioning
    • Idempotent requests
    • Events
  • Configuring your connections
    • CDC streaming from databases
  • Code examples
    • Bulk sync (ELT) from HubSpot to PostgreSQL
    • Bulk sync (ELT) from Salesforce to S3
    • Bulk sync (ELT) from Salesforce to Snowflake
    • Model sync (Reverse ETL) from MongoDB to Salesforce
  • API Reference
      • POSTEnrichment Fields
      • POSTPreview Model
      • GETList Models
      • POSTCreate Model
      • GETGet Model
      • DELDelete Model
      • PATCHUpdate Model
      • GETSample Records
Logo
Log inBook a demo
API ReferenceModels

Preview Model

POST
https://app.polytomic.com/api/model-preview
POST
/api/model-preview
$curl -X POST https://app.polytomic.com/api/model-preview \
> -H "X-Polytomic-Version: X-Polytomic-Version" \
> -H "Content-Type: application/json" \
> -u "<username>:<password>" \
> -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}
Submits a job that previews the fields a model would expose without persisting it. The response contains a job ID that resolves to the list of fields the model would expose. Poll the job until it completes to retrieve the field list. The model is not persisted — this endpoint is useful for validating a query or configuration before calling [`POST /api/models`](../../api-reference/models/create) to save it.
Was this page helpful?
Previous

List Models

Next

Submits a job that previews the fields a model would expose without persisting it.

The response contains a job ID that resolves to the list of fields the model would expose. Poll the job until it completes to retrieve the field list. The model is not persisted — this endpoint is useful for validating a query or configuration before calling POST /api/models to save it.

Authentication

AuthorizationBasic

This is the Polytomic deployment key (on-premises only)

OR
AuthorizationBearer
This is the Polytomic API key

Headers

X-Polytomic-VersionstringRequired

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
relationslist of objects or nullOptional
tracking_columnslist of strings or nullOptional

Response

OK
dataobject
jobobject

Errors

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