Recently, while creating a folder in a SharePoint List using the SharePoint REST API, I encountered the following error: An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.
You can refer to the image below.

In this SharePoint tutorial, we will discuss in detail how I got this error: “An entry without a type name was found, but no expected type was specified error” and how to fix it.
Error: An Entry Without a Type Name Was Found. Rest API
When I was creating a folder in the SharePoint list using REST API, I used the code below to execute:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
function createFolderInList(listTitle, folderName) {
// Construct the endpoint URL for adding a folder
var endpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/items";
// Construct the folder metadata
var folderMetadata = {
"fields": {
"Title": folderName
},
"contentType": { "id": "0x0120" }
};
// Create the folder
return $.ajax({
url: endpointUrl,
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(folderMetadata),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function (data) {
console.log("Folder created successfully:", data);
},
error: function (error) {
console.error("Failed to create folder:", error);
}
});
}
// Usage example
var listTitle = "Sales"; // Replace with your SharePoint list title
var folderName = "Test"; // Specify the name of the folder to be created
createFolderInList(listTitle, folderName);
</script>When I ran this code in SharePoint, I got the error: “An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.“

This error usually occurs when the SharePoint REST API is used to create or update items in SharePoint. This occurs because the required type information is missing, preventing SharePoint from processing the data in the request payload.
This indicates that SharePoint expects the request payload to contain metadata (such as list item properties) specifying the kind of data being provided. SharePoint is unable to properly evaluate the request without this information, resulting in the error message displayed.
If you highlight this section of the code, the error occurs because we didn’t provide the necessary metadata type information to create a folder.
// Construct the folder metadata
var folderMetadata = {
"fields": {
"Title": folderName
},
"contentType": { "id": "0x0120" }
};In the next section, we will see how to resolve this error by providing the information type.
Solution: An Entry Without a Type Name Was Found Rest API
To resolve this error, we need to replace the code var folderMetadata with the following code:
var folderMetadata = {
"__metadata": { "type": "SP.Data." + listTitle + "ListItem" },
"Title": folderName,
"ContentTypeId": "0x0120" // Content Type ID for folders
};Now, run the code, and you can create a folder in the SharePoint list using the SharePoint REST API, as shown below.

Conclusion
In this SharePoint tutorial, we saw how to fix the error: An entry without a type name was found, but no expected type was specified. The expected type must also be specified when the model is specified to allow entries without type information while working with REST API.
You may also like:
- SharePoint REST API CRUD Operations
- How to Get SharePoint List Items using REST API?
- How to Get Current User using SharePoint Rest API?
- The security validation for this page is invalid and might be corrupted

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.