---
title: "Create object"
method: POST
path: "/crm/objects"
tags: ["crm"]
---

# Create object

`POST /crm/objects`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/crm/objects`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Create a CRM object.

## Request body

- object
  - `name` string, required: Object name (lowercased, singular).
  - `description` string
  - `defaultView` 'table' | 'kanban' | 'calendar' | 'timeline' | 'gallery' | 'list': Default view rendered for the object.
  - `icon` string: Hugeicons (or legacy Lucide) icon name, e.g. user-multiple, target-01.
  - `fields` object[]: Fields to add after the built-in Notes, in column order. The object and its fields are created in one transaction: if any field is rejected, nothing is created.
    - `name` string, required
    - `type` 'text' | 'email' | 'phone' | 'url' | 'number' | 'boolean' | 'date' | 'richtext' | 'file' | 'user' | 'enum' | 'relation' | 'tags' | 'action': Defaults to text.
    - `required` boolean
    - `defaultValue` string
    - `relatedObjectName` string: Target object for `relation` fields.
    - `relationshipType` 'many_to_one' | 'many_to_many': Relation cardinality for a `relation` field.
    - `enumValues` string[]: Options for `enum` fields.
    - `enumColors` string[]: Hex colors aligned to enumValues.
    - `enumMultiple` boolean: Allow multi-select enum.
    - `description` string
    - `indexed` boolean: Index for filter/search/sort.

## Response `200`

Successful response

- object
  - `id` string, required
  - `fields` object[]: The fields created from `fields`, in order.
    - `id` string, required
    - `name` string, required
  - `references` union[]
    - union
      - object
        - `kind` 'crm-entry', required
        - `objectName` string, required
        - `entryId` string, required
        - `label` string, required
        - `href` string, required
        - `url` string
        - `imageUrl` string
        - `objectIcon` string
      - object
        - `kind` 'crm-object', required
        - `objectName` string, required
        - `label` string, required
        - `href` string, required
        - `url` string
        - `imageUrl` string
        - `objectIcon` string
      - object
        - `kind` 'campaign', required
        - `sequenceId` string, required
        - `label` string, required
        - `href` string, required
        - `url` string
        - `imageUrl` string
        - `objectIcon` string
  - `referenceCoverage` object
    - `returned` integer, required
    - `available` integer, required
    - `truncated` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
