## Import a collection type `POST https://getkollek.com/api/collection-types/import` Rebuild a collection type from a JSON document, in the exact shape the export endpoint hands out. This creates a new type with its groups and fields. It never updates an existing one, so importing the same document twice gives you two types. The document is sent as a string in the json parameter, not as a nested object. A document that is not valid JSON, that is missing the type key, or that names a field type the app does not know is rejected with a 422 response. **Permissions:** Owners and editors. Viewers get a 404 response. ### Body parameters - `json` (string, required): The exported document, as a JSON encoded string. Maximum 100000 characters. **Returns:** The created collection_type object. ### Example request ```bash curl https://getkollek.com/api/collection-types/import \ -X POST \ -H "Authorization: Bearer $API_KEY" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "json": "{\"schemaVersion\":1,\"type\":{\"name\":\"Comics\",\"color\":\"#fb923c\",\"groups\":[],\"standaloneFields\":[]}}" }' ``` ### Example response `Status: 201` ```json { "data": { "type": "collection_type", "id": "1", "attributes": { "name": "Comics", "color": "#fb923c", "created_at": 1752537600, "updated_at": 1752537600 }, "links": { "self": "https://getkollek.com/api/collection-types/1" } } } ```