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:
addIntooperation to add new objects. For example, add an element to the content type snippet, or add a multiple choice element option.moveoperation 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.removeoperation to delete objects. For example, delete an element from the content type snippet, or delete a specific multiple choice element option.replaceoperation 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-76f453271386codename:snippet_codename__my_text_elementexternal_id:id_from_external_source– Special characters such as slashes (/) need to be escaped. For example, to reference an object using its external ID ofmy/value, you use a path reference ofexternal_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
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: OK
{"id":"c8fcc464-b937-4558-a386-c1e25aa93813","codename":"my_metadata_snippet","last_modified":"2019-08-06T09:19:12.241774Z","external_id":"my-metadata-snippet-id","name":"A new snippet name","elements":[{"maximum_text_length":{"value":150,"applies_to":"characters"},"name":"My meta description","guidelines":"Length: 70-150 characters.","is_required":false,"is_non_localizable":false,"type":"text","id":"f79ad793-b01d-42b0-b06c-7043cd9b6f31","codename":"my_metadata_snippet__my_meta_description"},{"maximum_text_length":null,"name":"My meta title","guidelines":"Length: 30–60 characters.","is_required":false,"is_non_localizable":false,"type":"text","external_id":"my-meta-title-id","id":"0eb2bcda-5b9f-4425-b9e1-c7679356e456","codename":"my_metadata_snippet__my_meta_title"},{"mode":"single","options":[{"id":"8e6ec8b1-6510-4b9b-b4be-6c977f4bdfbc","codename":"another_multiple_choice_option","name":"Another multiple choice option"},{"id":"6bfe5a60-5cc2-4303-8f72-9cc53431046b","codename":"my_other_multiple_choice_option","name":"My other multiple choice option"}],"name":"My multiple choice","guidelines":null,"is_required":false,"is_non_localizable":false,"id":"fcc30f1e-9abf-41da-8693-ed89f3be438d","codename":"my_metadata_snippet__my_multiple_choice","type":"multiple_choice","external_id":"my-multiple-choice-id"}]}