
In this post I have shared the process to create a new column in SharePoint list or library using REST API or PowerShell. The process is fairly simple and straight forward.
Prerequisites
You need the following for this tutorial
- An application to call API endpoints such as Postman, VS code or Power Automate. I have used Power Automate (If you are not familiar with Power Automate, I would request you to check my beginners tutorial for Power Automate)
- You need to have at least edit permission in the SharePoint list (this is mandatory to create a column using any method, including REST API & PowerShell).
Implementation
#1. SharePoint REST API
The API endpoint for creating a column is
POST https://{site_url}/_api/web/lists(guid'{list_guid}')/Fields
As this is a creation request, a POST method is required. Also you need few headers and a request body. The request body contains the information about the new column you are trying to create. Such as column name, type, hidden etc. An example is shown in the below picture and the respective explanation is provided below.

As you can see in the above image, it is a simple POST API call to create a new column. A few parameters are passed in the content body with the column related information(explanation for each are below).
I have used the numbers(as per the image) to explain the details below.
- URI – The Uri is mentioned above.
A list guid is a unique identifier which can be found from the SharePoint list settings or by calling the list API( _api/web/lists/getbytitle(‘Title’) ) . - Headers – headers carry validation, authentication or related information.
If you are calling the API from Power Automate (or a JS script within SharePoint) then you require only these two headers as shown in the above image. However if you are using any other applications such as Postman or VS code then you would need other headers such as accesstoken. More information regarding those can be found on the Microsoft documentation, however if you need any tutorial let me know in the comments. - The type metadata SP.Field identifies that the POST request body is for a SharePoint Field(column)
- Title: The title you would like to show in the SharePoint list view
- FieldTypeKind: This is a numerical value which identifies the type of column(i.e. Text, number, hyperlink etc.). More information on this is provided below. However if you do not want to use the numerical value then, you can use the property TypeAsString.
- Required: Whether this column is mandatory to fill or not
- EnforceUniqueValues: Whether the information provided in this column should be unique or not
- staticname: static name of the column/field
- Hidden: Whether the field is hidden in the default view.
Details of the API
Header
Accept: "application/json;odata=verbose"
Content-Type: "application/json"
Body
{
"__metadata": {
"type": "SP.Field"
},
"Title": "field title",
"FieldTypeKind": 2,
"Required": "true",
"EnforceUniqueValues": "false",
"StaticName": "field name",
"Hidden":"false"
}
Final Result
The above request should be enough to create a/multiple column in SharePoint using REST API. And if you call the API correctly with the above details, a column should be created as below. The column should show an error “Required information missing” and it should be visible in the default view.


