SharePoint Online rest api to declare item as record

SharePoint Asked by Maurizio on January 21, 2021

does SharePoint Online have a rest api to declare an item as a record?
I will use it in MS Flow


2 Answers

There is not a REST API to achieve it, as a workaround, we can create a Azure Function with CSOM(Microsoft.SharePoint.Client.RecordsRepository.Records namespace can help to declare/undeclare item as record) to achieve it.

Refer to: How to call SharePoint from Microsoft Flow with the help of an Azure Function

Or we can create a separate library with Automatic Declaration (under Record declaration settings) and copying there the documents, so they are automatically set as record.

Here is a discussion for your reference: SharePoint Action to 'Declare as Record'

Correct answer by LZ_MSFT on January 21, 2021

I know this is old but with SharePoint 2010 workflows going away, I thought someone else may need this. This is the same call that CSOM would make.

When a HTTP Request is received.

    "type": "object",
    "properties": {
        "web": {
            "type": "string"
        "list": {
            "type": "string"
        "item": {
            "type": "integer"

Then Send an HTTP request to SharePoint.

Site Address: @{triggerBody()?['web']}
Method: POST
Uri: _api/contextinfo
    Accept: application/json; odata=nometadata

Then Send an HTTP request to SharePoint.

Site Address: @{triggerBody()?['web']}
Method: POST
Uri: _vti_bin/client.svc/ProcessQuery
    Content-Type: application/xml
    X-RequestDigest: @{body('Send_an_HTTP_request_to_SharePoint')?['FormDigestValue']}
    <Request AddExpandoFieldTypeSuffix="true" SchemaVersion="" LibraryVersion="" ApplicationName=".NET Library" xmlns="">
        <ObjectPath Id="2" ObjectPathId="1" />
        <ObjectPath Id="4" ObjectPathId="3" />
        <ObjectPath Id="6" ObjectPathId="5" />
        <ObjectPath Id="8" ObjectPathId="7" />
        <ObjectIdentityQuery Id="9" ObjectPathId="7" />
        <ObjectPath Id="11" ObjectPathId="10" />
        <StaticMethod TypeId="{ea8e1356-5910-4e69-bc05-d0c30ed657fc}" Name="DeclareItemAsRecord" Id="12">
            <Parameter ObjectPathId="10" />
        <StaticProperty Id="1" TypeId="{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}" Name="Current" />
        <Property Id="3" ParentId="1" Name="Web" />
        <Property Id="5" ParentId="3" Name="Lists" />
        <Method Id="7" ParentId="5" Name="GetByTitle">
            <Parameter Type="String">@{triggerBody()?['list']}</Parameter>
        <Method Id="10" ParentId="7" Name="GetItemById">
            <Parameter Type="Int32">@{triggerBody()?['item']}</Parameter>

Answered by benxford on January 21, 2021

Add your own answers!

Related Questions

Sharepoint 2013 Query Filter Using POST

1  Asked on November 11, 2021 by ciprian


Adding “request change” button to Sharepoint Task

1  Asked on November 11, 2021 by ricardo-rodrigues


Create external users using CSOM

3  Asked on November 8, 2021 by marlou


Import Excel to SharePoint List Tutorial Error

1  Asked on November 5, 2021 by seaandtea


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP