> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://apidocs.polytomic.com/2024-02-08/api-reference/models/list/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server. # List Models GET https://app.polytomic.com/api/models Lists all models in the caller's organization. Results are ordered by `updated_at` descending, with `id` used as a tiebreaker. If more results are available, the response includes `pagination.next_page_token`. Pass that token back unchanged to continue from the last item you received. The token is opaque. Do not construct or edit it yourself. The `limit` is capped at 50. Values above that cap are reduced to 50, and non-positive values fall back to the same default. Reference: https://apidocs.polytomic.com/api-reference/models/list ## Authentication - `Authorization` header (basic auth, required) — This is the Polytomic deployment key (on-premises only) - `Authorization` header (bearer token, required) — This is the Polytomic API key ## Response ### 200 OK - `data` (list of V2ModelResponse, optional, nullable) ## Errors ### 401 Unauthorized Error Unauthorized - `code` (integer, optional) — Application-specific error code. - `context` (map from string to any, optional) — Application context. - `error` (string, optional) — Error message. - `status` (string, optional) — Status text. ### 404 Not Found Error Not Found - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ## Types ### V2ModelResponse - `configuration` (map from string to any, optional) - `connection_id` (string, optional) - `created_at` (string, optional) - `created_by` (OutputActor, optional) - `enricher` (V2Enrichment, optional) - `fields` (list of V2ModelField, optional) - `id` (string, optional) - `identifier` (string, optional) - `labels` (list of LabelLabel, optional) - `name` (string, optional) - `organization_id` (string, optional) - `policies` (list of string, optional) - `relations` (list of V2Relation, optional) - `tracking_columns` (list of string, optional) - `type` (string, optional) - `updated_at` (string, optional) - `updated_by` (OutputActor, optional) - `version` (integer, optional) ### OutputActor - `id` (string, optional) - `name` (string, optional) - `type` (string, optional) ### V2Enrichment - `configuration` (map from string to any, optional) — Similar to a model configuration, this configures the enricher. For example, if you wanted to use Apollo to enrich people, you would send `{"object": "people"}` as the configuration. Each enricher configuration can be found in the connection configuration docs. - `connection_id` (string, optional) - `enricher_id` (string, optional) — Must be provided to update an existing enrichment - `fields` (list of V2ModelField, optional) — If not provided, all fields will be enabled. - `mappings` (map from string to string, optional) — A map of parent model Source Name to child model Source Name. For example, if your model has a field called `work_email` and the enricher accepts a field called `email`, you'd send a map of `{"work_email":"email"}`. The set of required input mappings varies based on the configuration of the enrichment. You can use the `enrichment/{connection_id}/inputfields` API to discover available input field combinations for a given configuration. ### V2ModelField - `created_at` (string, optional) - `created_by` (OutputActor, optional) - `description` (string, optional) - `example` (any, optional) - `id` (string, optional) - `label` (string, optional) - `name` (string, optional) - `remote_type` (string, optional) - `type` (string, optional) - `unique` (boolean, optional) - `updated_at` (string, optional) - `user_added` (boolean, optional) ### LabelLabel ### V2Relation - `from` (string, optional) - `to` (V2RelationTo, optional) ### V2RelationTo - `field` (string, optional) - `model_id` (string, optional) ## Examples **Response** ```json { "data": [ { "configuration": { "table": "public.contacts" }, "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "created_at": "2024-01-15T09:30:00Z", "created_by": { "id": "12345678-1234-1234-1234-123456789012", "name": "John Doe", "type": "user" }, "enricher": { "configuration": {}, "connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "enricher_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "fields": [ { "name": "phone_number" } ], "mappings": {} }, "fields": [ { "created_at": "2024-01-15T09:30:00Z", "created_by": { "id": "12345678-1234-1234-1234-123456789012", "name": "John Doe", "type": "user" }, "description": "Unique identifier", "example": null, "id": "248df4b7-aa70-47b8-a036-33ac447e668d", "label": "ID", "name": "id", "remote_type": "string", "type": "string", "unique": true, "updated_at": "2024-01-15T09:30:00Z", "user_added": false } ], "id": "248df4b7-aa70-47b8-a036-33ac447e668d", "identifier": "id", "labels": [ {} ], "name": "Contacts", "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d", "policies": [ "248df4b7-aa70-47b8-a036-33ac447e668d" ], "relations": [ { "from": "id", "to": { "field": "user_id", "model_id": "248df4b7-aa70-47b8-a036-33ac447e668d" } } ], "tracking_columns": [ "string" ], "type": "postgresql", "updated_at": "2024-01-15T09:30:00Z", "updated_by": { "id": "12345678-1234-1234-1234-123456789012", "name": "John Doe", "type": "user" }, "version": 1 } ] } ``` **SDK Code** ```python import requests url = "https://app.polytomic.com/api/models" headers = { "X-Polytomic-Version": "X-Polytomic-Version" } response = requests.get(url, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://app.polytomic.com/api/models'; const credentials = btoa(":"); const options = { method: 'GET', headers: { 'X-Polytomic-Version': 'X-Polytomic-Version', Authorization: `Basic ${credentials}` } }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://app.polytomic.com/api/models" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("X-Polytomic-Version", "X-Polytomic-Version") req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.polytomic.com/api/models") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["X-Polytomic-Version"] = 'X-Polytomic-Version' request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://app.polytomic.com/api/models") .header("X-Polytomic-Version", "X-Polytomic-Version") .basicAuth("", "") .asString(); ``` ```php request('GET', 'https://app.polytomic.com/api/models', [ 'headers' => [ 'X-Polytomic-Version' => 'X-Polytomic-Version', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://app.polytomic.com/api/models"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); request.AddHeader("X-Polytomic-Version", "X-Polytomic-Version"); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = [ "X-Polytomic-Version": "X-Polytomic-Version", "Authorization": "Basic \(credentials)" ] let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/models")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```