Additional information
If you have followed along then you should have at least two questions in your mind. They are
- What are the available values for FieldTypeKind (i.e. how to create other column types) ?
- And, is it possible to pass more parameters in the request body? For example description, default value etc.
Well, good news! I have both the answers for you below.
Q. What are the different field type values available ?
You can create every kind of available field types, using both REST API and PowerShell. Below is a table with some most commonly used FieldTypeKind values for SharePoint REST API. For all available FieldTypeKind values follow Microsoft documentation. You can use these values from the table to create different kinds of columns.
*Note – You should not use any invalid FieldTypeKind value in SharePoint REST API. It can cause issues
Column Type | Value | Description |
Integer | 1 | Specifies that the field contains an integer value. |
Text | 2 | Specifies that the field contains a single line of text. |
Note | 3 | Specifies that the field contains multiple lines of text. |
DateTime | 4 | Specifies that the field contains a date and time value or a date-only value. |
Counter | 5 | Specifies that the field contains a monotonically increasing integer. |
Choice | 6 | Specifies that the field contains a single value from a set of specified values. |
Lookup | 7 | Specifies that the field is a lookup field. |
Boolean | 8 | Specifies that the field contains a Boolean value. |
Number | 9 | Specifies that the field contains a floating-point number value. |
Currency | 10 | Specifies that the field contains a currency value. |
URL | 11 | Specifies that the field contains a URI and an optional description of the URI. |
Computed | 12 | Specifies that the field is a computed field. |
Guid | 14 | Specifies that the field contains a GUID value. |
MultiChoice | 15 | Specifies that the field contains one or more values from a set of specified values. |
Calculated | 17 | Specifies that the field is a calculated field. |
File | 18 | Specifies that the field contains the leaf name of a document as a value. |
Attachments | 19 | Specifies that the field indicates whether the list item has attachments. |
User | 20 | Specifies that the field contains one or more users and groups as values. |
Recurrence | 21 | Specifies that the field indicates whether a meeting in a calendar list recurs. |
Error | 24 | Specifies that the type of the field was set to an invalid value. |
ContentTypeId | 25 | Specifies that the field contains a content type identifier as a value. |
WorkflowStatus | 28 | Specifies that the field indicates the status of a workflow instance on a list item. |
AllDayEvent | 29 | Specifies that the field indicates whether a meeting in a calendar list is an all-day event. |
WorkflowEventType | 30 | Specifies that the field contains the most recent event in a workflow instance. |
Q. Different properties available for SP.Field POST request body
Similar to the above table, below is a table with the most commonly used properties/parameters for SP.Field body. For full list of parameters, check the Microsoft document.
Property | Type | Read/Write | Description |
CanBeDeleted | Boolean | R | Gets a value that specifies whether the field can be deleted. |
DefaultValue | String | R/W | Gets or sets a value that specifies the default value for the field. |
Description | String | R/W | Gets or sets a value that specifies the description of the field. |
Direction | String | R/W | Gets or sets a value that specifies the reading order of the field. |
EnforceUniqueValues | Boolean | R/W | Gets or sets a value that specifies whether to require unique field values in a list or library column. |
FieldTypeKind | Int32 | R/W | Gets or sets a value that specifies the type of the field. Represents a Field Type value. See FieldType in the .NET client object model reference for a list of field type values |
Filterable | Boolean | R | Gets a value that specifies whether list items in the list can be filtered by the field value. |
Group | String | R/W | Gets or sets a value that specifies the field group. |
Hidden | Boolean | R/W | Gets or sets a value that specifies whether the field is hidden in list views and list forms. |
Id | GUID | R | Gets a value that specifies the field identifier. |
Indexed | Boolean | R/W | Gets or sets a Boolean value that specifies whether the field is indexed. |
InternalName | String | R | Gets a value that specifies the field internal name. |
ReadOnlyField | Boolean | R/W | Gets or sets a value that specifies whether the value of the field is read-only. |
Required | Boolean | R/W | Gets or sets a value that specifies whether the field requires a value. |
SchemaXml | String | R/W | Gets or sets a value that specifies the XML schema that defines the field. |
Scope | String | R/W | Gets a value that specifies the server-relative URL of the list or the site to which the field belongs. |
Sealed | Boolean | R/W | Gets a value that specifies whether properties on the field cannot be changed and whether the field cannot be deleted. |
Sortable | Boolean | R/W | Gets a value that specifies whether list items in the list can be sorted by the field value. |
StaticName | String | R/W | Gets or sets a value that specifies a customizable identifier of the field. |
Title | String | R/W | Gets or sets value that specifies the display name of the field. |
TypeAsString | String | R/W | Gets or sets a value that specifies the type of the field. |
ValidationFormula | String | R/W | Gets or sets a value that specifies the data validation criteria for the value of the field. |
ValidationMessage | String | R/W | Gets or sets a value that specifies the error message returned when data validation fails for the field. |
That’s all you need to create a column using REST API in SharePoint Online. Next let’s check the PowerShell option
#2. Create SharePoint column using PowerShell
There are already many documents available online and as I do not wish to increase the document length, I have included the link of those documents instead of rewriting them again. If you have any questions feel free to ask in the comments.
https://www.sharepointdiary.com/2016/12/sharepoint-online-create-site-column-using-powershell.html
https://www.c-sharpcorner.com/blogs/create-a-site-column-using-powershell-in-sharepoint1
That’s all I have for this document, create a SharePoint column using REST API and PowerShell. And I hope this to help you in your requirement.
Please Help us Grow!
I hope you have found this article helpful. If you are happy with the document, please use the below links when you buy something from Amazon to help us grow.
Ways to Help
Amazon Affiliate Links
How this works?
Amazon affiliate program gives a small (%)share of price to the referrers, so feel free to buy anything.
Below are some Amazon affiliate links, if you open amazon application/website using these links and buy something, (it can be one of the below items or anything of your choice) Then Amazon will give us a little percentage(%) of the money you spend on Amazon. To know more check this document.
Thank you
For your Contribution
Newbietechie.com
Author @ramizmollahmd
About Ramiz
Ramiz is a professional working in an MNC as a business and technology consultant for quite a few years now. Ramiz is proficient in various Microsoft tools and technologies. He is a tech enthusiast and an active blogger. Ramiz spends his free time playing games or watching movies. He writes blogs to share his knowledge with the world and to make it a better place to live.