Upsert a content item

PUT https://manage.kontent.ai/v2/projects/:environment_id/items/:item_identifier

Update or create a content item.

  • To update a content item, you need to identify the existing item by its internal ID, external ID, or codename.
  • To create a content item, you need to specify the external ID as the item's identifier. You can also specify external ID when adding content items.

Content items don't contain any content themselves directly. They serve as wrappers for language variants. Language variants hold the items' content even in environments with a single language.

To change the content in content items, upsert their specific language variant.

Request Body

{"name"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "codename"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "collection"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "sitemap_locations"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;id&quot;:&quot;335d17ac-b6ba-4c6a-ae31-23c1193215cb&quot;,&quot;name&quot;:&quot;My new article&quot;,&quot;codename&quot;:&quot;my_article&quot;,&quot;type&quot;:{&quot;id&quot;:&quot;b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89&quot;},&quot;collection&quot;:{&quot;id&quot;:&quot;00000000-0000-0000-0000-000000000000&quot;},&quot;spaces&quot;:[{&quot;id&quot;:&quot;dcbf90fb-7135-4465-8102-b3e739821ed8&quot;},{&quot;id&quot;:&quot;39efe8a4-23d2-4d3a-8dfb-07789668474f&quot;}],&quot;sitemap_locations&quot;:[],&quot;external_id&quot;:&quot;custom-identifier-for-my-article&quot;,&quot;last_modified&quot;:&quot;2020-04-04T13:45:30.7692802Z&quot;}