---
title: "Create an Object type"
method: POST
path: "/buckets/{slug}/object-types"
tags: ["Object types"]
---

# Create an Object type

`POST /buckets/{slug}/object-types`

Create a new Object type, defining the content model that its Objects will follow. Only `title` is required; the `slug` is derived from the title when omitted. Define `metafields` here so that Objects created in this type can carry the corresponding `metadata` values.

## Request body

- ObjectTypeCreate
  - `title` string, required
  - `singular` string
  - `slug` string — Derived from `title` when omitted.
  - `singleton` boolean
  - `emoji` string
  - `metafields` Metafield[]
    - `id` string — Assigned by Cosmic. Omit when creating.
    - `title` string, required — Label shown to editors in the dashboard.
    - `key` string, required — The key used in an Object's `metadata`.
    - `type` string, required — The Metafield type. See the Metafields documentation for the full list and the value shape each one expects.
    - `value` unknown
    - `helptext` string — Guidance shown to editors beneath the field.
    - `required` boolean — Whether Objects in this type must supply a value.
    - `media_validation_type` string — Restricts uploads for File Metafields.
    - `repeater_fields` Metafield[] — Child Metafields, for `repeater` types.
    - `options` object[] — Choices for select, radio, and checkbox types.
  - `options` object
  - `localization` boolean
  - `locales` string[]
  - `priority_locale` string

## Response `200`

The created Object type.

- ObjectTypeResponse
  - `object_type` ObjectType, required — The content model shared by every Object in the type.
    - `id` string
    - `title` string
    - `singular` string — Singular label, used in dashboard copy such as "New Bike".
    - `slug` string — Unique within the Bucket. This is the value you pass as `type` when querying Objects.
    - `singleton` boolean — Whether the type holds exactly one Object, as for a home page.
    - `emoji` string — Unicode emoji shown beside the type in the dashboard.
    - `metafields` Metafield[]
      - `id` string — Assigned by Cosmic. Omit when creating.
      - `title` string, required — Label shown to editors in the dashboard.
      - `key` string, required — The key used in an Object's `metadata`.
      - `type` string, required — The Metafield type. See the Metafields documentation for the full list and the value shape each one expects.
      - `value` unknown
      - `helptext` string — Guidance shown to editors beneath the field.
      - `required` boolean — Whether Objects in this type must supply a value.
      - `media_validation_type` string — Restricts uploads for File Metafields.
      - `repeater_fields` Metafield[] — Child Metafields, for `repeater` types.
      - `options` object[] — Choices for select, radio, and checkbox types.
    - `options` object
      - `slug_field` boolean — Whether editors can see and edit the slug field.
    - `localization` boolean — Whether Objects in this type can exist in multiple locales.
    - `locales` string[] — Locale codes available in this type.
    - `priority_locale` string, nullable — Default locale for new Objects in this type.
    - `created_at` string, date-time
    - `modified_at` string, date-time

## Other responses

- `400` — The request was invalid, most often a malformed `query` or a Metafield value that failed validation.
- `401` — The access key is missing or incorrect.
- `402` — The Bucket needs to be upgraded before it can be used again.
- `404` — The addressed resource does not exist in this Bucket. Note that this covers a resource missing from a route that exists; an unrecognized route answers 200 with a `Route not found` body instead, as described in the API description above.
- `429` — Too many requests hit the API too quickly. Back off and retry.
- `500` — Something went wrong on the Cosmic side.

---

[API](https://skmtc.dev/cosmicjs/apis/cosmic-rest-api-v3.md) · [All operations](https://skmtc.dev/cosmicjs/apis/cosmic-rest-api-v3/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cosmicjs/cosmic-rest-api-v3/revisions/e0aa2a0913b3/schema)
