Create a model with fields?

Is it possible to create a new model via the REST API, and at the same time, define the multiple fields it should have?

What Iโ€™m trying to do is convert a block to a model. I can retrieve the block and get its fields, like:

"data": [
                    {
                        "id": "7149005",
                        "type": "field"
                    },
                    {
                        "id": "7149007",
                        "type": "field"
                    },
                   (etc.
 ]

But the same data format canโ€™t be used to create a new model with the fields intact. The API rejects it:

โ€œ#/data/relationships: failed schema #/definitions/item_type/links/1/schema/properties/data/properties/relationships: "fields" is not a permitted key.โ€,

Is the only way to programmatically add fields to a new model looping through them one at a time, waiting for the job response each time? There isnโ€™t a way to define a model and fields in one request?

Thanks!

1 Like

Hello @roger

The only way to define fields for now is one per request, we currently donโ€™t have a way to create fields in a bulk, unfortunately.
So the looping you mentioned is indeed the only possible way to do it at the moment.
But it would be a very good feature request, as i can see it is a much more intuitive and simple way of defining a model

Best,

Got it, thanks! Made a feature request.

1 Like