Modify a content type snippet

PATCH https://manage.kontent.ai/v2/projects/:environment_id/snippets/:snippet_identifier

Modify how existing content type snippets and their elements are set up.

You can modify the content type snippets and their element configuration using the following operations:

  • addInto operation to add new objects. For example, add an element to the content type snippet, or add a multiple choice element option.
  • move operation to reorder objects. For example, change the position of an element within the content type snippet or the position of a multiple choice element option.
  • remove operation to delete objects. For example, delete an element from the content type snippet, or delete a specific multiple choice element option.
  • replace operation to update values. For example, replace the value of a specific object property such as a codename.

To apply the operations on the snippet's elements, you need to specify a path to the element or its property using a {path_reference}. Path references can use internal IDs, codenames, or external IDs.

  • id:5eb3d03e-c69d-4e93-b4cc-76f453271386
  • codename:snippet_codename__my_text_element
  • external_id:id_from_external_source – Special characters such as slashes (/) need to be escaped. For example, to reference an object using its external ID of my/value, you use a path reference of external_id:my\\/value.

Request Body

[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;id&quot;:&quot;c8fcc464-b937-4558-a386-c1e25aa93813&quot;,&quot;codename&quot;:&quot;my_metadata_snippet&quot;,&quot;last_modified&quot;:&quot;2019-08-06T09:19:12.241774Z&quot;,&quot;external_id&quot;:&quot;my-metadata-snippet-id&quot;,&quot;name&quot;:&quot;A new snippet name&quot;,&quot;elements&quot;:[{&quot;maximum_text_length&quot;:{&quot;value&quot;:150,&quot;applies_to&quot;:&quot;characters&quot;},&quot;name&quot;:&quot;My meta description&quot;,&quot;guidelines&quot;:&quot;Length: 70-150 characters.&quot;,&quot;is_required&quot;:false,&quot;is_non_localizable&quot;:false,&quot;type&quot;:&quot;text&quot;,&quot;id&quot;:&quot;f79ad793-b01d-42b0-b06c-7043cd9b6f31&quot;,&quot;codename&quot;:&quot;my_metadata_snippet__my_meta_description&quot;},{&quot;maximum_text_length&quot;:null,&quot;name&quot;:&quot;My meta title&quot;,&quot;guidelines&quot;:&quot;Length: 30–60 characters.&quot;,&quot;is_required&quot;:false,&quot;is_non_localizable&quot;:false,&quot;type&quot;:&quot;text&quot;,&quot;external_id&quot;:&quot;my-meta-title-id&quot;,&quot;id&quot;:&quot;0eb2bcda-5b9f-4425-b9e1-c7679356e456&quot;,&quot;codename&quot;:&quot;my_metadata_snippet__my_meta_title&quot;},{&quot;mode&quot;:&quot;single&quot;,&quot;options&quot;:[{&quot;id&quot;:&quot;8e6ec8b1-6510-4b9b-b4be-6c977f4bdfbc&quot;,&quot;codename&quot;:&quot;another_multiple_choice_option&quot;,&quot;name&quot;:&quot;Another multiple choice option&quot;},{&quot;id&quot;:&quot;6bfe5a60-5cc2-4303-8f72-9cc53431046b&quot;,&quot;codename&quot;:&quot;my_other_multiple_choice_option&quot;,&quot;name&quot;:&quot;My other multiple choice option&quot;}],&quot;name&quot;:&quot;My multiple choice&quot;,&quot;guidelines&quot;:null,&quot;is_required&quot;:false,&quot;is_non_localizable&quot;:false,&quot;id&quot;:&quot;fcc30f1e-9abf-41da-8693-ed89f3be438d&quot;,&quot;codename&quot;:&quot;my_metadata_snippet__my_multiple_choice&quot;,&quot;type&quot;:&quot;multiple_choice&quot;,&quot;external_id&quot;:&quot;my-multiple-choice-id&quot;}]}