Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Create Model

POST/api/v2/models
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Creates a new Model with no versions.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:models-write.

Query parameters

preview
booleanoptional

Enables the use of preview functionality.

Request body

CreateModelRequest
object
Hide child attributes

Hide child attributes

name
string
parentFolderRid
string

The unique resource identifier (RID) of a Folder.

Response body

Model
object

The created Model

Hide child attributes

Hide child attributes

rid
string

The Resource Identifier (RID) of a Model.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/models?preview=true" \ -d '{"parentFolderRid":"ri.compass.main.folder.c410f510-2937-420e-8ea3-8c9bcb3c1791","name":"House Pricing Model"}'

Response

Copied!
1 2 3 { "rid": "ri.models.main.model.f351c142-0e4c-4b12-adc2-6e1539737ae9" }

Error responses

Error Name
ResourceNameAlreadyExistsError CodeCONFLICT
Status Code409
DescriptionThe provided resource name is already in use by another resource in the same folder.
ParametersparentFolderRid, displayName
InvalidDisplayNameError CodeINVALID_ARGUMENT
Status Code400
DescriptionThe display name of a Resource should not be exactly `.` or `..`, contain a forward slash `/` and must be less than or equal to 700 characters.
ParametersdisplayName
CreateModelPermissionDeniedError CodePERMISSION_DENIED
Status Code403
DescriptionCould not create the Model.
Parameters