---
title: "Create an attribute definition"
method: POST
path: "/v1/objects/{slug}/attributes"
tags: ["Schema"]
---

# Create an attribute definition

`POST /v1/objects/{slug}/attributes`

## Request

- Base URL: `https://app.nex.ai/api/developers`
- URL: `https://app.nex.ai/api/developers/v1/objects/{slug}/attributes`
- Auth: API key in header `Authorization`

Creates a new attribute definition on an object type

## Path parameters

- `slug` string, required

## Request body

- DeveloperCreateAttributeDefinitionRequest
  - `name` string, required: Display name
  - `slug` string, required: URL-safe identifier
  - `type` 'text' | 'number' | 'email' | 'phone' | 'url' | 'date' | 'boolean' | 'currency' | 'location' | 'select' | 'social_profile' | 'domain' | 'full_name', required: Attribute value type
  - `description` string: Description
  - `options` DeveloperCreateAttributeOptionsRequest
    - `is_required` boolean: Field is required
    - `is_unique` boolean: Value must be unique
    - `is_multi_value` boolean: Allow multiple values
    - `use_raw_format` boolean: Store raw format (numbers)
    - `is_whole_number` boolean: Number must be integer
    - `select_options` DeveloperCreateSelectOptionRequest[]: Predefined choices for select fields
      - `id` string: Option ID (optional on create, auto-generated if omitted)
      - `name` string, required: Option display label

## Response `200`

Created attribute definition

- DeveloperAttributeDefinitionResponse
  - `description` string
  - `id` string
  - `name` string
  - `options` DeveloperAttributeOptionsResponse
    - `is_multi_value` boolean
    - `is_required` boolean
    - `is_unique` boolean
    - `is_whole_number` boolean
    - `select_options` DeveloperSelectOptionResponse[]
      - `id` string
      - `name` string
    - `use_raw_format` boolean
  - `slug` string
  - `type` string

## Other responses

- `400`: Bad request - Invalid data
- `401`: Unauthorized - Invalid or missing API key
- `404`: Object not found
- `500`: Internal server error

## Changes

- **2026-02-17** `b05d8cb8cf43`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nex/apis/nex-developer-api/changes/v1/objects/:slug/attributes/post.md)

---

[API](https://skmtc.dev/nex/apis/nex-developer-api.md) - [All operations](https://skmtc.dev/nex/apis/nex-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nex/apis/nex-developer-api/revisions/51003af13108?raw)
