---
title: Getting data using REST
related:
  - https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/authenticating-rest-requests.md
  - https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/manipulating-data-using-rest.md
  - https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/sending-rest-requests-from-code.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The REST service allows you to retrieve document and object data from Kentico instances.

Send requests using the **GET** [HTTP method](http://en.wikipedia.org/wiki/HTTP#Request_methods) to a URL in format: **/**

The base URL of the Kentico REST service is **/rest**. For example, if your site is running at  _http://localhost/Kentico_, use  _http://localhost/Kentico/rest_  as the base URL of the service. To learn about the available **resource paths** for documents and objects, see the tables in the sections below. The requests return data in either XML, JSON, RSS or Atom format (see [Examples of data retrieved via the REST service](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/getting-data-using-rest/examples-of-data-retreived-via-the-rest-service.md) for more information).

> **Info:** **REST base URL**
>
> Sending a GET request to the base URL of the REST service exposes the service document (for ODATA browsing). The document contains a list of all available object types and the URLs under which the objects can be accessed. See also: [ODATA service documents](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/getting-data-using-rest/odata-service-documents.md)

#### Character encoding

Data retrieval requests return the results in the server's default character encoding. To get the results in a different encoding type, set the encoding in the **Accept-Charset** field of the GET request's HTTP header. If the specified encoding is not available, the system uses the **Default encoding** configured in **Settings -> Integration -> Rest**.

```csharp title="Example"

GET http://localhost/Kentico/rest/cms.user/administrator HTTP/1.1
Authorization: Basic UmVzdENsaWVudDpNeVBhc3N3b3Jk
Accept-Charset: utf-8
Content-Type: text\xml

```

## Getting document data

To load the data of documents from Kentico websites, send GET requests to the appropriate URL — append the  _**resource paths**_  described below to the base URL of your REST service.

> **Tip:** You can further configure the data retrieval by adding [query string parameters](#data-loading-parameters) to the URL.

| Resource format and example                                                                                                                                                     | Description                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Single document                                                                                                                                                                 |                                                                                                                                                                                                                                                 |
| **/content/currentsite//document/**<br>_/content/currentsite/en-us/document/company/careers_                                                                                    | A single document in the given culture from the site running on the domain in the base URL.<br>Identify the document using its [alias path](https://docs.kentico.com/k8/configuring-kentico/configuring-page-urls/setting-document-aliases.md). |
| **/content/site///document/**<br>_/content/site/corporatesite/en-us/document/company/careers_                                                                                   | A single document in the given culture on the specified site.                                                                                                                                                                                   |
| Multiple documents                                                                                                                                                              |                                                                                                                                                                                                                                                 |
| **/content/currentsite//all/**  _/content/currentsite/en-us/all/news_<br>**/content/site///all/**<br>_/content/site/corporatesite/en-us/all/news_                               | All documents starting with the specified [alias path](https://docs.kentico.com/k8/configuring-kentico/configuring-page-urls/setting-document-aliases.md).                                                                                      |
| **/content/currentsite//childrenof/**<br>_/content/currentsite/en-us/childrenof/news_<br>**/content/site///childrenof/**<br>_/content/site/corporatesite/en-us/childrenof/news_ | All child documents under the specified parent document. Does not include the parent document itself.                                                                                                                                           |

> **Info:** **Culture constants**
>
> You can use the following constants instead of culture codes in document REST calls:
>
> - **defaultculture** - the document version in the site's default culture
> - **allcultures** - document versions in all available cultures
>
> Example: _/content/currentsite/defaultculture/document/company/careers_

## Getting object data

To load the data of objects from Kentico, send GET requests to the appropriate URL — append the  _**resource paths**_  described below to the base URL of your REST service.

Most object resources start with an _object type_ name. To find the value for specific object types, view the _Code name_ of classes in the _Modules_ application, or the _ClassName_ column of the _CMS\_Class_ database table.

> **Tip:** You can further configure the data retrieval by adding [query string parameters](#data-loading-parameters) to the URL.

| Resource format and example                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Multiple objects                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **/**<br>_/cms.country_                                                             | All objects of the given type assigned to the site running on the domain in the base URL.<br>If the object type does not use site bindings, returns all objects of the given type.                                                                                                                                                                                                                                        |
| **//site/**  _/cms.country/site/corporatesite_                                      | All objects of the given type assigned to the specified site.<br>If the object type does not use site bindings, returns all objects of the given type.                                                                                                                                                                                                                                                                    |
| **//global**  _/cms.emailtemplate/global_                                           | All global objects of the given type (objects not assigned to any site).<br>If the object type does not use site bindings, returns all objects of the given type.                                                                                                                                                                                                                                                         |
| **//all**<br>_/cms.emailtemplate/all_                                               | All objects of the given type (site-related objects from all sites and global objects).<br>**Note**: The REST service does not allow _/all_ object retrieval for requests that use the **hash** URL parameter for [authentication](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/authenticating-rest-requests.md). This is an intentional security limitation that protects global data. |
| Single object                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **//** _/cms.country/271<br>/cms.country/e431b7e6-9e6c-409d-a1d9-748cbf51b5d6_      | Object of the given type with the specified identifier (ID or GUID value).<br>Ignores site bindings — object IDs and GUIDs are unique across all sites in the system.                                                                                                                                                                                                                                                     |
| **//**<br>_/cms.country/usa_                                                        | Object of the given type with the specified code name.<br>For object types with site bindings, always returns the object assigned to the site running on the domain in the base URL.                                                                                                                                                                                                                                      |
| **//site//**  _/cms.emailtemplate/site/corporatesite/Blog.NotificationToModerators_ | Object of the given type with the specified code name, assigned to the specified site.                                                                                                                                                                                                                                                                                                                                    |
| **//global/**  _/cms.emailtemplate/global/Blog.NotificationToModerators_            | Global object of the given type with the specified code name.                                                                                                                                                                                                                                                                                                                                                             |
| Child objects                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **///children**  _/cms.country/271/children_                                        | All **object types** that are supported as child types for the specified object. Only ID values can be used to identify the parent object.                                                                                                                                                                                                                                                                                |
| **///children/**  _/cms.country/271/children/cms.state_                             | All objects of the given type that are children of the specified parent object. Only ID values can be used to identify the parent object.                                                                                                                                                                                                                                                                                 |
| Binding objects                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **///bindings**  _/cms.user/53/bindings_                                            | All **object types** that are used as binding types (represent relationships with other objects) for the specified object. Only ID values can be used to identify the object.                                                                                                                                                                                                                                             |
| **///bindings/**  _/cms.user/53/bindings/cms.usersite_                              | All objects of the given binding type that exist for the specified object. Only ID values can be used to identify the object.                                                                                                                                                                                                                                                                                             |
| Custom tables                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **/cms.customtable/**  _/cms.customtable/customtable.sampletable_                   | The class definition of the specified [custom table](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/custom-tables.md) (includes data such as the custom table's names, field definitions and search settings).                                                                                                                                                                           |
| **/customtableitem.**  _/customtableitem.customtable.sampletable_                   | The data records stored in the specified custom table.                                                                                                                                                                                                                                                                                                                                                                    |
| Forms                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **/cms.form/**  _/cms.form/contactus_                                               | The class definition of the specified [form](https://docs.kentico.com/k8/managing-website-content/forms.md) (includes data such as the form's names, basic settings and field definitions).                                                                                                                                                                                                                               |
| **/bizformitem.bizform.**<br>_/bizformitem.bizform.contactus_                       | The data records stored for the specified form.                                                                                                                                                                                                                                                                                                                                                                           |
| Other                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **//site**<br>_/cms.country/site_                                                   | Lists all sites on which the specified object type is available and provides the REST URLs under which the object data can be retrieved for individual sites (for ODATA browsing).                                                                                                                                                                                                                                        |
| **/typeinfo/**  _/typeinfo/cms.user_                                                | The _TypeInfo_ data for the specified object type. The TypeInfo is a set of properties that define the general behavior and basic properties of object types (classes) in Kentico.                                                                                                                                                                                                                                        |
| **/macro/**  _/macro/CurrentSite.SiteName_                                          | Evaluates the given [macro expression](https://docs.kentico.com/k8/macro-expressions.md) and serializes the result. Only works for macros that return a serializable result.<br>When creating the macro expression:<br>Do NOT add the encapsulating bracket characters<br>Use URL encoding for forbidden URL characters                                                                                                   |

## Data loading parameters

When loading data via REST, you can append the following query string parameters to the request URL:

| Parameter                     | Value (default bold)              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| General                       |                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| format                        | **xml**/json/atom10/rss20         | Sets the format of the retrieved data. For example, append _?format=json_ to the request URL to get data in JSON format.<br>See also: [Examples of data retreived via the REST service](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/getting-data-using-rest/examples-of-data-retreived-via-the-rest-service.md)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| localize                      | culture code                      | If added, the system resolves all [localization expressions](https://docs.kentico.com/k8/multilingual-websites/setting-up-a-multilingual-user-interface/working-with-resource-strings.md) inside the returned data. Without this parameter, requests always return localization expressions in unresolved format. Supported by both document and object retrieval requests.<br>Specify the target language by entering the corresponding _culture code_ into the parameter's value. You can find the available culture codes in the **Localization** application on the **Cultures** tab.<br>For example, append _?localize=fr-fr_ to the request URL to resolve all localization expressions into their French value (or the value in the default UI culture if the expression is not defined in French). |
| hash                          | hash string                       | Allows you to authenticate the request without requiring an authentication header or Forms authentication.<br>See [Authenticating REST requests](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/authenticating-rest-requests.md) to learn how to generate the hash value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Documents                     |                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| classnames                    | document type code name (**all**) | Limits which [document types](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/document-types.md) the request returns. Specified as a list of document type code names separated by semicolons.<br>For example, to retrieve only _cms.article_ documents, append _?classnames=cms.article_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| coupleddata                   | **true**/false                    | Determines if the request retrieves data stored in the fields of specific document types (coupled data).<br>To load documents without coupled data, append _?coupleddata=false_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| combinewithdefaultculture     | **true**/false                    | Indicates if the request loads the default language versions of documents if they do not exist in the specified culture.<br>To load the default language versions of documents, append _?combinewithdefaultculture=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| selectonlypublished           | **true**/false                    | Determines if the request loads only documents that are published on the live site.<br>To also retrieve unpublished documents , append _?selectonlypublished=false_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| version                       | **published**/last                | Determines if the request returns the document versions that are published on the live site or the latest version that is being edited in the **Pages** application (when using [Workflow](https://docs.kentico.com/k8/managing-website-content/configuring-the-environment-for-content-editors/configuring-workflows.md)).<br>To load the latest document versions, append _?version=last_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                            |
| Multiple documents or objects |                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| where                         | SQL code (**empty**)              | SQL WHERE condition for filtering the loaded data. The parameter only supports basic SQL syntax – certain SQL keywords may not work correctly.<br>Example: _\~/rest/cms.user?Where=UserIsEditor=1_<br>**Note**: To avoid ambiguity, ensure that _where_ parameter values are URL encoded. For example, occurrences of the % character should be replaced by the encoded equivalent – %25.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| orderby                       | SQL code (**empty**)              | SQL ORDER BY clause for modifying the order of the items in the data. The parameter only supports basic SQL syntax — certain SQL keywords may not work correctly.<br>Append _?orderby=##default##_ to use alphabetical order based on the object display name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| columns                       | column names (**all columns**)    | Limits which data columns of the object or document are loaded.<br>For example, to load only the _UserName_ and _UserID_ columns when retrieving users, append _?columns=UserName,UserID_ to the request URL.<br>If you add the _columns_ parameter, the _binary_ parameter is ignored (you can choose whether to include binary columns by enumerating the corresponding columns).                                                                                                                                                                                                                                                                                                                                                                                                                        |
| topn                          | integer (**all records**)         | SQL TOP N clause for filtering the loaded data.<br>For example, to load only the first 10 records, append _?topn=10_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Multiple objects**          |                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| offset                        | integer (**first record**)        | Sets the number of the first record that the request returns (according to the order of the data). Allows you to implement paging of the data.<br>For example, to load data starting from the third item in the dataset, append _?offset=2_ to the request URL.<br>**Note**: The _offset_ parameter only works when getting object data (not supported for documents).                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| maxrecords                    | integer (**all records**)         | Limits the maximum number of retrieved records. You can use the _maxrecords_ parameter in combination with the _offset_ parameter to retrieve a specific range of records.<br>For example, to load items 11–20 from the data, append _?offset=10\&maxrecords=10_ to the request URL.<br>**Note**: The _maxrecords_ parameter only works when getting object data (not supported for documents).                                                                                                                                                                                                                                                                                                                                                                                                            |
| Objects                       |                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| objectdata                    | **true**/false                    | Indicates whether the request retrieves the data fields of objects.<br>To load only the metadata of an object, append _?objectdata=false\&metadata=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| metadata                      | true/**false**                    | Determines if the request retrieves the metadata of objects (type, list of properties / columns).<br>To load the metadata, append _?metadata=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| binary                        | true/**false**                    | Indicates whether the request retrieves binary data (e.g. the data of files uploaded into form fields). Binary data is retrieved in _Base64_ format.<br>To include the binary data in the response, append _?binary=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| children                      | true/**false**                    | Indicates whether the result includes child objects.<br>To load child objects, append _?children=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| maxrelativelevel              | integer (**all levels**)          | If the _children_ parameter is true, this parameters sets the maximum depth of the exported object tree structure.<br>For example, to load all child objects down to the second level of the object tree, append _?children=true\&maxrelativelevel=2_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| bindings                      | true/**false**                    | Determines if the retrieved data includes bindings to child objects and sites. Requests only return bindings if the _objectdata_ parameter is true.<br>To load object data with its bindings, append _?bindings=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| otherbindings                 | true/**false**                    | Determines if the retrieved data includes bindings to other objects (M:N relationships). Requests only return bindings if the _objectdata_ parameter is true.<br>To load object data with bindings to other objects, append _?otherbindings=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| metafiles                     | true/**false**                    | Determines if the retrieved data includes metafiles attached to the object<br>To load metafiles, append _?metafiles=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| relationships                 | true/**false**                    | Determines if the retrieved data includes object relationships.<br>To load relationships, append _?relationships=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| categories                    | true/**false**                    | Determines if the retrieved data includes the object's category structure (if the object is stored in a hierarchical category structure).<br>To load the category structure, append _?categories=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| translations                  | true/**false**                    | Indicates whether the result includes a translation table of foreign keys.<br>To load the translation table, append _?translations=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| hierarchy                     | true/**false**                    | If true, the response data is exported in a hierarchical structure (if false, the children – bindings – parent structure is flat).<br>To export the data in a hierarchical structure, append _?hierarchy=true_ to the request URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
