---
title: Create Custom Field
slug: create-custom-field
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "X4YiscjNu4pqAf0LzagYN",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/metadata/objects/{objectApiName}/fields:{type}",
    "servers": [
      {
        "url": "https://api.nue.io/metadata/objects/{objectApiName}/fields:{type}",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/metadata/objects/{objectApiName}/fields:{type}",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Create Custom Field",
    "description": "<p>Create a new field for a specific object. Currently, only 'text' type is supported.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "objectApiName",
          "type": "string",
          "description": "The API name of the object to create a field for"
        },
        {
          "kind": "required",
          "name": "type",
          "type": "string",
          "description": "<p>The type of field to create. Currently, only 'text' is supported.</p>",
          "enum": [
            "text"
          ]
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The request to create a field.",
          "customType": "CreateFieldRequest",
          "schema": [
            {
              "name": "apiName",
              "kind": "required",
              "type": "string",
              "description": "API name of the field",
              "example": "testCustomField"
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "Display name of the field",
              "example": "Test Custom Field"
            },
            {
              "name": "creatable",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field can be set during record creation",
              "example": true
            },
            {
              "name": "updatable",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field can be updated after record creation",
              "example": true
            },
            {
              "name": "filterable",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field can be used in filters",
              "example": true
            },
            {
              "name": "sortable",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field can be used for sorting",
              "example": true
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Description of the field",
              "example": "This is a new custom field"
            },
            {
              "name": "inlineHelpText",
              "kind": "optional",
              "type": "string",
              "description": "Help text displayed for the field",
              "example": "This is a new custom field"
            },
            {
              "name": "required",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field is required",
              "example": false
            },
            {
              "name": "unique",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the field must have a unique value",
              "example": false
            },
            {
              "name": "defaultValue",
              "kind": "optional",
              "type": "string",
              "description": "Default value for the field",
              "example": "abc"
            },
            {
              "name": "minLength",
              "kind": "optional",
              "type": "integer",
              "description": "Minimum length for text fields",
              "example": 0
            },
            {
              "name": "maxLength",
              "kind": "optional",
              "type": "integer",
              "description": "Maximum length for text fields",
              "example": 10
            }
          ],
          "modelRef": "#/components/schemas/CreateFieldRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "CreateFieldResponse",
            "schema": [
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/CreateFieldResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "UmakYsY5KJfExwimuAG7x",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/metadata/objects/{objectApiName}/fields:{type} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"apiName\": \"testCustomField\",\n     \"name\": \"Test Custom Field\"\n     }'"
        },
        {
          "id": "A0meiUHtYM7o6SsMKomM5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"apiName\": \"testCustomField\",\n   \"name\": \"Test Custom Field\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/metadata/objects/{objectApiName}/fields:{type}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "KmRUIpb8R8kz87wDnZG0F",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/metadata/objects/{objectApiName}/fields:{type}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"apiName\": \"testCustomField\",\n   \"name\": \"Test Custom Field\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "dFVF3eYBUnpBKXBZX62KT",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/metadata/objects/{objectApiName}/fields:{type}\"\n\npayload = json.dumps({\n   \"apiName\": \"testCustomField\",\n   \"name\": \"Test Custom Field\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "UmakYsY5KJfExwimuAG7x"
    },
    "results": {
      "languages": [
        {
          "id": "Q7VHVtxhj3vnpByw5nnA-",
          "language": "200",
          "code": "// OK\n{\n  \"name\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "Q7VHVtxhj3vnpByw5nnA-"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}