SP.Web.getFolderByServerRelativeUrl Method (sp.js)

Returns the folder object located at the specified server-relative URL.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013



  • serverRelativeUrl
    Type: String

    A string that specifies the server-relative URL for the folder.

Return value

Type: SP.Folder


You must have Browse Directories permissions to run code that uses the getFolderByServerRelativeUrl method. It must not be null.

REST resource endpoint

See Web resource for more information.

Endpoint URI structure


HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/getFolderByServerRelativeUrl(serverRelativeUrl)

Resource parameters

  • serverRelativeUrl