---
title: Managing objects using REST
---

> 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).

To manage objects in Kentico using the REST service, send requests using the POST, PUT or DELETE [HTTP method](http://en.wikipedia.org/wiki/HTTP#Request_methods) to the appropriate URL — append the  _**resource paths**_  described below to the _**base URL**_ of your REST service.

The base URL of the 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.

Object resource paths 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.

> **Note:** **Important**: Do NOT use object requests to create, update or delete the documents of Kentico websites. See [Managing documents using REST](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/manipulating-data-using-rest/managing-documents-using-rest.md) for information about working with documents.

## Creating objects

HTTP method: **POST**

Resource format:

- **/** - creates a new object of the specified type.
- **//currentsite** - creates a new object of the specified type and assigns it to the website running on the domain in the base URL.
- **//site/** - creates a new object of the specified type and assigns it to the specified website.
- **/customtableitem.** - creates a new data record inside the specified [custom table](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/custom-tables.md).
- **/bizformitem.bizform.** - creates a new data record inside the specified [form](https://docs.kentico.com/k8/managing-website-content/forms.md).

Set the name and other fields of the new object in the data of the POST request. Both [XML](http://en.wikipedia.org/wiki/XML) and [JSON](http://en.wikipedia.org/wiki/JSON) formats are supported for the data.

> **Info:** **Important**:
>
> - The service automatically sets the system fields of the new object (such as the ID and timestamp fields).
> - Creating multiple objects of the same type in a single request is not supported.
> - You can create child or binding objects along with the primary object. When using the XML format for the data of such requests, enclose the data into the _****_ element to ensure valid syntax with a single root element.

On this page

Related pages

- [Authenticating REST requests](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/authenticating-rest-requests.md)
- [Managing documents using REST](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/manipulating-data-using-rest/managing-documents-using-rest.md)
- [Getting data using REST](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/getting-data-using-rest.md)
- [Sending REST requests from code](https://docs.kentico.com/k8/integrating-3rd-party-systems/kentico-rest-service/sending-rest-requests-from-code.md)

### Examples

**Creates a new user with the Editor privilege level and an empty password. Assigns the user to the site running on the domain in the base URL.**

| XML                                                                                                                                                                                                                                                                    | JSON                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **URL**: _\~/rest/cms.user/currentsite_<br>**Data**:<br>`  <CMS_User>   <UserName>Editor</UserName>   <FullName>Content editor</FullName>   <Email>editor@localhost.local</Email>   <UserEnabled>true</UserEnabled>   <UserIsEditor>true</UserIsEditor> </CMS_User>
 ` | **URL**: _\~/rest/cms.user/currentsite?format=json_<br>**Data**:<br>` 
{
"UserName":"Editor",
"FullName":"Content editor",
"Email":"editor@localhost.local",
"UserEnabled":true,
"UserIsEditor":true
}
 ` |

**Creates a new _country_ object with a child state**

| XML                                                                                                                                                                                                                                                                                                                                                       | JSON                                                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **URL**: _\~/rest/cms.country_<br>**Data**:<br>`  <data>   <CMS_Country>     <CountryDisplayName>New country</CountryDisplayName>     <CountryName>NewCountry</CountryName>   </CMS_Country>   <CMS_State>     <StateDisplayName>New state</StateDisplayName>     <StateName>NewState</StateName>     <StateCode>NS</StateCode>   </CMS_State> </data>
 ` | **URL**: _\~/rest/cms.country?format=json_<br>**Data**:<br>` 
{
"CountryDisplayName":"New country",
"CountryName":"NewCountry",
"CMS.State":    [{
    "StateDisplayName":"New state",
    "StateName":"NewState",
    "StateCode":"NS"
  }]
}
 ` |

**Creates a [document alias](https://docs.kentico.com/k8/configuring-kentico/configuring-page-urls/setting-document-aliases.md) for the _Home_ page of the sample Corporate site**

| XML                                                                                                                                                                                             | JSON                                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| **URL**: _\~/rest/cms.documentalias/site/corporatesite_<br>**Data**:<br>`  <CMS_DocumentAlias>   <AliasNodeID>4</AliasNodeID>   <AliasURLPath>/HomeAlias</AliasURLPath> </CMS_DocumentAlias>
 ` | **URL**: _\~/rest/_cms.documentalias/site/corporatesite_?format=json_<br>**Data**:<br>` 
{
"AliasNodeID":4,
"AliasURLPath":"/HomeAlias"
}
 ` |

**Adds a new data record into the _Sample table_ custom table**

| XML                                                                                                                                                                                | JSON                                                                                                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **URL**: _\~/rest/customtableitem.customtable.sampletable_<br>**Data**:<br>`  <customtable_SampleTable>
  <ItemText>Record added via REST</ItemText> </customtable_SampleTable>
 ` | **URL**: __\~/rest/customtableitem.customtable.sampletable_?format=json_<br>**Data**:<br>` 
{"ItemText":"Record added via REST"}
 ` |

## Updating existing objects

HTTP method: **PUT**

Resource format:

- **//** -updates the object with the specified identifier (ID or GUID value).
- **//** - updates the object with the specified code name. For object types with site bindings, always updates the object assigned to the site running on the domain in the base URL.
- **//site//** - updates the object with the specified code name on the specified website.
- **//global/** - updates the global object with the specified code name.
- **/customtableitem./** - updates the data record with the specified identifier (ID or GUID value) inside the given [custom table](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/custom-tables.md).
- **/bizformitem.bizform./** - updates the data record with the specified identifier (ID or GUID value) inside the given [form](https://docs.kentico.com/k8/managing-website-content/forms.md).

Update the values of the object's fields using the data of the PUT request. Both [XML](http://en.wikipedia.org/wiki/XML) and [JSON](http://en.wikipedia.org/wiki/JSON) formats are supported for the data. Updating multiple objects in a single request is not supported.

### Examples

**Updates the email address of the _administrator_ user**

| XML                                                                                                                                  | JSON                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| **URL**: **\~/rest/cms.user/administrator**<br>**Data**:<br>`  <CMS_User>
  <Email>newAddress@localhost.local</Email> </CMS_User>
 ` | **URL**: **\~/rest/cms.user/administrator?format=json**<br>**Data**:<br>` 
{"Email":"newAddress@localhost.local"}
 ` |

**Updates a data record of the sample _Contact us_ form**

| XML                                                                                                                                                                                       | JSON                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **URL**: _\~/rest/bizformitem.bizform.contactus/1_<br>**Data**:<br>`  <Form_ContactUs>
  <Email>newMail@localhost.local</Email>
  <Message>Updated message</Message> </Form_ContactUs>
 ` | **URL**: **_\~/rest/bizformitem.bizform.contactus/1_?format=json**<br>**Data**:<br>` 
{
  "Email":"newMail@localhost.local",
  "Message":"Updated message"
}
 ` |

## Deleting objects

HTTP method: **DELETE**

Resource format:

- **//** - deletes the object with the specified identifier (ID or GUID value).
- **// -** deletes the object with the specified code name. For object types with site bindings, always deletes the object assigned to the site running on the domain in the base URL.
- **//site//** - deletes the object with the specified code name from the specified website.
- **//global/** - deletes the global object with the specified code name.
- **/customtableitem./** - deletes the data record with the specified identifier (ID or GUID value) from the given [custom table](https://docs.kentico.com/k8/developing-websites/defining-website-data-structure/custom-tables.md).
- **/bizformitem.bizform./** - deletes the data record the specified identifier (ID or GUID value) from the given [form](https://docs.kentico.com/k8/managing-website-content/forms.md).

URL examples:

- \~/rest/cms.user/53
- \~/rest/cms.country/usa
- \~/rest/cms.country/e431b7e6-9e6c-409d-a1d9-748cbf51b5d6
- \~/rest/cms.emailtemplate/site/corporatesite/Blog.NotificationToModerators
- \~/rest/customtableitem.customtable.SampleTable/5

Deleting multiple objects in a single request is not supported. You need to send a separate DELETE request for each object.
