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

# Create a custom property definition



## OpenAPI

````yaml https://api.meteroid.com/api-docs/openapi.json post /api/v1/custom-property-definitions
openapi: 3.1.0
info:
  title: meteroid
  description: ''
  license:
    name: LicenseRef-Proprietary
    identifier: LicenseRef-Proprietary
  version: 0.1.0
servers: []
security: []
tags:
  - name: Meteroid
    description: Meteroid API
  - name: Add-ons
  - name: Batch Jobs
  - name: Checkout Sessions
  - name: Connect
    description: Manage connected accounts (Express & Standard)
  - name: Coupons
  - name: Credit Notes
  - name: Custom Properties
  - name: Customers
  - name: Entitlements
  - name: Events
  - name: Features
  - name: Invoices
  - name: Metrics
  - name: OAuth
    description: OAuth 2.0 token endpoints (public, client-credentials auth)
  - name: OAuth Apps
    description: Manage OAuth applications for Connect integrations
  - name: Plans
  - name: Product Families
  - name: Products
  - name: Subscriptions
  - name: Usage
paths:
  /api/v1/custom-property-definitions:
    post:
      tags:
        - Custom Properties
      summary: Create a custom property definition
      operationId: create_definition
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomPropertyDefinitionCreateRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomPropertyDefinition'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '409':
          description: A definition with this key already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    CustomPropertyDefinitionCreateRequest:
      type: object
      required:
        - entity_type
        - key
        - name
        - property_type
      properties:
        config:
          $ref: '#/components/schemas/PropertyConfig'
        default_value: {}
        description:
          type:
            - string
            - 'null'
        display_order:
          type: integer
          format: int32
        entity_type:
          $ref: '#/components/schemas/CustomPropertyEntityType'
        key:
          type: string
          description: >-
            Immutable machine name; letters, digits and underscores only. Unique
            per entity type.
        name:
          type: string
        property_type:
          $ref: '#/components/schemas/CustomPropertyType'
        required:
          type: boolean
    CustomPropertyDefinition:
      type: object
      required:
        - id
        - entity_type
        - key
        - name
        - property_type
        - config
        - required
        - display_order
        - archived
      properties:
        archived:
          type: boolean
        config:
          $ref: '#/components/schemas/PropertyConfig'
        default_value: {}
        description:
          type:
            - string
            - 'null'
        display_order:
          type: integer
          format: int32
        entity_type:
          $ref: '#/components/schemas/CustomPropertyEntityType'
        id:
          $ref: '#/components/schemas/CustomPropertyDefinitionId'
        key:
          type: string
        name:
          type: string
        property_type:
          $ref: '#/components/schemas/CustomPropertyType'
        required:
          type: boolean
    RestErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    PropertyConfig:
      type: object
      description: >-
        Type-specific configuration. Only the fields relevant to `property_type`
        are interpreted.
      properties:
        max:
          type:
            - number
            - 'null'
          format: double
        max_length:
          type:
            - integer
            - 'null'
          format: int32
          description: Maximum length for `TEXT`.
          minimum: 0
        min:
          type:
            - number
            - 'null'
          format: double
          description: Inclusive numeric bounds for `NUMBER`.
        options:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/SelectOption'
          description: Allowed choices for `SINGLE_SELECT` / `MULTI_SELECT`.
    CustomPropertyEntityType:
      type: string
      enum:
        - CUSTOMER
        - SUBSCRIPTION
        - INVOICE
        - CREDIT_NOTE
    CustomPropertyType:
      type: string
      enum:
        - TEXT
        - NUMBER
        - BOOLEAN
        - DATE
        - DATETIME
        - SINGLE_SELECT
        - MULTI_SELECT
        - JSON
        - URL
        - EMAIL
    CustomPropertyDefinitionId:
      type: string
      format: MeteroidId
      examples:
        - cpd_7n42DGM5Tflk9n8mt7Fhc7
    ErrorCode:
      type: string
      enum:
        - BAD_REQUEST
        - NOT_FOUND
        - CONFLICT
        - FORBIDDEN
        - UNAUTHORIZED
        - TOO_MANY_REQUESTS
        - INTERNAL_SERVER_ERROR
    SelectOption:
      type: object
      required:
        - value
      properties:
        label:
          type:
            - string
            - 'null'
        value:
          type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````