Create a new model

post/models

Request

  • Base URL
    https://api.hightouch.com/api/v1
  • Auth
    HTTP bearer

Query parameters

skipColumnQueryboolean

Request body

namestring required

The name of the model

slugstring required

The slug of the model

queryTypestring required

The type of the query. Available options: custom, raw_sql, tabel, dbt and visual.

sourceIdnumber double required

The id of the source that model is connected to

isSchemaboolean required

If is_schema is true, the model is just used to build other models. Either as part of visual querying, or as the root of a visual query.

folderIdstring
spaceIdstring

The Space this audience belongs to. Applies only to workspaces with Spaces enabled; contact Hightouch to enable Spaces and to obtain Space ids. Only valid when queryType is "visual". Omitted for models that are not in a Space. An API key scoped to a Space must set it on create. Read-only after creation.

rowLevelAccessRuleIdsstring[]

Row-level access rules attached to this audience. Applies only to workspaces with Spaces enabled. Only valid when queryType is "visual"; always present on an audience. When creating an audience in a Space, include one rule from each required row-level access group on the parent model. Rule ids come from the Spaces governance API. Read-only after creation.

primaryKeystring

The primary key will be null if the query doesn't get directly synced (e.g. a relationship table for visual querying). Optional here but actually conditionally required: every model except a general model must supply one.

isGeneralModelboolean

Create a general model: a model that exposes warehouse data to Hightouch AI agents instead of being synced. Takes no primaryKey and no folderId, and cannot be a schema model, and only supports certain query types.

descriptionstring

The description of the model. On a general model this is the context AI agents read to decide when to use it.

Response

Ok

OR
OR
'Internal Server Error' required

Changes

    • breaking

      the response property //// became nullable for the status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      added the required property //// to the response with the status

    • info

      added the required property //// to the response with the status

    • info

      added the required property //// to the response with the status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status