> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a custom field definition

> Creates a custom field definition. Once created, `key`, `value_type`, and `object_type` are immutable. Values are set on the parent record — `custom_field_values` on assets, `field_values` on projects.



## OpenAPI

````yaml POST /custom_field_definitions
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /custom_field_definitions:
    post:
      summary: Create a custom field definition
      description: >-
        Creates a custom field definition. Once created, `key`, `value_type`,
        and `object_type` are immutable. Values are set on the parent record —
        `custom_field_values` on assets, `field_values` on projects.
      operationId: create-custom-field-definition
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                custom_field_definition:
                  type: object
                  required:
                    - label
                    - value_type
                  properties:
                    label:
                      type: string
                      description: >-
                        Human-readable label. Must be unique per account and
                        object_type.
                    value_type:
                      type: string
                      enum:
                        - string
                        - number
                        - boolean
                        - date
                        - enum
                        - url
                    object_type:
                      type: string
                      enum:
                        - project
                        - asset
                      default: project
                      description: The record type this field applies to
                    key:
                      type: string
                      description: >-
                        Stable identifier used in custom field value maps.
                        Auto-generated from label if omitted. Must match
                        ^[a-z][a-z0-9_]*$, max 64 characters.
                    enumeration_options:
                      type: array
                      items:
                        type: string
                      description: Allowed values. Required when value_type is "enum".
                    is_required:
                      type: boolean
                      default: false
                    order:
                      type: integer
                      description: Display order
                    project_id:
                      type: string
                      description: >-
                        Project friendly ID to scope this definition to a single
                        project. Omit for account-wide.
            examples:
              Request Example:
                value:
                  custom_field_definition:
                    label: Status
                    value_type: enum
                    object_type: asset
                    enumeration_options:
                      - Unregistered
                      - Registered
                      - Inactive
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 43
                    friendly_id: cfd_def456abc123
                    key: status
                    label: Status
                    object_type: asset
                    value_type: enum
                    enumeration_options:
                      - Unregistered
                      - Registered
                      - Inactive
                    order: 2
                    is_required: false
                    project_id: null
                    created_at: '2026-01-15T10:00:00.000Z'
                    updated_at: '2026-01-15T10:00:00.000Z'
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: error
                    statusCode: 422
                    errors:
                      - message: Label has already been taken
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````