---
title: Create Object
slug: create-object
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "rbqPSMuPdsDOV2dulYSo7",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/api/objects/{objectName}",
    "servers": [
      {
        "url": "https://api.nue.io/api/objects/{objectName}",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/api/objects/{objectName}",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Create Object",
    "description": "<p>Create a new record in Salesforce. This is a generic, metadata-driven endpoint for creating objects.</p>\n<p><strong>Supported Objects:</strong> <code>Customer</code> is supported via this endpoint. For creating Opportunities, use the dedicated <a href=\"#tag/Objects/operation/createOpportunity\" target=\"_blank\">POST /cpq/opportunities</a> endpoint.</p>\n<p><strong>Important:</strong> This is a metadata-driven API. The fields available are determined by your Salesforce metadata configuration. The examples shown are common fields, but your actual available fields may vary. Use the Metadata API to retrieve the exact field definitions for your environment.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "objectName",
          "type": "string",
          "description": "The object type to create.",
          "enum": [
            "Customer"
          ]
        }
      ],
      "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": "<p>Object data to create. Fields shown are examples - actual available fields depend on your metadata configuration.</p>",
          "customType": "CustomerCreateRequest",
          "schema": [
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "<p>Account name (required)</p>",
              "example": "Acme Corporation"
            },
            {
              "name": "recordType",
              "kind": "optional",
              "type": "string",
              "description": "Account record type",
              "example": "Business"
            },
            {
              "name": "accountNumber",
              "kind": "optional",
              "type": "string",
              "description": "Account number"
            },
            {
              "name": "email",
              "kind": "optional",
              "type": "string",
              "description": "Primary contact email"
            },
            {
              "name": "phone",
              "kind": "optional",
              "type": "string",
              "description": "Phone number"
            },
            {
              "name": "industry",
              "kind": "optional",
              "type": "string",
              "description": "Industry classification"
            },
            {
              "name": "billingStreet",
              "kind": "optional",
              "type": "string",
              "description": "Billing street address"
            },
            {
              "name": "billingCity",
              "kind": "optional",
              "type": "string",
              "description": "Billing city"
            },
            {
              "name": "billingState",
              "kind": "optional",
              "type": "string",
              "description": "<p>Billing state/province</p>"
            },
            {
              "name": "billingPostalCode",
              "kind": "optional",
              "type": "string",
              "description": "Billing postal code"
            },
            {
              "name": "billingCountry",
              "kind": "optional",
              "type": "string",
              "description": "Billing country"
            },
            {
              "name": "shippingStreet",
              "kind": "optional",
              "type": "string",
              "description": "Shipping street address"
            },
            {
              "name": "shippingCity",
              "kind": "optional",
              "type": "string",
              "description": "Shipping city"
            },
            {
              "name": "shippingState",
              "kind": "optional",
              "type": "string",
              "description": "<p>Shipping state/province</p>"
            },
            {
              "name": "shippingPostalCode",
              "kind": "optional",
              "type": "string",
              "description": "Shipping postal code"
            },
            {
              "name": "shippingCountry",
              "kind": "optional",
              "type": "string",
              "description": "Shipping country"
            },
            {
              "name": "billCycleDay",
              "kind": "optional",
              "type": "string",
              "description": "Day of month for billing cycle"
            },
            {
              "name": "paymentTerm",
              "kind": "optional",
              "type": "string",
              "description": "<p>Payment terms (e.g., NET30)</p>"
            },
            {
              "name": "paymentMethod",
              "kind": "optional",
              "type": "string",
              "description": "Default payment method"
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "description": "Account description"
            }
          ],
          "modelRef": "#/components/schemas/CustomerCreateRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "ApiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Object created successfully",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Response from creating an object",
            "customType": "CreateObjectResponse",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "The Salesforce ID of the created record",
                "example": "001D000000IRFmaIAH"
              }
            ],
            "modelRef": "#/components/schemas/CreateObjectResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Invalid data or missing required fields</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Error response",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "code",
                "kind": "optional",
                "type": "integer",
                "description": "HTTP status code",
                "example": 400
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Error message",
                "example": "Bad Request"
              },
              {
                "name": "details",
                "kind": "optional",
                "type": "string",
                "description": "Detailed error information",
                "example": "Required field 'name' is missing"
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized - Invalid or missing API key</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "<p>Forbidden - Insufficient permissions</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "<p>Not Found - Object type not found in metadata</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "D2SijAiLhp7uESvdkkw3o",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/api/objects/{objectName} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"name\": \"Acme Corporation\"\n     }'"
        },
        {
          "id": "zUvoxFaKoONOmiSbnWu7J",
          "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   \"name\": \"Acme Corporation\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/api/objects/{objectName}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "6bI1N5jLoQv503htRCg9x",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/api/objects/{objectName}\")\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   \"name\": \"Acme Corporation\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "rXsuGXsFVIf9tAXcqBi2z",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/api/objects/{objectName}\"\n\npayload = json.dumps({\n   \"name\": \"Acme Corporation\"\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": "D2SijAiLhp7uESvdkkw3o"
    },
    "results": {
      "languages": [
        {
          "id": "xqYE-KPdAma3ZyMBnGLKJ",
          "language": "201",
          "code": "// Object created successfully\n{\n  \"id\": \"001D000000IRFmaIAH\"\n}"
        },
        {
          "id": "boghvxU7K0ssSNgpFB2_f",
          "language": "400",
          "code": "// Bad Request - Invalid data or missing required fields\n{\n  \"code\": 400,\n  \"message\": \"Bad Request\",\n  \"details\": \"Required field 'name' is missing\"\n}"
        },
        {
          "id": "Zw4ztSF0cfpucZFcyaTOH",
          "language": "401",
          "code": "// Unauthorized - Invalid or missing API key\n"
        },
        {
          "id": "Oe5SEh7VBc2uYFvR4h_9N",
          "language": "403",
          "code": "// Forbidden - Insufficient permissions\n"
        },
        {
          "id": "UTZ9IzIJH9UX-wuKMNdU6",
          "language": "404",
          "code": "// Not Found - Object type not found in metadata\n"
        }
      ],
      "selectedLanguageId": "xqYE-KPdAma3ZyMBnGLKJ"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}