---
title: Delete Object
slug: delete-object
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "tHsj-oXB4fiu4D5HkUIZn",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.nue.io/api/objects/{objectName}/{id}",
    "servers": [
      {
        "url": "https://api.nue.io/api/objects/{objectName}/{id}",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/api/objects/{objectName}/{id}",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Delete Object",
    "description": "<p>Delete an existing record in Salesforce. This permanently removes the record from Salesforce.</p>\n<p><strong>Supported Objects:</strong> Customer, Opportunity, Quote, QuoteLineItem, Order, and OrderProduct.</p>\n<p><strong>Important:</strong> Some objects have deletion constraints. Published products cannot be deleted, and objects with dependent records may require those records to be deleted first.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "objectName",
          "type": "string",
          "description": "The object type to delete",
          "enum": [
            "Customer",
            "Opportunity",
            "Quote",
            "QuoteLineItem",
            "Order",
            "OrderProduct"
          ]
        },
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "example": "001D000000IRFmaIAH",
          "description": "The Salesforce ID of the record to delete"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "ApiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Object deleted successfully",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "<p>Bad Request - Invalid request format</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized - Invalid or missing API key</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "<p>Forbidden - Insufficient permissions or object type not accessible</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "<p>Not Found - Record with specified ID not found</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Error response for delete operations",
            "customType": "DeleteErrorResponse",
            "schema": [
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": "Error title",
                "example": "Oops! An error occurred"
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "Detailed error message",
                "example": "Provided external ID field does not exist or is not accessible: INVALID_ID_HERE"
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": "Error code",
                "example": "NOT_FOUND"
              }
            ],
            "modelRef": "#/components/schemas/DeleteErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "409",
        "description": "<p>Conflict - Record cannot be deleted due to constraints</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "5nPLnQVCuGA3Q0D4eZi-r",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.nue.io/api/objects/{objectName}/{id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "e31c_Ksw3Uk1Da3L1iq_Z",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/api/objects/{objectName}/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "mKh4emqixdGwlvaq896wd",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/api/objects/{objectName}/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "cludEQtZqabFv9eCkko4A",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/api/objects/{objectName}/{id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "5nPLnQVCuGA3Q0D4eZi-r"
    },
    "results": {
      "languages": [
        {
          "id": "s9S8uf0OJVLRP0EYFLLS_",
          "language": "200",
          "code": "// Object deleted successfully\n"
        },
        {
          "id": "_Z8h4F5E67tQ3kZ8O5l50",
          "language": "400",
          "code": "// Bad Request - Invalid request format\n"
        },
        {
          "id": "4SrsA8OB1HuWkWadAwAKN",
          "language": "401",
          "code": "// Unauthorized - Invalid or missing API key\n"
        },
        {
          "id": "KY2ticC3ylAIiKeVHu0Yv",
          "language": "403",
          "code": "// Forbidden - Insufficient permissions or object type not accessible\n"
        },
        {
          "id": "X_mOJKAes0cmlDF55LkDD",
          "language": "404",
          "code": "// Not Found - Record with specified ID not found\n{\n  \"title\": \"Oops! An error occurred\",\n  \"message\": \"Provided external ID field does not exist or is not accessible: INVALID_ID_HERE\",\n  \"errorCode\": \"NOT_FOUND\"\n}"
        },
        {
          "id": "XsmBMiUxCjqVoKdLniuE5",
          "language": "409",
          "code": "// Conflict - Record cannot be deleted due to constraints\n"
        }
      ],
      "selectedLanguageId": "s9S8uf0OJVLRP0EYFLLS_"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}