Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
Sites.Manage.All
Sites.FullControl.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
Sites.Manage.All
Sites.FullControl.All
HTTP request
POST /sites/{site-id}/lists/{list-id}/columns
Request body
In the request body, supply a JSON representation of the columnDefinition resource to add.
Response
If successful, this method returns a 201 Created response code and a columnDefinition object in the response body.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new ColumnDefinition
{
Description = "test",
EnforceUniqueValues = false,
Hidden = false,
Indexed = false,
Name = "Title",
Text = new TextColumn
{
AllowMultipleLines = false,
AppendChangesToExistingText = false,
LinesForEditing = 0,
MaxLength = 255,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Sites["{site-id}"].Lists["{list-id}"].Columns.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ColumnDefinition();
$requestBody->setDescription('test');
$requestBody->setEnforceUniqueValues(false);
$requestBody->setHidden(false);
$requestBody->setIndexed(false);
$requestBody->setName('Title');
$text = new TextColumn();
$text->setAllowMultipleLines(false);
$text->setAppendChangesToExistingText(false);
$text->setLinesForEditing(0);
$text->setMaxLength(255);
$requestBody->setText($text);
$result = $graphServiceClient->sites()->bySiteId('site-id')->lists()->byListId('list-id')->columns()->post($requestBody)->wait();