diff --git a/demo/playground/hmr-playground.tsx b/demo/playground/hmr-playground.tsx index 392ae12479..8bcf1d1b61 100644 --- a/demo/playground/hmr-playground.tsx +++ b/demo/playground/hmr-playground.tsx @@ -26,9 +26,12 @@ const specUrl = 'test.json'; let store; const options: RedocRawOptions = { - nativeScrollbars: false, disableSearch: true, + hideDownloadButton: true, + jsonSampleExpandLevel: 3, pathInMiddlePanel: true, + requiredPropsFirst: true, + sortPropsAlphabetically: true, theme: { spacing: { unit: 4, diff --git a/demo/test.json b/demo/test.json index ecd54e0abd..75c44d9447 100644 --- a/demo/test.json +++ b/demo/test.json @@ -1,1334 +1,6238 @@ { "info": { - "description": "# Introduction\n\n\nThe Delivery API is a read-only REST API that serves published content from your Kentico Cloud projects.\n\nUse the API to deliver large amounts of content to your website or app. The content is cached on the CDN level, which makes it quickly available from wherever you are. The Delivery API provides [content filtering](https://docs.kontent.ai/link-to/filtering_content) options that allow you to retrieve only the parts of the content you need.\n\nAll requests to the API must be made securely with HTTPS with [TLS 1.2](https://github.com/Kentico/delivery-sdk-net/wiki/Fixing-error:-Could-not-create-SSL-TLS-secure-channel).\n\n\n\n

API requests limits

\n

Requests made to the Delivery API count towards the overall API Calls limit set in our Fair Use Policy.

\n

This does NOT apply to Delivery Preview API calls to preview unpublished content.

\n\n\n\n# Production vs. Preview\n\n\nYou can work with the Delivery API in two ways – either retrieve published versions of content items or preview their yet unpublished versions. In both cases, you use the same methods to request data but with a different base URL.\n\nRetrieve **published** content items from your project using the **production** URL:\\\n`https://deliver.kenticocloud.com//items`\n\n**Note**: To protect your published content, use the Delivery API with [secure access](https://docs.kontent.ai/link-to/secure_access) enabled.\n\nPreview **unpublished** content items from your project using the **preview** URL:\\\n`https://preview-deliver.kenticocloud.com//items`\n\nIf you want to preview unpublished content in your project, you need to authorize your request.\n\n\n\n\n\n\n```\ncurl --request GET \\\n --url https://preview-deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items/on_roasts \\\n --header 'authorization: Bearer '\n```\n\n\n\n\n\n\n```javascript\n// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nclass Article extends KontentDelivery.ContentItem {\n constructor() {\n super();\n }\n}\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n previewApiKey: '',\n globalQueryConfig: {\n usePreviewMode: true, // Queries the Delivery Preview API.\n },\n typeResolvers: [\n new KontentDelivery.TypeResolver('article', (rawData) => new Article)\n ]\n});\n\ndeliveryClient.item('on_roasts')\n .toObservable()\n .subscribe(response => console.log(response));\n```\n\n\n\n\n\n\n```typescript\n// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { ContentItem, DeliveryClient, Elements, TypeResolver } from '@kentico/kontent-delivery';\n\n// Create strongly typed models according to https://docs.kenticocloud.com/tutorials/develop-apps/get-content/using-strongly-typed-models\nexport class Article extends ContentItem {\n public title: Elements.TextElement;\n public summary: Elements.TextElement;\n public post_date: Elements.DateTimeElement;\n public teaser_image: Elements.AssetsElement;\n public related_articles: Article[];\n}\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n previewApiKey: '',\n globalQueryConfig: {\n usePreviewMode: true, // Queries the Delivery Preview API.\n },\n typeResolvers: [\n new TypeResolver('article', (rawData) => new Article)\n ]\n});\n\ndeliveryClient.item
('on_roasts')\n .toObservable()\n .subscribe(response => console.log(response));\n```\n\n\n\n\n\n\n```csharp\n// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a delivery client for previewing content\nIDeliveryClient client = DeliveryClientBuilder\n .WithOptions(builder => builder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .UsePreviewApi(\"\")\n .Build())\n .Build();\n\n// Generate strongly typed models via https://github.com/Kentico/cloud-generators-net\nDeliveryItemResponse response = await client.GetItemAsync(\"on_roasts\");\n\nvar items = response.Items;\n```\n\n\n\n\n\n\n```java\n// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\", \"\");\n\nContentItem item = client.getItem(\"on_roasts\").item;\n```\n\n\n\n\n\n\n```java\n// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares an array to hold strongly-typed models\nList> typeResolvers = new ArrayList<>();\n\n// Registers the type resolver for articles\ntypeResolvers.add(new TypeResolver<>(Article.TYPE, new Function() {\n @Override\n public Article apply(Void input) {\n return new Article();\n }\n}));\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nString previewApiKey = \"\";\n\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId)\n .withTypeResolvers(typeResolvers)\n .withPreviewApiKey(previewApiKey);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets the latest version of an article using a simple request\nArticle article = deliveryService.
item(\"on_roasts\")\n .get()\n .getItem();\n\n// Gets the latest version of an article using RxJava2\ndeliveryService.
item(\"on_roasts\")\n .getObservable()\n .subscribe(new Observer>() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryItemResponse
response) {\n // Get the article\n Article item = response.getItem();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });\n```\n\n\n\n\n\n\n```swift\n// Tip: Find more about Swift SDK at https://docs.kontent.ai/ios\nimport KenticoCloud\n\nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\", apiKey: \"\")\n\n// More about strongly-typed models https://github.com/Kentico/cloud-sdk-swift#using-strongly-typed-models\nclient.getItem(modelType: Article.self, itemName: \"on_roasts\") { (isSuccess, itemResponse, error) in\n if isSuccess {\n if let article = itemResponse.item {\n // Use your item here\n }\n } else {\n if let error = error {\n print(error)\n }\n }\n}\n```\n\n\n\n\n\n\n```php\n');\n\n$item = $client->getItem('on_roasts');\n```\n\n\n\n\n\n\n```ruby\nrequire 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3',\n preview_key: ''\ndelivery_client.item('on_roasts').execute do |response|\n puts response.to_s\nend\n```\n\n\n\n\n\nFor the Delivery Preview API, you can use two concurrent API keys, Primary and Secondary. For more details on how to work with the keys, see [Previewing unpublished content](https://docs.kontent.ai/link-to/previewing_unpublished_content).\n\n# Authentication\n\n\nBy default, the Delivery API does not require authentication. However, if you enable [secure access](https://docs.kontent.ai/link-to/secure_access) for the Delivery API or use the Delivery Preview API, you need to authenticate your requests with valid API keys.\n\nTo work with the Delivery API with secure access enabled or the Delivery Preview API, send your requests over HTTPS and authenticate with an OAuth 2.0 [bearer token](https://tools.ietf.org/html/rfc6750) using the Authorization header.\n\n\n\n\n```http\nAuthorization: Bearer \n```\n\n\n\nTo get your API keys for the APIs, go to [Kentico Kontent](https://app.kontent.ai/) -> Project settings -> API keys. An API key provides access to a single Kentico Cloud project. You will need a different API key for each of your projects.\n\nCalls with an incorrect or missing Authorization header will fail with an error.\n\n# Errors\n\n\nKentico Kontent returns standard HTTP status codes to indicate success or failure of a request. In general, codes in the `2xx` range indicate a successful request, codes in the `4xx` range indicate errors caused by an incorrect input (for example, providing incorrect API key), and codes in the `5xx` range indicate an error on our side.\n\n## Error codes summary\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Status code**\n\n\n\n**Description**\n\n
\n\n400 **Bad Request**\n\nThe request was not understood. Check your request for a missing required parameter or an invalid query parameter value.
\n\n401 **Unauthorized**\n\nThe provided API key is invalid or missing.
\n\n403 **Forbidden**\n\nThe provided API key is invalid for the requested project.
\n\n404 **Not Found**\n\nThe requested resource doesn't exist. Try checking the resource name for typos.
\n\n405 **Method Not Allowed**\n\nThe requested HTTP method is not supported for the specified resource. Try performing a GET request.
\n\n500 **Internal Server Error**\n\nSomething went wrong on our side. Try the request again in a few minutes, or contact us.
\n\n## Resolving errors\n\n\nFor troubleshooting failed requests, the API provides error messages defined in a consumable format to help you identify and fix the issue.\n\n \n\nIf you cannot identify and resolve an issue with your API call, you can contact us with the response status and the unique error ID.\n", - "title": "Delivery API", - "version": "1" + "description": "The Management API is a secure REST API that provides read/write access to your Kentico Kontent projects.\n\n# Introduction\n\n\n\n\n

This API is in BETA

\n

For planned features, see our Roadmap. If you have any feedback on the API, let us know using the chat button in the bottom-right corner.

\n

For the current stable version of the API, see Management API v1.

\n\n\n\n\n\n

Premium feature 

\n

The Management API requires a Business plan or higher.

\n\n\n\nUse the API to migrate your existing content into your Kentico Kontent project, or update content in unpublished content items. Note that the API cannot be used on published content unless you create new versions of the content items first, either in UI or through the Management API.\n\nWhen retrieving and updating content via the Management API, you always work with the latest versions of content – the same as you would see in the Kentico Kontent user interface. Learn how to import content via the API by taking the tutorial on [Importing to Kentico Kontent](https://docs.kontent.ai/link-to/importing_to_kentico_kontent).\n\nThe base URL for all requests is `https://manage.kontent.ai/v2/projects/`.\n\nAll requests to the API must be made securely with HTTPS with [TLS 1.2](https://github.com/Kentico/delivery-sdk-net/wiki/Fixing-error:-Could-not-create-SSL-TLS-secure-channel \"A note on TLS 1.1 deprecation\") and [authenticated](#section/Authentication) with a valid API key. Requests to the API are [rate limited](https://docs.kontent.ai/link-to/rate_limiting) and uncached.\n\n\n\n

API requests limits

\n

The requests made to the Management API count towards the overall API calls limit set in our Fair Use Policy. For more information, see Pricing FAQ on our Kentico Kontent website.

\n\n\n\n\n\n\n```\ncurl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n```\n\n\n\n**Note**: The Management API does not provide any content filtering options and is not optimized for content delivery. If you need to deliver larger amounts of content, filter it, and leverage content caching, we recommend using the [Delivery API](https://docs.kontent.ai/link-to/delivery_api) instead.\n\n# Authentication\n\n\nTo work with the Management API, send your requests over HTTPS and authenticate using the `Authorization` header in the following format: `Authorization: Bearer `.\n\n# Errors\n\n\nThe Management API returns standard HTTP status codes to indicate success or failure of a request. In general, status codes in the `2xx` range indicate a successful request, status codes in the `4xx` range indicate errors caused by an incorrect input (for example, providing incorrect API key), and status codes in the `5xx` range indicate an error on our side.\n\n## HTTP status codes summary\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**HTTP status code**\n\n\n\n**Description**\n\n
\n\n`400` **Bad request**\n\nThe request was not understood. Check your request for missing required parameters or invalid query parameter values.
\n\n`401` **Unauthorized**\n\nThe provided API key is invalid or missing.
\n\n`403` **Forbidden**\n\nThe provided API key is invalid for the requested project.
\n\n`404` **Not found**\n\nThe requested resource doesn't exist. Try checking the path for typos.
\n\n`405` **Method not allowed**\n\nThe requested HTTP method is not supported for the specified resource. Try performing a GET request.
\n\n`429` **Too many requests**\n\nThe rate limit for the API has been exceeded. Try your request again after a few seconds.
\n\n`500` **Internal Server Error**\n\nSomething went wrong on our side. Try the request again in a few minutes, or contact us.
\n\n## Resolving errors\n\n\nFor troubleshooting failed requests, the API provides error messages defined in a consumable format to help you identify and fix the issue.\n\n \n\nIf you cannot identify and resolve an issue with your API call, you can contact us with the response status and the request ID you get in the error response.\n", + "title": "Management API v2", + "version": "2" }, "openapi": "3.0.2", - "x-api-status": "beta", "paths": { "/{project_id}/items": { - "get": { - "description": "Retrieve a list of content items in your project. By default, the API returns an unfiltered paginated list of content items that is ordered alphabetically by codename.\n\nIf you need to export all content items from your project, we recommend using the [Enumerate content item](https://docs.kontent.ai/link-to/enumerate_content_items) endpoint.\n\nYou can change the order by specifying the `order` query parameter. You can customize pagination by using the `skip` and `limit` query parameters.\n\n\n\n

Filtering content items

\n

Using the filtering parameters and operators, you can retrieve only a specific set of content items, such as items tagged with a specific term, items of a specific type, items modified in the last three days. Learn more about the parameters and operators in filtering content.

\n\n\n", - "operationId": "list-content-items", + "post": { + "description": "Create a new content item based on a specific content type. Content items do NOT contain any content themselves but serve as wrappers for individual language variants.\n\nTo import content to a specific [language variant](https://docs.kontent.ai/link-to/language_variants) of a content item, you can [upsert a language variant](https://docs.kontent.ai/link-to/upsert_a_language_variant).\n\nIf you are importing content from a different system and want to use the same identifiers for your content as in the previous system, use the `external_id` property to set a custom identifier for the new content item.\n", + "operationId": "add-a-content-item", "parameters": [{ "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a content item", + "tags": ["Content items"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentItem" + }, + "example": { + "name": "On Roasts", + "codename": "my_article_on_roasts", + "type": { + "codename": "article" + }, + "external_id": "59713" + } + } + }, + "description": "The content item to be added.\n", + "required": true + }, + "responses": { + "201": { + "description": "The content item was created.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentItem" + }, + "example": { + "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474", + "name": "On Roasts", + "codename": "my_article_on_roasts", + "type": { + "id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89" + }, + "sitemap_locations": [{ + "id": "45a123f3-1c55-c697-7dae-78369c8f1e2c" + }], + "external_id": "59713", + "last_modified": "2017-04-04T13:45:30.7692802Z" + } + } + } + }, + "400": { + "description": "The specified request body is invalid or the item already exists.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "e6368434-e500-48b4-9ffe-3cd3c0f53ac9", + "error_code": 0, + "message": "Provide ID of content item's content type." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"name\": \"On Roasts\",\n \"codename\": \"my_article_on_roasts\",\n \"type\": {\n \"codename\": \"article\"\n },\n \"external_id\": \"59713\"\n}'" }, { - "$ref": "#/components/parameters/language" - }, { - "$ref": "#/components/parameters/elements" - }, { - "$ref": "#/components/parameters/order" - }, { - "$ref": "#/components/parameters/depth" + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addContentItem()\n .withData(\n {\n name: 'On Roasts',\n codename: 'my_article_on_roasts',\n type: {\n codename: 'article'\n },\n external_id: '59713'\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "$ref": "#/components/parameters/skip" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nContentItemCreateModel item = new ContentItemCreateModel\n{\n Name = \"On Roasts\",\n Type = ContentTypeIdentifier.ByCodename(\"article\"),\n ExternalId = \"59713\"\n};\n\nContentItemModel responseItem = await client.CreateContentItemAsync(item);" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of content items.\n", + "operationId": "list-content-items", + "parameters": [{ + "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/limit_8cd54e2" + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/x_continuation_4a04ea9" }], "summary": "List content items", "tags": ["Content items"], "responses": { "200": { - "description": "A paginated list of content items matching the specified criteria.\n", + "description": "A dynamically paginated list of content items.\n", "content": { "application/json": { "schema": { - "required": ["items", "modular_content", "pagination"], + "required": ["items", "pagination"], "properties": { "items": { - "description": "A list of content items.\n", + "description": "List of content items.\n", "items": { "$ref": "#/components/schemas/ContentItem" }, "uniqueItems": true, "type": "array" }, - "modular_content": { - "description": "A dictionary of [components and linked items](https://docs.kontent.ai/link-to/linked_content_and_components).\n", - "additionalProperties": { - "0": "#", - "x-additionalPropertiesName": "" - }, - "type": "object" - }, "pagination": { - "$ref": "#/components/schemas/Pagination" + "$ref": "#/components/schemas/pagination" } }, "type": "object" }, "example": { "items": [{ - "system": { - "id": "3120ec15-a4a2-47ec-8ccd-c85ac8ac5ba5", - "name": "Which brewing fits you?", - "codename": "which_brewing_fits_you_", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:24:54.042Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Which brewing fits you?" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "We have put down three procedures with clearly written steps describing the process of making coffee. Read this article to convince yourself that brewing coffee is no science" - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-10-27T00:00:00Z" - } - } - }, { - "system": { - "id": "117cdfae-52cf-4885-b271-66aef6825612", - "name": "Coffee processing techniques", - "codename": "coffee_processing_techniques", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:13:35.312Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Coffee processing techniques" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "Learn about the techniques of processing the products of coffee plants. Different methods are used in different parts of the world depending mainly on their weather conditions." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-02T00:00:00Z" - } - } - }, { - "system": { - "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474", - "name": "On Roasts", - "codename": "on_roasts", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:21:11.38Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "On Roasts" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "Roasting coffee beans can take from 6 to 13 minutes. Different roasting times produce different types of coffee, with varying concentration of caffeine and intensity of the original flavor." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-07T00:00:00Z" - } - } - }, { - "system": { - "id": "b2fea94c-73fd-42ec-a22f-f409878de187", - "name": "Origins of Arabica Bourbon", - "codename": "origins_of_arabica_bourbon", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:21:49.151Z" + "id": "a815faa5-009e-489b-b8bb-a7f3dda0e047", + "name": "Office in Australia", + "codename": "office_in_australia", + "type": { + "id": "e097306b-3893-4a42-9973-2525fad14d66" }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Origins of Arabica Bourbon" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "This one particular type of coffee, the Arabica Bourbon, is now sold only in Japan. It has been brought back to life by enthusiasts after being almost forgotten for nearly sixty years." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-11T00:00:00Z" - } - } + "sitemap_locations": [{ + "id": "aac5fdf9-5179-f788-8225-3bcee3093aa4" + }, { + "id": "22110d88-4b92-32a0-db61-9b8dbe401920" + }], + "last_modified": "2016-10-20T10:50:51.0110853Z" }, { - "system": { - "id": "23f71096-fa89-4f59-a3f9-970e970944ec", - "name": "Donate with us", - "codename": "donate_with_us", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:14:07.384Z" + "id": "69f5c2f3-7efd-46cb-9adc-4fd0200f81cc", + "name": "Melbourne", + "codename": "melbourne", + "type": { + "id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2" }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Donate with us" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "Dancing Goat regularly donates money to Children in Africa, a foundation helping children with food, accommodation, education, and other essentials. Donate with us and create a better world." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-12T00:00:00Z" - } - } + "sitemap_locations": [{ + "id": "a60fe91c-88ea-6990-fe3b-cf8f8504cd33" + }, { + "id": "98c9e0f1-b6f7-510d-522a-0d39fc62aa1a" + }], + "last_modified": "2016-09-01T08:36:30.1564913Z" }, { - "system": { - "id": "cf106f4e-30a4-42ef-b313-b8ea3fd3e5c5", - "name": "Coffee Beverages Explained", - "codename": "coffee_beverages_explained", - "language": "en-US", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-03-27T13:12:58.578Z" + "id": "e844a6aa-4dc4-464f-8ae9-f9f66cc6ab61", + "name": "Amsterdam", + "codename": "amsterdam", + "type": { + "id": "fe41ae5a-5fe2-420a-8560-f7d6d3533dc2" }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Coffee Beverages Explained" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "Espresso and filtered coffee are the two main categories of coffee, based on the method of preparation. Learn about individual types of coffee that fall under these categories." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-18T00:00:00Z" - } - } + "sitemap_locations": [{ + "id": "ef86a740-9e4c-0b33-4275-ae78558e71a7" + }, { + "id": "a65962ef-fccc-2112-956b-e831bb86dec0" + }, { + "id": "a60fe91c-88ea-6990-fe3b-cf8f8504cd33" + }], + "last_modified": "2016-09-01T08:25:04.4666023Z" }], - "modular_content": {}, "pagination": { - "skip": 0, - "limit": 0, - "count": 6, - "next_page": "" + "continuation_token": "MTAw", + "next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items?continuationToken=MTAw" } } } } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items?system.type=article&elements=title%2Csummary%2Cpost_date&order=elements.post_date' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nclass Article extends KontentDelivery.ContentItem {\n constructor() {\n super();\n }\n}\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n typeResolvers: [\n new KontentDelivery.TypeResolver('article', (rawData) => new Article())\n ]\n});\n\ndeliveryClient.items()\n .type('article')\n .elementsParameter(['title', 'summary', 'post_date'])\n .orderParameter('elements.post_date', KontentDelivery.SortOrder.desc)\n .toObservable()\n .subscribe(response => console.log(response));" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listContentItems()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { ContentItem, DeliveryClient, Elements, SortOrder, TypeResolver } from '@kentico/kontent-delivery';\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nexport class Article extends ContentItem {\n public title: Elements.TextElement;\n public summary: Elements.TextElement;\n public post_date: Elements.DateTimeElement;\n public teaser_image: Elements.AssetsElement;\n public related_articles: Article[];\n}\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n typeResolvers: [\n new TypeResolver('article', (rawData) => new Article)\n ]\n});\n\ndeliveryClient.items
()\n .type('article')\n .elementsParameter(['title', 'summary', 'post_date'])\n .orderParameter('elements.post_date', SortOrder.desc)\n .toObservable()\n .subscribe(response => console.log(response));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets specific elements of 3 articles ordered by the \"Post date\" element\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nDeliveryItemListingResponse
response = await client.GetItemsAsync
(\n new EqualsFilter(\"system.type\", \"article\"),\n new ElementsParameter(\"title\", \"summary\", \"post_date\"),\n new OrderParameter(\"elements.post_date\", SortOrder.Descending)\n );\n\nvar items = response.Items;" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nList params = DeliveryParameterBuilder.params()\n .filterEquals(\"system.type\", \"article\")\n .projection(\"title\", \"summary\", \"post_date\")\n .orderByDesc(\"elements.post_date\")\n .build();\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nList items = client.getItems(ArticleItem.class, params);" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares an array to hold strongly-typed models\nList> typeResolvers = new ArrayList<>();\n\n// Registers the type resolver for articles\ntypeResolvers.add(new TypeResolver<>(Article.TYPE, new Function() {\n @Override\n public Article apply(Void input) {\n return new Article();\n }\n}));\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId)\n .withTypeResolvers(typeResolvers);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets specific elements of 3 articles ordered by the \"Post date\" element using a simple request\nList
articles = deliveryService.
items()\n .equalsFilter(\"system.type\", \"article\")\n .elementsParameter(Arrays.asList(\"title\", \"summary\", \"post_date\"))\n .orderParameter(\"elements.post_date\", OrderType.Desc)\n .get()\n .getItems();\n\n// Gets specific elements of 3 articles ordered by the \"Post date\" element using RxJava2\ndeliveryService.
items()\n .equalsFilter(\"system.type\", \"article\")\n .elementsParameter(Arrays.asList(\"title\", \"summary\", \"post_date\"))\n .orderParameter(\"elements.post_date\", OrderType.Desc)\n .getObservable()\n .subscribe(new Observer>() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryItemListingResponse
response) {\n // Gets the mapped articles\n List
articles = response.getItems();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" - }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDK at https://docs.kontent.ai/ios\nimport KenticoCloud\n \nlet client = DeliveryClient.init(projectId:\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n \nlet customQuery = \"items?system.type=article&elements=title,summary,post_date&order=elements.post_date[desc]\"\nclient.getItems(modelType: Article.self, customQuery: customQuery) { (isSuccess, itemsResponse, error) in\n if isSuccess {\n if let articles = itemsResponse?.items {\n // Use your items here\n }\n } else {\n if let error = error {\n print(error)\n }\n }" - }, { - "lang": "PHP", - "source": "getItems((new QueryParams())\n ->equals('system.type', 'article')\n ->elements(array('title', 'summary', 'post_date'))\n ->orderDesc('elements.post_date'));" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.items('system.type'.eq('article'))\n .order_by('elements.post_date', '[desc]')\n .elements(%w[title summary post_date])\n .execute do |response|\n items = response.items\n end" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nListingResponseModel responseItems = await client.ListContentItemsAsync();" }] } }, - "/{project_id}/item/{item_codename}": { + "/{project_id}/items/{item_identifier}": { "get": { - "description": "Retrieve a specific content item by specifying its codename.\n\n**Note**: Any change to a content item name affects the codename. To retrieve an updated content item, adjust its codename in the API request.\n", + "description": "Retrieve metadata about a content item.\n\nIf you want to retrieve content data, see how to [retrieve language variants of a content item](https://docs.kontent.ai/link-to/retrieve_variants_of_an_item).\n", "operationId": "retrieve-a-content-item", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/item_codename" - }, { - "$ref": "#/components/parameters/language" - }, { - "$ref": "#/components/parameters/elements" - }, { - "$ref": "#/components/parameters/depth" - }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/item_identifier_dc3e32b" }], "summary": "Retrieve a content item", "tags": ["Content items"], "responses": { "200": { - "description": "A single content item object.\n", + "description": "The specified content item.\n", "content": { "application/json": { "schema": { - "required": ["item", "modular_content"], - "properties": { - "item": { - "$ref": "#/components/schemas/ContentItem" - }, - "modular_content": { - "description": "The collection of related Content item objects (including component objects).\n", - "additionalProperties": { - "$ref": "#/components/schemas/ContentItem" - }, - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/ContentItem" }, "example": { - "item": { - "system": { - "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474", - "name": "On Roasts", - "codename": "on_roasts", - "language": "default", - "type": "article", - "sitemap_locations": ["articles"], - "last_modified": "2016-10-20T12:03:48.4628352Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "On Roasts" - }, - "summary": { - "type": "text", - "name": "Summary", - "value": "Roasting coffee beans can take from 6 to 13 minutes. Different roasting times produce different types of coffee, with varying concentration of caffeine and intensity of the original flavor." - }, - "post_date": { - "type": "date_time", - "name": "Post date", - "value": "2014-11-07T00:00:00Z" - }, - "teaser_image": { - "type": "asset", - "name": "Teaser image", - "value": [{ - "name": "on-roasts-1080px.jpg", - "type": "image/jpeg", - "size": 0, - "description": null, - "url": "https://assets-us-01.kc-usercontent.com/5859c8b2-f64d-405f-a306-d65dd5b1da04/f6daed1f-3f3b-4036-a9c7-9519359b9601/on-roasts-1080px.jpg" - }] - }, - "related_articles": { - "type": "modular_content", - "name": "Related articles", - "value": ["coffee_processing_techniques", "origins_of_arabica_bourbon"] - } - } + "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474", + "name": "On Roasts", + "codename": "on_roasts", + "type": { + "id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89" }, - "modular_content": {} + "sitemap_locations": [{ + "id": "45a123f3-1c55-c697-7dae-78369c8f1e2c" + }], + "external_id": "59713", + "last_modified": "2017-04-04T13:45:30.7692802Z" } } } }, "404": { - "description": "The specified content item is not published or was deleted.\n", + "description": "The specified content item was not found.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { - "message": "The requested content item 'on_roasts' was not found.", - "request_id": "|657e8eba55d8bf4a9a5ad9074038cd2e.813e828d_", + "request_id": "00000000-0000-0000-8918-0080000000cd", "error_code": 100, - "specific_code": 0 + "message": "The requested content item '59713' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items/on_roasts?elements=title%2Csummary%2Cpost_date%2Cteaser_image%2Crelated_articles' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nclass Article extends KontentDelivery.ContentItem {\n constructor() {\n super();\n }\n}\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n typeResolvers: [\n new KontentDelivery.TypeResolver('article', (rawData) => new Article())\n ]\n});\n\ndeliveryClient.item('on_roasts')\n .elementsParameter(['title', 'summary', 'post_date', 'teaser_image', 'related_articles'])\n .toObservable()\n .subscribe(response => console.log(response.item));" - }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { ContentItem, DeliveryClient, Elements, TypeResolver } from '@kentico/kontent-delivery';\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nexport class Article extends ContentItem {\n public title: Elements.TextElement;\n public summary: Elements.TextElement;\n public post_date: Elements.DateTimeElement;\n public teaser_image: Elements.AssetsElement;\n public related_articles: Article[];\n}\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',\n typeResolvers: [\n new TypeResolver('article', (rawData) => new Article)\n ]\n});\n\ndeliveryClient.item
('on_roasts')\n .elementsParameter(['title', 'summary', 'post_date', 'teaser_image', 'related_articles'])\n .toObservable()\n .subscribe(response => console.log(response.item));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets specific elements of an article\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nDeliveryItemResponse
response = await client.GetItemAsync
(\"on_roasts\",\n new ElementsParameter(\"title\", \"summary\", \"post_date\", \"teaser_image\", \"related_articles\")\n );\n\nArticle item = response.Item;" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nList params = DeliveryParameterBuilder.params().projection(\"title\", \"summary\", \"post_date\", \"teaser_image\", \"related_articles\").build();\n\n// Create strongly typed models according to https://docs.kontent.ai/strongly-typed-models\nArticleItem item = client.getItem(\"on_roasts\", ArticleItem.class, params);" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares an array to hold strongly-typed models\nList> typeResolvers = new ArrayList<>();\n\n// Registers the type resolver for articles\ntypeResolvers.add(new TypeResolver<>(Article.TYPE, new Function() {\n @Override\n public Article apply(Void input) {\n return new Article();\n }\n}));\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId)\n .withTypeResolvers(typeResolvers);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets specific elements of an article using a simple request\nArticle article = deliveryService.
item(\"on_roasts\")\n .elementsParameter(Arrays.asList(\"title\", \"summary\", \"post_date\", \"teaser_image\", \"related_articles\"))\n .get()\n .getItem();\n\n// Gets specific elements of an article using RxJava2\ndeliveryService.
item(\"on_roasts\")\n .elementsParameter(Arrays.asList(\"title\", \"summary\", \"post_date\", \"teaser_image\", \"related_articles\"))\n .getObservable()\n .subscribe(new Observer>() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryItemResponse
response) {\n // Gets the article\n Article article = response.getItem();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewContentItem()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDKs at https://docs.kontent.ai/ios\nimport KenticoCloud\n\nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\")\n\nlet customQuery = \"items/on_roasts?elements=title,summary,post_date,teaser_image,related_articles\"\nclient.getItem(modelType: Article.self, customQuery: customQuery) { (isSuccess, deliveryItem, error) in\n if isSuccess {\n if let article = deliveryItem.item {\n // Use your item here\n }\n } else {\n if let error = error {\n print(error)\n }\n }" - }, { - "lang": "PHP", - "source": "getItem('on_roasts', (new QueryParams())\n ->elements(array('title', 'summary', 'post_date','teaser_image', 'related_articles')));" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.item('on_roasts')\n .elements(%w[title summary post_date teaser_image related_articles])\n .execute do |response|\n item = response.item\n end" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nContentItemIdentifier identifier = ContentItemIdentifier.ById(Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\"));\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByExternalId(\"59713\");\n\nContentItemModel responseItem = await client.GetContentItemAsync(identifier);" }] - } - }, - "/{project_id}/items-feed": { - "get": { - "description": "Retrieve a dynamically paginated list of content items in your project. The items are ordered alphabetically by codename.\n\nIf the response comes with the `X-Continuation` header, it means that there are more pages to retrieve. To get the next page of results, send the `X-Continuation` header with your request as you received it.\n\nThis endpoint, unlike the [List content items](https://docs.kontent.ai/link-to/list_content_items) endpoint, guarantees enumerating all items in the specified project. We recommend using this endpoint for warming up your app's cache (i.e., getting all content into the cache after the app starts) or for exporting content of your project.\n\n\n\n

Filtering content items

\n

Using the filtering parameters and operators, you can retrieve only a specific set of content items, such as items tagged with a specific term, items of a specific type, items modified in the last three days. Learn more about the parameters and operators in filtering content.

\n\n\n", - "operationId": "enumerate-content-items", + }, + "put": { + "description": "Update an existing content item or add a new content item specified by its external ID.\n\nYou can also specify the external ID when [adding content items](https://docs.kontent.ai/link-to/add_a_content_item).\n", + "operationId": "upsert-a-content-item", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/language" - }, { - "$ref": "#/components/parameters/elements" - }, { - "$ref": "#/components/parameters/order" - }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" - }, { - "$ref": "#/components/parameters/x_continuation" + "$ref": "#/components/parameters/item_identifier_for_upsert" }], - "summary": "Enumerate content items", + "summary": "Upsert a content item", "tags": ["Content items"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [{ + "$ref": "#/components/schemas/UpdateItem" + }, { + "$ref": "#/components/schemas/CreateItem" + }] + } + } + }, + "description": "The content item to update or create.\n", + "required": true + }, "responses": { "200": { - "description": "A dynamically paginated feed of content items and components.\n", + "description": "The updated content item.\n", "content": { "application/json": { "schema": { - "required": ["items", "modular_content"], - "properties": { - "items": { - "description": "A list of content items\n", - "items": { - "$ref": "#/components/schemas/ContentItem" - }, - "uniqueItems": true, - "type": "array" - }, - "modular_content": { - "description": "A list of components used in rich text elements. See [Linked content and components](https://docs.kontent.ai/link-to/linked_content_and_components) for more details.\n", - "additionalProperties": { - "0": "#", - "x-additionalPropertiesName": "" - }, - "type": "object" - } + "$ref": "#/components/schemas/ContentItem" + }, + "example": { + "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474", + "name": "On Roasts", + "codename": "my_article_on_roasts", + "type": { + "id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89" }, - "type": "object" + "sitemap_locations": [], + "external_id": "59713", + "last_modified": "2017-04-04T13:45:30.7692802Z" + } + } + } + }, + "201": { + "description": "The specified content item was created.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentItem" }, "example": { - "items": [{ - "system": { - "id": "b69ed774-8fb2-4413-8d12-d4c193a66f7a", - "name": "Getting content", - "codename": "getting_content", - "language": "default", - "type": "article", - "sitemap_locations": [], - "last_modified": "2019-09-12T07:11:43.2391249Z" - }, - "elements": { - "title": { - "type": "text", - "name": "Title", - "value": "Getting content" - }, - "introduction": { - "type": "rich_text", - "name": "Introduction", - "images": {}, - "links": {}, - "modular_content": [], - "value": "

While your copywriters write articles and add finishing touches to the content in your project, you can deliver that content to web and mobile applications via an API. In this tutorial, you'll learn how to retrieve your content from Kentico Kontent using the Delivery API.

" - }, - "content": { - "type": "rich_text", - "name": "Content", - "images": {}, - "links": {}, - "modular_content": [], - "value": "

The Delivery API is a read-only REST API that can serve your content in two modes: public and preview.

" - } - } + "id": "b96829e8-c00d-447f-8da8-cf4982f704fd", + "name": "Hario Skeleton Hand Grinder", + "codename": "grinder_hario_skeleton", + "type": { + "id": "da4f1cb1-8a55-43e5-9fcc-67ad331c8888" + }, + "sitemap_locations": [{ + "id": "45a123f3-1c55-c697-7dae-78369c8f1e2c" }], - "modular_content": {} + "external_id": "59713", + "last_modified": "2017-09-18T06:16:15.8299043Z" + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-8805-0080000000bf", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Property 'id' must be a valid Guid identifier.", + "path": "type", + "line": 6, + "position": 2 + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "# The 'type' property in the request body is only required when creating a new content item\ncurl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"name\": \"On Roasts\",\n \"codename\": \"my_article_on_roasts\",\n \"type\": {\n \"codename\": \"article\"\n },\n \"sitemap_locations\": [\n {\n \"codename\": \"articles\"\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\n// Used when updating an existing item\nclient.updateContentItem()\n.byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n// .byItemCodename('on_roasts')\n// .byItemExternalId('59713')\n.withData(\n {\n name: 'On Roasts',\n codename: 'my_article_on_roasts',\n sitemap_locations: [\n {\n codename: 'articles'\n }\n ]\n }\n)\n.toObservable()\n.subscribe((response) => {\n console.log(response);\n},\n (error) => {\n console.log(error);\n });\n\n// Used when creating a new item or updating an existing one\nclient.upsertContentItem()\n .byItemExternalId('59713')\n // .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n .withData(\n {\n name: 'On Roasts',\n codename: 'my_article_on_roasts',\n // 'type' is only required when creating a new content item\n type: 'article',\n sitemap_locations: [\n {\n codename: 'articles'\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\n// Note: When creating a new item, use external ID as an identifier. When updating a content item, use any of the 3 identifiers below.\nContentItemIdentifier identifier = ContentItemIdentifier.ByExternalId(\"59713\");\n// ContentItemIdentifier identifier = ContentItemIdentifier.ById(Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\"));\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n\nContentItemUpdateModel itemToUpdate = new ContentItemUpdateModel()\n{\n Name = \"On Roasts\",\n \tSitemapLocations = new[] { SitemapNodeIdentifier.ByCodename(\"articles\") }\n};\n\nContentItemUpsertModel itemToCreate = new ContentItemUpsertModel()\n{\n Name = \"On Roasts\",\n // 'Type' is only required when creating a new content item\n Type = ContentTypeIdentifier.ByCodename(\"article\"),\n \tSitemapLocations = new[] { SitemapNodeIdentifier.ByCodename(\"articles\") }\n};\n\nContentItemModel updatedItemResponse = await client.UpdateContentItemAsync(identifier, itemToUpdate);\nContentItemModel createdItemResponse = await client.UpsertContentItemByExternalIdAsync(identifier, itemToCreate);" + }] + }, + "delete": { + "description": "Delete a content item.\n\n**Note**: Deleting a content item deletes all of its language variants as well. If you only want to delete a specific language variant, see how to [delete a language variant](https://docs.kontent.ai/link-to/delete_a_language_variant).\n", + "operationId": "delete-a-content-item", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }], + "summary": "Delete a content item", + "tags": ["Content items"], + "responses": { + "204": { + "description": "The specified content item was deleted from the project.\n" + }, + "404": { + "description": "The specified content item was already deleted or doesn't exist.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "2d2803b7-9b67-4bd8-b3d2-436aa077827f", + "error_code": 100, + "message": "The requested content item 'f4b3fc05-e988-4dae-9ac1-a94aba566474' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/items-feed?system.type=article&elements=title%2Csummary%2Cpost_date&order=elements.post_date' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474 \\\n# --url https://manage.kontent.ai/v2/projects/f4b3fc05-e988-4dae-9ac1-a94aba566474/items/codename/on_roasts \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.deleteContentItem()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59714')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing KenticoCloud.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets feed for specific elements of articles ordered by the \"Post date\" element\n// Create strongly typed models according to https://developer.kenticocloud.com/docs/strongly-typed-models\nDeliveryItemsFeed
feed = client.GetItemsFeed
(\n new EqualsFilter(\"system.type\", \"article\"),\n new ElementsParameter(\"title\", \"summary\", \"post_date\"),\n new OrderParameter(\"elements.post_date\", SortOrder.Descending)\n );\n\nwhile (feed.HasMoreResults)\n{\n DeliveryItemsFeedResponse
response = await feed.FetchNextBatchAsync();\n foreach(Article article in response) {\n // Do something with the content item, e.g. update cache\n ProcessContentItem(article);\n }\n}" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nContentItemIdentifier identifier = ContentItemIdentifier.ById(Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\"));\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByExternalId(\"59713\");\n\nawait client.DeleteContentItemAsync(identifier);" }] } }, - "/{project_id}/types/{type_codename}/elements/{element_codename}": { + "/{project_id}/items/{item_identifier}/variants": { "get": { - "description": "Retrieve a specific content element by specifying the content type it's used in and the element codename.\n", - "operationId": "retrieve-a-content-element", + "description": "Retrieve a list of language variants of a content item.\n\nIf you want to retrieve metadata information about the parent content item, see how to [Retrieve a content item](https://docs.kontent.ai/link-to/retrieve_a_content_item_94197e9).\n", + "operationId": "retrieve-language-variants-of-an-item", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/type_codename" - }, { - "$ref": "#/components/parameters/element_codename" - }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/item_identifier_dc3e32b" }], - "summary": "Retrieve a content element", - "tags": ["Content elements"], + "summary": "Retrieve language variants of an item", + "tags": ["Language variants"], "responses": { "200": { - "description": "A content element object\n", + "description": "Array of language variants for the specified content item.\n", "content": { "application/json": { "schema": { - "oneOf": [{ - "$ref": "#/components/schemas/UrlSlugInItem" - }, { - "$ref": "#/components/schemas/TaxonomyInItem" - }, { - "$ref": "#/components/schemas/AssetInItem" - }, { - "$ref": "#/components/schemas/MultipleChoiceInItem" - }, { - "$ref": "#/components/schemas/DateTimeInItem" - }, { - "$ref": "#/components/schemas/RichTextInItem" - }, { - "$ref": "#/components/schemas/LinkedItemsInItem" - }, { - "$ref": "#/components/schemas/NumberInItem" - }, { - "$ref": "#/components/schemas/CustomElementInItem" - }, { - "$ref": "#/components/schemas/Text" - }] + "description": "List of language variants.\n", + "items": { + "$ref": "#/components/schemas/LanguageVariant" + }, + "uniqueItems": true, + "type": "array" + } + } + } + }, + "404": { + "description": "The specified content item was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" }, "example": { - "type": "taxonomy", - "name": "Processing", - "taxonomy_group": "processing", - "codename": "processing" + "request_id": "00000000-0000-0000-9105-0080000000bf", + "error_code": 100, + "message": "The requested content item '4db9f4da-827b-4400-87c9-c47d44fba65d' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/types/coffee/elements/processing' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants \\ \n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.element('coffee', 'processing')\n .toObservable()\n .subscribe(response => console.log(response));" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listLanguageVariantsOfItem()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { DeliveryClient } from '@kentico/kontent-delivery';\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.element('coffee', 'processing')\n .toObservable()\n .subscribe(response => console.log(response));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets the model of specific element within a specific content type\nContentElement element = await client.GetContentElementAsync(\"coffee\", \"processing\");" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nElement element = client.getContentTypeElement(\"coffee\", \"processing\");" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets the \"Processing\" content element from the \"Coffee\" type using a simple request\nContentTypeElement element = deliveryService.contenTypeElement(\"coffee\", \"processing\")\n .get()\n .getElement();\n\n// Gets the \"Processing\" content element from the \"Coffee\" type using RxJava2\ndeliveryService.contenTypeElement(\"coffee\", \"processing\")\n .getObservable()\n .subscribe(new Observer() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryContentTypeElementResponse response) {\n // Gets the content element\n ContentTypeElement element = response.getElement();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" - }, { - "lang": "PHP", - "source": "getElement('coffee', 'processing');" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.element('coffee', 'processing').execute do |response|\n ele = response.element\nend" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nContentItemIdentifier identifier = ContentItemIdentifier.ById((Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\")));\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n// ContentItemIdentifier identifier = ContentItemIdentifier.ByExternalId(\"59713\");\n\nIEnumerable> responseVariants = await client.ListContentItemVariantsAsync(identifier);" }] } }, - "/{project_id}/types": { + "/{project_id}/types/{type_identifier}/variants": { "get": { - "description": "Retrieve a paginated list of content types in your project. By default, the API returns all content types ordered alphabetically by codename. You can customize pagination by using the `skip` and `limit` query parameters.\n", - "operationId": "list-content-types", + "description": "Retrieve a dynamically paginated list of language variants for a specified content type.\n", + "operationId": "list-language-variants-for-a-specific-content-type", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/elements" - }, { - "$ref": "#/components/parameters/skip" + "$ref": "#/components/parameters/type_identifier_for_variants" }, { - "$ref": "#/components/parameters/limit_8cd54e2" + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/x_continuation_4a04ea9" }], - "summary": "List content types", - "tags": ["Content types"], + "summary": "List language variants for a specific content type", + "tags": ["Language variants"], "responses": { "200": { - "description": "A list of content types\n", + "description": "A dynamically paginated list of language variants based on the specified content type.\n", "content": { "application/json": { "schema": { - "required": ["types", "pagination"], + "required": ["variants", "pagination"], "properties": { - "types": { + "variants": { + "description": "List of language variants.\n", "items": { - "$ref": "#/components/schemas/ContentType" + "$ref": "#/components/schemas/LanguageVariant" }, "uniqueItems": true, "type": "array" }, "pagination": { - "$ref": "#/components/schemas/Pagination" + "$ref": "#/components/schemas/pagination" } }, "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + }, + "404": { + "description": "The specified content type was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" }, "example": { - "types": [{ - "system": { - "id": "b2c14f2c-6467-460b-a70b-bca17972a33a", - "name": "About us", - "codename": "about_us", - "last_modified": "2017-08-02T07:33:28.2997578Z" - }, - "elements": { - "facts": { - "type": "modular_content", - "name": "Facts" - }, - "url_pattern": { - "type": "url_slug", - "name": "URL pattern" - } - } - }, { - "system": { - "id": "d9748663-f567-4c51-a922-c24a1d6b935a", - "name": "Accessory", - "codename": "accessory", - "last_modified": "2017-08-02T07:33:39.3620325Z" - }, - "elements": { - "product_name": { - "type": "text", - "name": "Product name" - }, - "price": { - "type": "number", - "name": "Price" - }, - "image": { - "type": "asset", - "name": "Image" - }, - "manufacturer": { - "type": "text", - "name": "Manufacturer" - }, - "product_status": { - "type": "taxonomy", - "name": "Product status", - "taxonomy_group": "product_status" - }, - "short_description": { - "type": "rich_text", - "name": "Short description" - }, - "long_description": { - "type": "rich_text", - "name": "Long description" - }, - "url_pattern": { - "type": "url_slug", - "name": "URL pattern" - } - } - }, { - "system": { - "id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89", - "name": "Article", - "codename": "article", - "last_modified": "2017-08-02T07:33:19.8599559Z" - }, - "elements": { - "personas": { - "type": "taxonomy", - "name": "Personas", - "taxonomy_group": "personas" - }, - "title": { - "type": "text", - "name": "Title" - }, - "teaser_image": { - "type": "asset", - "name": "Teaser image" - }, - "post_date": { - "type": "date_time", - "name": "Post date" - }, - "summary": { - "type": "text", - "name": "Summary" - }, - "body_copy": { - "type": "rich_text", - "name": "Body Copy" - }, - "related_articles": { - "type": "modular_content", - "name": "Related articles" - }, - "meta_keywords": { - "type": "text", - "name": "Meta keywords" - }, - "meta_description": { - "type": "text", - "name": "Meta description" - }, - "url_pattern": { - "type": "url_slug", - "name": "URL pattern" - } - } - }], - "pagination": { - "skip": 0, - "limit": 3, - "count": 3, - "next_page": "https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/types?limit=3&skip=3" - } + "request_id": "|34b4f5ab4fb3f54bbd72877d98f3121c.d1a27a5_", + "error_code": 0, + "message": "The requested content item 'getting_contents' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/types?limit=3' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89/variants \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/codename/article/variants \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.types()\n .limitParameter(3)\n .toObservable()\n .subscribe(response => console.log(response.types));" - }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { DeliveryClient } from '@kentico/kontent-delivery';\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.types()\n .limitParameter(3)\n .toObservable()\n .subscribe(response => console.log(response.types));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets 3 content types\nDeliveryTypeListingResponse response = await client.GetTypesAsync(\n new LimitParameter(3)\n );\n\nvar types = response.Types;" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nList params = DeliveryParameterBuilder.params().page(null, 3).build();\nContentTypesListingResponse types = client.getTypes(params);" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets 3 content types using a simple request\nList types = deliveryService.types()\n .limitParameter(3)\n .get()\n .getTypes();\n\n// Gets 3 content types using RxJava2\ndeliveryService.types()\n .limitParameter(3)\n .getObservable()\n .subscribe(new Observer() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryTypeListingResponse response) {\n // Gets content types from response\n List types = response.getTypes();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" - }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDK at https://docs.kontent.ai/ios\nimport KenticoCloud\n \nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\")\n \nclient.getContentTypes(limit: 3, completionHandler: { (isSuccess, contentTypesResponse, error) in\n if !isSuccess {\n fail( \"Response is not successful. Error: \\(String(describing: error))\" )\n }\n \n if let response = contentTypesResponse {\n // use content types here\n }\n})" - }, { - "lang": "PHP", - "source": "getTypes((new QueryParams())\n ->limit(3));" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.types\n .limit(3)\n .execute do |response|\n types = response.types\n end" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listLanguageVariantsOfType()\n .byTypeCodename('article')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }] } }, - "/{project_id}/types/{type_codename}": { + "/{project_id}/types/{type_identifier}/components": { "get": { - "description": "Retrieve a specific content type from your project specified by codename.\n", - "operationId": "retrieve-a-content-type", + "description": "Retrieve a dynamically paginated list of language variants that have components based on the specified content type.\n\nYou may want to get language variants with specific components when migrating content based on a specific type from your project.\n\n**Note**: The returned language variants may be based on any type in your project as long as the variants contain at least one component of the specified type.\n", + "operationId": "list-language-variants-with-components-based-on-a-specific-type", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/type_codename" + "$ref": "#/components/parameters/type_identifier_for_components" }, { - "$ref": "#/components/parameters/elements" + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/x_continuation_4a04ea9" }], - "summary": "Retrieve a content type", - "tags": ["Content types"], + "summary": "List language variants with components based on a specific type", + "tags": ["Language variants"], "responses": { "200": { - "description": "A content type object.\n", + "description": "A dynamically paginated list of language variants that contain components based on the specified content type.\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ContentType" - }, - "example": { - "system": { - "id": "b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89", - "name": "Article", - "codename": "article", - "last_modified": "2019-07-16T07:12:44.8360000Z" - }, - "elements": { - "personas": { - "type": "taxonomy", - "name": "Personas", - "taxonomy_group": "personas" - }, - "body_copy": { - "type": "rich_text", - "name": "Body Copy" - }, - "post_date": { - "type": "date_time", - "name": "Post date" - }, - "meta_keywords": { - "type": "text", - "name": "Meta keywords" - }, - "teaser_image": { - "type": "asset", - "name": "Teaser image" - }, - "metadata__twitter_image": { - "type": "asset", - "name": "twitter:image" - }, - "metadata__twitter_creator": { - "type": "text", - "name": "twitter:creator" - }, - "title": { - "type": "text", - "name": "Title" - }, - "summary": { - "type": "text", - "name": "Summary" - }, - "related_articles": { - "type": "modular_content", - "name": "Related articles" + "required": ["variants", "pagination"], + "properties": { + "variants": { + "description": "A list of language variants.\n", + "items": { + "$ref": "#/components/schemas/LanguageVariant" + }, + "uniqueItems": true, + "type": "array" }, - "url_pattern": { - "type": "url_slug", - "name": "URL pattern" + "pagination": { + "$ref": "#/components/schemas/pagination" } - } + }, + "type": "object" } } } }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + }, "404": { - "description": "The specified content type was not found\n", + "description": "The specified content type was not found.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { - "message": "The requested content type 'articles' was not found.", - "request_id": "|8aa7f93878023f469d2b587e4fb07f85.ddb7bb71_", - "error_code": 101, - "specific_code": 0 + "request_id": "|34b4f5ab4fb3f54bbd72877d98f3121c.d1a27a5_", + "error_code": 0, + "message": "The requested content item 'getting_contents' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/types/coffee' \\\n --header 'content-type: application/json'" - }, { - "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.type('coffee')\n .toObservable()\n .subscribe(response => console.log(response.type));" - }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { DeliveryClient } from '@kentico/kontent-delivery';\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.type('coffee')\n .toObservable()\n .subscribe(response => console.log(response.type));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets a specific content type\nContentType type = await client.GetTypeAsync(\"coffee\");" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nContentType type = client.getType(\"coffee\");" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets a content type using a simple request\nContentType type = deliveryService.type(\"coffee\")\n .get()\n .getType();\n\n// Gets a content type using RxJava2\ndeliveryService.type(\"coffee\")\n .getObservable()\n .subscribe(new Observer() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryTypeResponse response) {\n // Gets the type from response\n ContentType type = response.getType();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" - }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDKs at https://docs.kontent.ai/ios\nimport KenticoCloud\n \nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\")\n \nclient.getContentType(name: \"coffee\", completionHandler: { (isSuccess, contentType, error) in\n if !isSuccess {\n fail( \"Response is not successful. Error: \\(String(describing: error))\" )\n }\n \n if let type = contentType {\n // use content type here\n }\n})" - }, { - "lang": "PHP", - "source": "getType('coffee');" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.type('coffee').execute do |response|\n type = response.type\nend" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/6434e475-5a29-4866-9fd1-6d1ca873f5be/components \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/codename/article/components \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }] } }, - "/{project_id}/taxonomies": { + "/{project_id}/items/{item_identifier}/variants/{language_identifier}": { "get": { - "description": "Retrieve a paginated list of taxonomy groups in your project. By default, the API returns all taxonomy groups ordered alphabetically by codename. You can customize pagination by using the `skip` and `limit` query parameters.\n", - "operationId": "list-taxonomy-groups", + "description": "Retrieve content of a language variant of a content item.\n\nIf you want to retrieve metadata information about the content item, see how to [retrieve a content item](https://docs.kontent.ai/link-to/retrieve_a_content_item_94197e9).\n", + "operationId": "retrieve-a-language-variant", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/skip" + "$ref": "#/components/parameters/item_identifier_dc3e32b" }, { - "$ref": "#/components/parameters/limit_8cd54e2" - }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/language_identifier_for_variants" }], - "summary": "List taxonomy groups", - "tags": ["Taxonomy groups"], + "summary": "Retrieve a language variant", + "tags": ["Language variants"], "responses": { "200": { - "description": "A paginated list of taxonomy groups.\n", + "description": "Language variant for the specified language and content item.\n", "content": { "application/json": { "schema": { - "required": ["taxonomies", "pagination"], - "properties": { - "taxonomies": { - "description": "A list of taxonomy groups.\n", - "items": { - "$ref": "#/components/schemas/TaxonomyGroup" - }, - "uniqueItems": true, - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" - } - }, - "type": "object" + "$ref": "#/components/schemas/LanguageVariant" + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" }, "example": { - "taxonomies": [{ - "system": { - "id": "4ce421e9-c403-eee8-fdc2-74f09392a749", - "name": "Manufacturer", - "codename": "manufacturer", - "last_modified": "2017-09-07T08:15:22.7210000Z" - }, - "terms": [{ - "name": "Aerobie", - "codename": "aerobie", - "terms": [] - }, { - "name": "Chemex", - "codename": "chemex", - "terms": [] - }, { - "name": "Espro", - "codename": "espro", - "terms": [] - }, { - "name": "Hario", - "codename": "hario", - "terms": [] - }] - }, { - "system": { - "id": "f30c7f72-e9ab-8832-2a57-62944a038809", - "name": "Personas", - "codename": "personas", - "last_modified": "2016-10-20T13:24:00.3200000Z" - }, - "terms": [{ - "name": "Coffee expert", - "codename": "coffee_expert", - "terms": [{ - "name": "Barista", - "codename": "barista", - "terms": [] - }, { - "name": "Cafe owner", - "codename": "cafe_owner", - "terms": [] - }] - }, { - "name": "Coffee enthusiast", - "codename": "coffee_enthusiast", - "terms": [{ - "name": "Coffee lover", - "codename": "coffee_lover", - "terms": [] - }, { - "name": "Coffee blogger", - "codename": "coffee_blogger", - "terms": [] - }] - }] - }, { - "system": { - "id": "d351400e-0290-87b2-1413-6c411d8ae5a4", - "name": "Processing", - "codename": "processing", - "last_modified": "2017-09-07T08:15:33.7560000Z" - }, - "terms": [{ - "name": "Wet (Washed)", - "codename": "wet__washed_", - "terms": [] - }, { - "name": "Dry (Natural)", - "codename": "dry__natural_", - "terms": [] - }, { - "name": "Semi-dry", - "codename": "semi_dry", - "terms": [] - }] - }], - "pagination": { - "skip": 0, - "limit": 3, - "count": 3, - "next_page": "https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies?limit=3&skip=3" - } + "request_id": "|34b4f5ab4fb3f54bbd72877d98f3121c.d1a27a5_", + "error_code": 0, + "message": "The requested content item 'getting_contents' was not found." } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies?limit=3' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.taxonomies()\n .limitParameter(3)\n .toObservable()\n .subscribe(response => console.log(response.taxonomies));" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { DeliveryClient } from '@kentico/kontent-delivery';\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.taxonomies()\n .limitParameter(3)\n .toObservable()\n .subscribe(response => console.log(response.taxonomies));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets 3 taxonomy groups\nDeliveryTypeListingResponse response = await client.GetTaxonomiesAsync(\n new LimitParameter(3)\n );\n\nvar taxonomyGroups = response.Taxonomy;" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nList params = DeliveryParameterBuilder.params().page(null, 3).build();\n\nTaxonomyGroupListingResponse response = client.getTaxonomyGroups(params);" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets 3 taxonomy groups using a simple request\nList taxonomies = deliveryService.taxonomies()\n .limitParameter(3)\n .get()\n .getTaxonomies();\n\n// Gets 3 taxonomy groups using RxJava2\ndeliveryService.taxonomies()\n .limitParameter(3)\n .getObservable()\n .subscribe(new Observer() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryTaxonomyListingResponse response) {\n // Gets the taxonomy groups\n List taxonomies = response.getTaxonomies();\n }\n\n @Override\n public void onError(Throwable e) {\n }\n\n @Override\n public void onComplete() {\n }\n });" - }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDKs at https://docs.kontent.ai/ios\nimport KenticoCloud\n\nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\")\n\nclient.getTaxonomies(completionHandler: { (isSuccess, deliveryItems, error) in\n if isSuccess {\n if let taxonomies = deliveryItems?.items {\n // use your taxonomies here\n }\n } else {\n if let error = error {\n print(error)\n }\n }\n})" - }, { - "lang": "PHP", - "source": "getTaxonomies((new QueryParams())\n ->limit(3));" - }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.taxonomies\n .limit(3)\n .execute do |response|\n groups = response.taxonomies\n end" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nContentItemIdentifier itemIdentifier = ContentItemIdentifier.ById(Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\"));\n// ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n// ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByExternalId(\"59713\");\n\nLanguageIdentifier languageIdentifier = LanguageIdentifier.ById(Guid.Parse(\"d1f95fde-af02-b3b5-bd9e-f232311ccab8\"));\n// LanguageIdentifier languageIdentifier = LanguageIdentifier.ByCodename(\"es-ES\");\n\nContentItemVariantIdentifier variantIdentifier = new ContentItemVariantIdentifier(itemIdentifier, languageIdentifier);\n\nContentItemVariantModel responseVariant = await client.GetContentItemVariantAsync(variantIdentifier);" }] - } - }, - "/{project_id}/taxonomies/{taxonomy_group_codename}": { - "get": { - "description": "Retrieve a specific taxonomy group specified by codename.\n", - "operationId": "retrieve-a-taxonomy-group", + }, + "put": { + "description": "Add content to a language variant in an active language, or update an existing language variant.\n\n\n\n

Updating content of elements

\n
    \n
  • Only the elements specified in the request body will be modified.
  • \n
  • Any comments attached to the specified elements will be lost on update.
  • \n
\n\n\n\nWhen copying or migrating language variants, you can take the language variant object returned by a [GET request](https://docs.kontent.ai/link-to/retrieve_a_language_variant) and use it as-is in the body of this request.\n", + "operationId": "upsert-a-language-variant", "parameters": [{ "$ref": "#/components/parameters/project_id" }, { - "$ref": "#/components/parameters/taxonomy_group_codename" + "$ref": "#/components/parameters/item_identifier_dc3e32b" }, { - "$ref": "#/components/parameters/x_kc_wait_for_loading_new_content" + "$ref": "#/components/parameters/language_identifier_for_variants" }], - "summary": "Retrieve a taxonomy group", - "tags": ["Taxonomy groups"], + "summary": "Upsert a language variant", + "tags": ["Language variants"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": ["elements"], + "properties": { + "elements": { + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/AssetInVariant" + }, { + "$ref": "#/components/schemas/CustomElementInVariant" + }, { + "$ref": "#/components/schemas/DateTimeInVariant" + }, { + "$ref": "#/components/schemas/LinkedItemsInVariant" + }, { + "$ref": "#/components/schemas/MultipleChoiceInVariant" + }, { + "$ref": "#/components/schemas/NumberInVariant" + }, { + "$ref": "#/components/schemas/RichTextInVariant" + }, { + "$ref": "#/components/schemas/TaxonomyInVariant" + }, { + "$ref": "#/components/schemas/TextInVariant" + }, { + "$ref": "#/components/schemas/UrlSlugInVariant" + }] + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "example": { + "elements": [{ + "element": { + "codename": "multiple_choice" + }, + "value": [{ + "codename": "barista" + }, { + "codename": "coffee_blogger" + }] + }, { + "element": { + "codename": "url_pattern" + }, + "mode": "autogenerated" + }, { + "element": { + "codename": "rich_text" + }, + "value": "

Rich text content on level 1.

\n\n", + "components": [{ + "id": "6434e475-5a29-4866-9fd1-6d1ca873f5be", + "type": { + "codename": "callout" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Callout component on level 2.

\n", + "components": [{ + "id": "8f8118e6-b611-4489-8194-5bca35f05670", + "type": { + "codename": "image" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Image on level 3.

" + }] + }] + }] + }] + }, { + "element": { + "codename": "linked_items" + }, + "value": [{ + "codename": "coffee_processing_techniques" + }, { + "codename": "origins_of_arabica_bourbon" + }] + }, { + "element": { + "codename": "text" + }, + "value": "asados, café" + }] + } + } + }, + "description": "Specifies which [elements](https://docs.kontent.ai/link-to/elements_in_language_variants) to update. Each content element is represented as a key-value pair.\n\nThe element values can be strings, numbers, or [Reference](https://docs.kontent.ai/link-to/references) objects, depending on the element type.\n", + "required": true + }, "responses": { "200": { - "description": "A taxonomy group object.\n", + "description": "The updated language variant.\n", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TaxonomyGroup" + "$ref": "#/components/schemas/LanguageVariant" }, "example": { - "system": { - "id": "f30c7f72-e9ab-8832-2a57-62944a038809", - "name": "Personas", - "codename": "personas", - "last_modified": "2016-10-20T13:24:00.3200000Z" - }, - "terms": [{ - "name": "Coffee expert", - "codename": "coffee_expert", - "terms": [{ - "name": "Barista", - "codename": "barista", - "terms": [] + "elements": [{ + "elements": [{ + "element": { + "id": "108ed7c0-fc8c-c0ec-d0b5-5a8071408b54" + }, + "value": [{ + "id": "117cdfae-52cf-4885-b271-66aef6825612" + }, { + "id": "b2fea94c-73fd-42ec-a22f-f409878de187" + }] }, { - "name": "Cafe owner", - "codename": "cafe_owner", - "terms": [] + "element": { + "id": "f2ff5e3f-a9ca-4604-58b0-34a2ad6a7cf1" + }, + "mode": "autogenerated", + "value": "on_roasts" + }, { + "element": { + "id": "2e555cc1-1eae-520c-189e-28548904f529" + }, + "value": "

Rich text content on level 1.

\n\n", + "components": [{ + "id": "6434e475-5a29-4866-9fd1-6d1ca873f5be", + "type": { + "codename": "callout" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Callout component on level 2.

\n", + "components": [{ + "id": "8f8118e6-b611-4489-8194-5bca35f05670", + "type": { + "codename": "image" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Image on level 3.

" + }] + }] + }] + }] + }, { + "element": { + "id": "63793ba4-6004-a93c-68ca-52a1f0482bca" + }, + "value": [{ + "id": "f6daed1f-3f3b-4036-a9c7-9519359b9601" + }, { + "id": "a6daed1f-4f3b-4037-a9c1-9537359b9600" + }] + }, { + "element": { + "id": "68f65095-c9b4-05d6-a473-2883c2f0c7af" + }, + "value": "asados, café" }] - }, { - "name": "Coffee enthusiast", - "codename": "coffee_enthusiast", - "terms": [{ - "name": "Coffee lover", - "codename": "coffee_lover", - "terms": [] + }], + "workflow_step": { + "id": "c4c2904a-e18c-48ae-9835-2405923262ba" + }, + "item": { + "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474" + }, + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "last_modified": "2018-11-21T09:08:33.2229841Z" + } + } + } + }, + "201": { + "description": "The created language variant.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LanguageVariant" + }, + "example": { + "elements": [{ + "elements": [{ + "element": { + "id": "108ed7c0-fc8c-c0ec-d0b5-5a8071408b54" + }, + "value": [{ + "id": "117cdfae-52cf-4885-b271-66aef6825612" + }, { + "id": "b2fea94c-73fd-42ec-a22f-f409878de187" + }] }, { - "name": "Coffee blogger", - "codename": "coffee_blogger", - "terms": [] + "element": { + "id": "f2ff5e3f-a9ca-4604-58b0-34a2ad6a7cf1" + }, + "mode": "autogenerated", + "value": "on_roasts" + }, { + "element": { + "id": "2e555cc1-1eae-520c-189e-28548904f529" + }, + "value": "

Rich text content on level 1.

\n\n", + "components": [{ + "id": "6434e475-5a29-4866-9fd1-6d1ca873f5be", + "type": { + "codename": "callout" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Callout component on level 2.

\n", + "components": [{ + "id": "8f8118e6-b611-4489-8194-5bca35f05670", + "type": { + "codename": "image" + }, + "elements": [{ + "element": { + "id": "d90f65f2-a98f-4eaf-a6da-eb2b812d49b2" + }, + "value": "

Image on level 3.

" + }] + }] + }] + }] + }, { + "element": { + "id": "63793ba4-6004-a93c-68ca-52a1f0482bca" + }, + "value": [{ + "id": "f6daed1f-3f3b-4036-a9c7-9519359b9601" + }, { + "id": "a6daed1f-4f3b-4037-a9c1-9537359b9600" + }] + }, { + "element": { + "id": "68f65095-c9b4-05d6-a473-2883c2f0c7af" + }, + "value": "asados, café" }] - }] + }], + "workflow_step": { + "id": "c4c2904a-e18c-48ae-9835-2405923262ba" + }, + "item": { + "id": "f4b3fc05-e988-4dae-9ac1-a94aba566474" + }, + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "last_modified": "2018-11-21T09:08:33.2229841Z" } } } }, - "404": { - "description": "The specified taxonomy group was not found.\n", + "400": { + "description": "The provided request body does not match the content type.\n", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { - "message": "The requested taxonomy group 'persona' was not found.", - "request_id": "|a0d6c1ee9d2bc943bdd92e57e9dc97c4.4f33764a_", - "error_code": 104, - "specific_code": 0 + "request_id": "00000000-0000-0000-b919-0080000000d1", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Value '2014-13-07T00:00:00Z' cannot be assigned to an element of 'DateTime' type.", + "path": "elements.post_date" + }] + } + } + } + }, + "404": { + "description": "The specified content item or language does not exist.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" } } } } }, "x-code-samples": [{ - "lang": "cURL", - "source": "curl --request GET \\\n --url 'https://deliver.kenticocloud.com/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/personas' \\\n --header 'content-type: application/json'" + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"elements\":[\n {\n \"element\":{\n \"codename\":\"personas\"\n },\n \"value\":[\n {\n \"codename\":\"barista\"\n },\n {\n \"codename\":\"coffee_blogger\"\n }\n ]\n },\n {\n \"element\":{\n \"codename\":\"post_date\"\n },\n \"value\":\"2014-11-07T00:00:00Z\"\n },\n {\n \"element\":{\n \"codename\":\"summary\"\n },\n \"value\":\"Tostar granos de café puede tardar de 6 a 13 minutos. ...\"\n },\n {\n \"element\":{\n \"codename\":\"related_articles\"\n },\n \"value\":[\n {\n \"codename\":\"coffee_processing_techniques\"\n },\n {\n \"codename\":\"origins_of_arabica_bourbon\"\n }\n ]\n },\n {\n \"element\":{\n \"codename\":\"meta_keywords\"\n },\n \"value\":\"asados, café\"\n },\n {\n \"element\":{\n \"codename\":\"meta_description\"\n },\n \"value\":\"Tostar granos de café puede tardar de 6 a 13 minutos. ...\"\n },\n {\n \"element\":{\n \"codename\":\"url_pattern\"\n },\n \"mode\": \"autogenerated\"\n }\n ]\n}'" }, { "lang": "JavaScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nconst KontentDelivery = require('@kentico/kontent-delivery');\n\nconst deliveryClient = new KontentDelivery.DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.taxonomy('personas')\n .toObservable()\n .subscribe(response => console.log(response.taxonomy));" - }, { - "lang": "TypeScript", - "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { DeliveryClient } from '@kentico/kontent-delivery';\n\nconst deliveryClient = new DeliveryClient({\n projectId: '975bf280-fd91-488c-994c-2f04416e5ee3'\n});\n\ndeliveryClient.taxonomy('personas')\n .toObservable()\n .subscribe(response => console.log(response.taxonomy));" - }, { - "lang": "C#", - "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Delivery;\n\n// Initializes a content delivery client\nIDeliveryClient client = DeliveryClientBuilder\n .WithProjectId(\"975bf280-fd91-488c-994c-2f04416e5ee3\")\n .Build();\n\n// Gets a specific taxonomy group\nTaxonomyGroup taxonomyGroup = await client.GetTaxonomyAsync(\"personas\");" - }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery;\n\nDeliveryClient client = new DeliveryClient(\"975bf280-fd91-488c-994c-2f04416e5ee3\");\n\nTaxonomyGroup taxonomyGroup = client.getTaxonomyGroup(\"personas\");" + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.upsertLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .withElements([\n {\n element: {\n codename: 'personas'\n },\n value: [\n {\n codename: 'barista'\n },\n {\n codename: 'coffee_blogger'\n }\n ]\n },\n {\n element: {\n codename: 'post_date'\n },\n value: '2014-11-07T00:00:00Z'\n },\n {\n element: {\n codename: 'summary'\n },\n value: 'Tostar granos de café puede tardar de 6 a 13 minutos. ...'\n },\n {\n element: {\n codename: 'related_articles'\n },\n value: [\n {\n codename: 'coffee_processing_techniques'\n },\n {\n codename: 'origins_of_arabica_bourbon'\n }\n ]\n },\n {\n element: {\n codename: 'meta_keywords'\n },\n value: 'asados, café'\n },\n {\n element: {\n codename: 'meta_description'\n },\n value: 'Tostar granos de café puede tardar de 6 a 13 minutos. ...'\n },\n {\n element: {\n codename: 'url_pattern'\n },\n mode: 'autogenerated'\n }\n ])\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }, { - "lang": "Java", - "source": "// Tip: Find more about Java/JavaRx SDKs at https://docs.kontent.ai/javaandroid\nimport com.kenticocloud.delivery_core.*;\nimport com.kenticocloud.delivery_rx.*;\n\nimport io.reactivex.Observer;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Function;\n\n// Prepares the DeliveryService configuration object\nString projectId = \"975bf280-fd91-488c-994c-2f04416e5ee3\";\nIDeliveryConfig config = DeliveryConfig.newConfig(projectId);\n\n// Initializes a DeliveryService for Java projects\nIDeliveryService deliveryService = new DeliveryService(config);\n\n// Gets a taxonomy group using a simple request\nTaxonomy taxonomy = deliveryService.taxonomy(\"personas\")\n .get()\n .getTaxonomy();\n\n// Gets a taxonomy group using RxJava2\ndeliveryService.taxonomy(\"personas\")\n .getObservable()\n .subscribe(new Observer() {\n @Override\n public void onSubscribe(Disposable d) {\n }\n\n @Override\n public void onNext(DeliveryTaxonomyResponse response) {\n // Gets the taxonomy group\n Taxonomy taxonomy = response.getTaxonomy();\n }\n\n @Override\n public void onError(Throwable e) {\n System.out.println(e.getMessage());\n }\n\n @Override\n public void onComplete() {\n }\n });" + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\n// Create a strongly typed model according to https://docs.kontent.ai/tutorials/develop-apps/get-content/using-strongly-typed-models?tech=dotnet\nMyContentTypeModel stronglyTypedElements = new MyContentTypeModel\n{\n Title = \"En Asados\",\n PostDate = new DateTime(2014, 11, 7),\n Summary = \"Tostar granos de café puede tardar de 6 a 13 minutos. ...\",\n RelatedArticles = new [] { ContentItemIdentifier.ByCodename(\"coffee_processing_techniques\"), ContentItemIdentifier.ByCodename(\"origins_of_arabica_bourbon\") },\n UrlPattern = \"on-roasts\",\n MetaKeywords = \"asados, café\",\n MetaDescription = \"Tostar granos de café puede tardar de 6 a 13 minutos. ...\",\n Personas = new [] { TaxonomyTermIdentifier.ByCodename(\"barista\"), TaxonomyTermIdentifier.ByCodename(\"coffee_blogger\") }\n};\n\nContentItemIdentifier itemIdentifier = ContentItemIdentifier.ById(Guid.Parse(\"f4b3fc05-e988-4dae-9ac1-a94aba566474\"));\n// ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByCodename(\"on_roasts\");\n// ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByExternalId(\"59713\");\n\nLanguageIdentifier languageIdentifier = LanguageIdentifier.ById(Guid.Parse(\"d1f95fde-af02-b3b5-bd9e-f232311ccab8\"));\n// LanguageIdentifier languageIdentifier = LanguageIdentifier.ByCodename(\"es-ES\");\n\n\nContentItemVariantIdentifier identifier = new ContentItemVariantIdentifier(itemIdentifier, languageIdentifier);\n\nContentItemVariantModel responseVariant = await client.UpsertContentItemVariantAsync(identifier, stronglyTypedElements);" + }] + }, + "delete": { + "description": "Deletes a specific language variant. If you want to delete all language variants of a content item, see how to [Delete a content item](https://docs.kontent.ai/link-to/delete_a_content_item).\n\n**Note**: When you delete the last variant of a content item, the whole content item is deleted.\n", + "operationId": "delete-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" }, { - "lang": "Swift", - "source": "// Tip: Find more about Swift SDKs at https://docs.kontent.ai/ios\nimport KenticoCloud\n\nlet client = DeliveryClient.init(projectId: \"975bf280-fd91-488c-994c-2f04416e5ee3\")\n\nclient.getTaxonomyGroup(taxonomyGroupName: \"personas\", completionHandler: { (isSuccess, deliveryItem, error) in\n if isSuccess {\n if let taxonomyGroup = deliveryItems.item {\n // use your taxonomy group here\n }\n } else {\n if let error = error {\n print(error)\n }\n }\n})" + "$ref": "#/components/parameters/item_identifier_dc3e32b" }, { - "lang": "PHP", - "source": "getTaxonomy('personas');" + "$ref": "#/components/parameters/language_identifier_for_variants" + }], + "summary": "Delete a language variant", + "tags": ["Language variants"], + "responses": { + "204": { + "description": "The specified language variant was deleted.\n" + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-c813-0080000000c3", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + } + }, + "/{project_id}/languages": { + "post": { + "description": "Create new languages in your project. For each active language in your project, you can add localized content within specific [language variants](https://docs.kontent.ai/link-to/language_variants).\n", + "operationId": "add-a-language", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a language", + "tags": ["Languages"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" + }, + "example": { + "name": "German (Germany)", + "codename": "de-DE", + "is_active": true, + "fallback_language": { + "codename": "de-AT" + }, + "external_id": "standard-german" + } + } + }, + "description": "The language to be added.\n", + "required": true + }, + "responses": { + "201": { + "description": "The created language object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" + }, + "example": { + "id": "2ea66788-d3b8-5ff5-b37e-258502e4fd5d", + "name": "German (Germany)", + "codename": "de-DE", + "external_id": "standard-german", + "is_active": true, + "is_default": false, + "fallback_language": { + "id": "3cd98a5a-d33a-4b00-9980-11e7a1c97bb2" + } + } + } + } + }, + "400": { + "description": "The specified request body is invalid or the language already exists.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|40636d1f3a267642b10b90ae70a0ff59.67117dc3_", + "error_code": 0, + "message": "Fallback language not found or inactive" + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"name\": \"German (Germany)\",\n \"codename\": \"de-DE\",\n \"is_active\": true,\n \"fallback_language\": {\n \"codename\": \"de-AT\"\n },\n \"external_id\": \"standard-german\"\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addLanguage()\n .withData(\n {\n name: 'German (Germany)',\n codename: 'de-DE',\n is_active: true,\n fallback_language: {\n codename: \"de-AT\"\n },\n external_id: 'standard-german'\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of languages from your project.\n", + "operationId": "list-languages", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" + }, { + "$ref": "#/components/parameters/x_continuation_4a04ea9" + }], + "summary": "List languages", + "tags": ["Languages"], + "responses": { + "200": { + "description": "A dynamically paginated list of languages.\n", + "content": { + "application/json": { + "schema": { + "required": ["languages", "pagination"], + "properties": { + "languages": { + "description": "List of languages.\n", + "items": { + "$ref": "#/components/schemas/Language" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/pagination" + } + }, + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" }, { - "lang": "Ruby", - "source": "require 'delivery-sdk-ruby'\n\ndelivery_client = Kentico::Kontent::Delivery::DeliveryClient.new project_id: '975bf280-fd91-488c-994c-2f04416e5ee3'\ndelivery_client.taxonomy('personas').execute do |response|\n group = response.taxonomy\nend" + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listLanguages()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" }] } - } - }, - "servers": [{ - "description": "Delivery API", - "url": "https://deliver.kontent.ai" - }, { - "description": "Delivery Preview API", - "url": "https:///preview-deliver.kontent.ai" - }], - "tags": [{ - "description": "The Delivery API does not require authentication by default but you can enable secure access for the project to force authenticated requests.\n\n\n\n

Premium feature

\n

Secure access to the Delivery API requires a Professional plan or higher.

\n\n\n\nWith secure access, you can use two concurrent API keys, Primary and Secondary. For more details on how to work with the keys, see [Securing public access](https://docs.kontent.ai/link-to/securing_public_access).\n\nAs the Delivery API is designed for continuous retrieval of published content, there is **no expiration date** for the Primary or Secondary API key.\n\nThe API keys are **scoped per project**. This means you need a separate API key for each project in Kentico Cloud. All users within a single project share the same Delivery API keys.\n", - "name": "Secure access" - }, { - "description": "The Delivery API with [secure access](https://docs.kontent.ai/link-to/secure_access) enabled and the Delivery Preview API both use two concurrent API keys, Primary and Secondary. In certain situations, you may need to revoke one of these keys and generate a new one. For example, when you suspect unauthorized key use or when a developer with access to the API key has left your company.\n\nFor situations like these, one or both of the API keys can be regenerated. Activating a new key will immediately replace the old key. Requests made with a revoked API key will then receive a `401 Unauthorized` HTTP status in the response.\n\n\n\n

Expiration date and key regeneration

\n

There is no expiration date for the Primary or Secondary API key. However, we recommend that you regenerate the API keys periodically to prevent the keys from being compromised.

\n

Learn more in Securing public access and Previewing unpublished content.

\n\n\n", - "name": "Revoking API keys" - }, { - "description": "When [retrieving content items](https://docs.kontent.ai/link-to/list_content_items) from your project, you can filter large sets of content items by building query parameters from content elements and system properties. Note that filtering does NOT apply to content items returned within the `modular_content` collection.\n\nIf you want to get only a specific set of elements from content items, use [projection](https://docs.kontent.ai/link-to/projection) when retrieving the items.\n\n### Filtering by `system` values\n\nTo filter by system property values, you need to use a query parameter in the `system.` format. The `system` properties are `id`, `name`, `codename`, `language`, `type`, `sitemap_locations`, and `last_modified`. For example, to retrieve only content items based on the *Article* content type, use `system.type=article` as a query parameter.\n\n### Filtering by `element` values\n\nTo filter by [content element](https://docs.kontent.ai/link-to/content_elements) values, you need to use a query parameter in the `elements.=` format. For example, to retrieve only content items whose *Number* element named **Price** has a value of 16, use `elements.price=16` as a query parameter.\n\n### Joining multiple query parameters\n\nYou can join multiple query parameters using the `&` character. Queries with two or more filtering query parameters are more restrictive because the individual query parameters are merged with a logical conjunction (AND).\n\nFor example, the query `system.type=article&elements.persona[contains]=barista` will return the content items of the Article type that are tagged with the *Barista* taxonomy term.\n\n### Filtering operators\n\nYou can use the following filtering operators with both system properties and element values.\n\nNote that all of the operators are **case-sensitive**.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OperatorDescriptionExampleUse with
=\n\nProperty value is the same as the specified value.\\\nMore in Comparing values.\n\nsystem.type=articleSimple types
[lt]\n\nProperty value is less than the specified value.\\\nMore in Comparing values.\n\n\n\nsystem.last_modified[lt]=2019-03-01\\\nelements.price[lt]=10\n\nSimple types
[lte]\n\nProperty value is less than or equal to the specified value.\\\nMore in Comparing values.\n\n\n\nsystem.last_modified[lt]=2019-02-01\\\nelements.price[lte]=4\n\nSimple types
[gt]\n\nProperty value is greater than the specified value.\\\nMore in Comparing values.\n\n\n\nsystem.last_modified[gt]=2019-01-01\\\nelements.price[gt]=10\n\nSimple types
[gte]\n\nProperty value is greater than or equal to the specified value.\\\nMore in Comparing values.\n\n\n\nsystem.last_modified[gt]=2019-02-28\\\nelements.price[gt]=10\n\nSimple types
[range]\n\nProperty value falls within the specified range of two values, both inclusive.\\\nMore in Comparing values.\n\n\n\nsystem.last_modified[range]=2018-02-01,2018-03-31\\\nelements.price[range]=10.5,50\n\nSimple types
[in]Property value is in the specified list of values.\n\nsystem.type[in]=cafe,coffee\\\nelements.price[in]=8.5,9,10.5\n\nSimple types
[contains]\n\nProperty with an array of values contains the specified value.\\\n**Note**: The [contains] operator cannot be used on strings.\n\nelements.personas[contains]=baristaArrays
[any]Property with an array of values contains at least one value from the specified list of values.elements.personas[any]=barista,coffee_bloggerArrays
[all]Property with an array of values contains all of the specified values.elements.personas[all]=barista,coffee_bloggerArrays
\n\n### Arrays vs. simple types\n\nYou can use the `[contains]`, `[any]`, and `[all]` filtering operators only on array properties. The supported array properties include the sitemap locations within the `system` object of content items, and the linked items, multiple choice, and taxonomy elements.\n\n**Note**: Asset elements are not supported with `[contains]`, `[any]`, and `[all]` filtering operators.\n\n### Comparing values\n\nThe `[lt]`, `[lte]`, `[gt]`, `[gte]`, and `[range]` filtering operators work best with numbers. For example, you can retrieve products with `price` larger or equal to 15 by using `elements.price[gte]=15`.\n\n\n\n

Filtering by date-time values

\n

Properties that store dates (such as the last_modified system property or date & time elements) are represented as strings. If you use filtering operators on properties with string values, the Delivery API tries to perform a string comparison.

\n

For example, you can retrieve content items modified during February and March by using a query such as system.last_modified[range]=2018-02-01,2018-04-01, specifying a start date within the range and an end date outside the range.

\n\n\n", - "name": "Filtering content" - }, { - "description": "When [getting content items](https://docs.kontent.ai/link-to/list_content_items) or [content types](https://docs.kontent.ai/link-to/list_content_types), you can specify which elements to return by using the `elements` query parameter.\n* For items, the parameter applies to content items returned within both the `items` array and `modular_content` collection.\n* For types, the parameter applies to content types returned within the `types` array.\n\n### Examples\n\nBy using `elements=title` as a query parameter, the `elements` collection in each content item will contain only the element with the codename `title`, or, if the item doesn't have an element with such codename, the `elements` collection will be empty.\n\nFor multiple elements, you can use a query parameter such as `elements=title,summary,related_articles` to retrieve only the elements with codenames `title`, `summary`, and `related_articles`.\n\n**Note**: Projection does not apply to the system properties. This means that you cannot omit the `system` object from the response using any query.\n", - "name": "Projection" - }, { - "description": "Kentico Cloud offers a variety of ways to compose, structure, and cross-reference your content:\n* **Linked items elements** are used to reference other content items.\n* **Rich text elements** can also contain content items. Useful for inserting content into a specific point in the text.\n* Rich text elements can contain **components**.\n * A component is a single-use content item.\n * It has the same structure as a [content item](https://docs.kontent.ai/link-to/content_items).\n * It is based on a specific content type.\n * Unlike a content item, a component only exists inside its Rich text element. Learn more about [using components](https://docs.kontent.ai/link-to/structuring_editorial_articles_with_components).\n\nWhen [retrieving items](https://docs.kontent.ai/link-to/list_content_items) using the Delivery API, the contents of *all components and content items in rich text and linked items elements* are stored as properties in a separate `modular_content` object within the API response. The properties of the `modular_content` object (i.e., individual components and items) are not ordered. See the linked items and rich text [elements](https://docs.kontent.ai/link-to/content_elements) for how ordering is done there.\n\nNote that the object is called *\"modular_content\"* instead of *\"linked_content\"* for historical reasons.\n\nWhen [enumerating the items](https://docs.kontent.ai/link-to/enumerate_content_items) in your project using the Delivery API, the `modular_content` collection in the response will contain only components, not content items used in Linked items elements.\n\n### Linked content depth\n\n**Content items** reference other content items using the linked items or rich text elements. These linked items can reference other items recursively. By default, only one level of linked items is returned.\n* If you want to include more than one level of linked items in response, set the `depth` query parameter to 2 or more.\n* If you want to exclude all linked items, use the `depth=0` query parameter.\n* When retrieving content, linked items cannot be [filtered](https://docs.kontent.ai/link-to/filtering_content).\n\n**Components** are not affected by the `depth` parameter as they are an integral part of their Rich text element. They are always present in the response. You can only nest components up to depth level 6.\n", - "name": "Linked content and components" - }, { - "description": "Content items represent specific pieces of content based on a specific content type. You can retrieve items from your project by [providing their codename](https://docs.kontent.ai/link-to/retrieve_a_content_item) or by providing a set of [filtering parameters](https://docs.kontent.ai/link-to/filtering_content). By default, the Delivery API returns content items in the [default language](https://docs.kontent.ai/link-to/localization_in_kentico_kontent).\n\n## Content item object\n\n\n \n", - "name": "Content items" - }, { - "description": "When getting [content items](https://docs.kontent.ai/link-to/content_items) or [content types](https://docs.kontent.ai/link-to/content_types), you get an `elements` collection as a part of the retrieved item or type.\n\nEach element in the `elements` collection contains the following properties.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Property**\n\n\n\n**Description**\n\n\n\n**Type**\n\n\n\n**Notes**\n\n
typeType of the elementstringValid values: text, rich_text, number, multiple_choice, date_time, asset, modular_content (Linked items element), taxonomy, url_slug.
nameDisplay name of the elementstring\n\n
valueValue of the elementvariesData type is based on the type of the element – see examples below for more details.
\n\nNote that certain elements, such as rich text or taxonomy, can contain additional properties.\n\nFor an overview of the available elements and their limits, see the [reference of content type elements](https://docs.kontent.ai/link-to/content_type_elements_reference).\n\n## Text element\n\n\nThe value of text elements is a `string`.\n\nHere's how text elements look in content types.\n\n\n\n\n```json\n\"meta_keywords\": {\n \"type\": \"text\",\n \"name\": \"Meta keywords\"\n}\n```\n\n\n\nHere's how text elements look in content items.\n\n\n\n\n```json\n\"meta_keywords\": {\n \"type\": \"text\",\n \"name\": \"Meta keywords\",\n \"value\": \"\\\"coffee beginner\\\", beverages\"\n}\n```\n\n\n\n## Rich text element\n\n\nIn addition to formatted text, the rich text element's `value` property can contain objects representing images, components, content items, and links to content items. Information about these objects is stored in separate properties:\n* `images` – stores metadata of assets in the text.\n* `modular_content` – stores metadata of linked items and components in the text.\n* `links` – stores metadata about content items linked in the text.\n\n**Note**: If the element does not contain any text, its value defaults to a single empty paragraph: `


`.\n\nHere's how rich text elements look in content types.\n\n\n\n\n```json\n\"description\": {\n \"type\": \"rich_text\",\n \"name\": \"Description\"\n}\n```\n\n\n\nHere's how rich text elements look in content items.\n\n\n\n\n```json\n\"description\": {\n \"type\": \"rich_text\",\n \"name\": \"Description\",\n \"images\": {\n \"14mio\": {\n \"image_id\": \"14mio\",\n \"description\": \"Roasting coffee beans\",\n \"url\": \"https://assets-us-01.kc-usercontent.com/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/237362b4-5f2b-480e-a1d3-0ad5a6d5f8bd/roaster.jpg\",\n \"width\": 600,\n \"height\": 457\n }\n },\n \"links\": {\n \"f4b3fc05-e988-4dae-9ac1-a94aba566474\": {\n \"type\": \"article\",\n \"codename\": \"on_roasts\",\n \"url_slug\": \"\"\n }\n },\n \"modular_content\": [\n \"coffee_processing_techniques\", # content item in Rich text\n \"n249afaaf_1de5_011f_f683_c78fd9ec9d7c\" # component in Rich text\n ],\n \"value\": \"

We operate our own roasteries, one on every continent we cover, from where we distribute right to the shops. This allows you to experience every cup as if you were right at the very farm it originated from. To achieve this, we use a refurbished 1920s Probat coffee roasters.

\\n
\\\"Roasting

We know that roasting is something you must keep on constantly perfecting. Each coffee requires a different roast to get the aroma and taste just right. That’s why our experts fine tune the way we roast coffees every day. It’s a constant struggle.

\"\n}\n```\n\n\n\n### Images (single object)\n\nEach object in the images collection represents an image ID, e.g., `14mio`.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Property**\n\n\n\n**Description**\n\n\n\n**Type**\n\n\n\n**Notes**\n\n
image_idID of the imagestring\n\n
descriptionDescription of the imagestringUsed for the alt attribute of an <img> tag.
urlAbsolute URL for the imagestring\n\n
widthWidth of the imageinteger\n\n
heightHeight of the imageinteger\n\n
\n\nIn the rich text element's `value`, images are represented by `figure` and `img` tags:\n\n\n\n\n```html\n
\\\"Roasting
\n```\n\n\n\n### Modular content (components and items in rich text)\n\nThe `modular_content` collection represents [components and content items](https://docs.kontent.ai/link-to/linked_content_and_components) inserted into rich text. The content items and components are represented as an array of strings. Each string is the codename of a content item or component.\n\nThe codenames are grouped with all content items first and then all components, with the order within each group matching that in the UI. The content of these items and components can be found in the `modular_content` property of the API response when [retrieving content items](https://docs.kontent.ai/link-to/list_content_items). Within the item's `modular_content` property, the items and components are not in any particular order.\n\nIn the rich text element's `value`, content items and components are represented by the `object` tags.\n\n\n\n\n```html\n\n\"\n\n\n\n```\n\n\n\n**Note**: Both components and items have the `data-type=\"item\"` attribute so they can be resolved using a single method. You can differentiate between components and items in rich text using the `data-rel` attribute.\n\n### Links (single object)\n\nEach object in the `links` collection represents a content item ID in the GUID format, e.g., `f4b3fc05-e988-4dae-9ac1-a94aba566474`.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Property**\n\n\n\n**Description**\n\n\n\n**Type**\n\n\n\n**Notes**\n\n
typeContent type of the content itemstring\n\n
codenameDisplay name of the elementstring\n\n
url_slugURL slug of the content itemstringEmpty string if the content item's type does not use a URL slug element.
\n\nIn the rich text element's `value`, links are represented by the `a` tags.\n\n\n\n\n```html\nroast coffees\n```\n\n\n\n## Multiple choice element\n\n\nThe `value` of multiple choice elements is an array of selected options. Each option has the `name` and `codename` properties. The order of the option objects in the array matches the order of the options in the UI.\n\nHere's how multiple choice elements look in content types.\n\n\n\n\n```json\n\"processing\": {\n \"type\": \"multiple_choice\",\n \"name\": \"Processing\",\n \"options\": [\n {\n \"name\": \"Dry (Natural)\",\n \"codename\": \"dry__natural_\"\n },\n {\n \"name\": \"Wet (Washed)\",\n \"codename\": \"wet__washed_\"\n },\n {\n \"name\": \"Semi-dry\",\n \"codename\": \"semi_dry\"\n }\n ]\n}\n```\n\n\n\nHere's how multiple choice elements look in content items.\n\n\n\n\n```json\n\"processing\": {\n \"type\": \"multiple_choice\",\n \"name\": \"Processing\",\n \"value\": [\n {\n \"name\": \"Dry (Natural)\",\n \"codename\": \"dry__natural_\"\n }\n ]\n}\n```\n\n\n\n## Number element\n\n\nThe `value` of number elements is a decimal number. If empty, the element's `value` is `null`.\n\nHere's how number elements look in content types.\n\n\n\n\n```json\n\"price\": {\n \"type\": \"number\",\n \"name\": \"Price\"\n}\n```\n\n\n\nHere's how number elements look in content items.\n\n\n\n\n```json\n\"price\": {\n \"type\": \"number\",\n \"name\": \"Price\",\n \"value\": 8.5\n}\n```\n\n\n\n## Date and time element\n\n\nThe `value` of date & time elements is an [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601 \"International standard covering the exchange of date- and time-related data\") formatted string. If empty, the `value` is `null`.\n\nHere's how number elements look in content types.\n\n\n\n\n```json\n\"post_date\": {\n \"type\": \"date_time\",\n \"name\": \"Post date\"\n}\n```\n\n\n\nHere's how number elements look in content items.\n\n\n\n\n```json\n\"post_date\": {\n \"type\": \"date_time\",\n \"name\": \"Post date\",\n \"value\": \"2014-11-18T00:00:00Z\"\n}\n```\n\n\n\n## Asset element\n\n\nThe `value` of asset elements is an array of asset objects. The asset objects are returned in the same order as shown in the UI.\n\n#### Asset object\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Property**\n\n\n\n**Description**\n\n\n\n**Type**\n\n
nameFile name of the assetstring
typeMIME type of the assetstring
sizeSize of the asset in bytesinteger
descriptionDescription of the assetstring
urlAbsolute URL for the assetstring
widthWidth of the image in pixelsinteger
heightHeight of the image in pixelsinteger
\n\nHere's how asset elements look in content types.\n\n\n\n\n```json\n\"teaser_image\": {\n \"type\": \"asset\",\n \"name\": \"Teaser image\"\n}\n```\n\n\n\nHere's how asset elements look in content items.\n\n\n\n\n```json\n\"teaser_image\": {\n \"type\": \"asset\",\n \"name\": \"Teaser image\",\n \"value\": [\n {\n \"name\": \"coffee-beverages-explained-1080px.jpg\",\n \"type\": \"image/jpeg\",\n \"size\": \"90895\",\n \"description\": null,\n \"url\": \"https://assets-us-01.kc-usercontent.com/38af179c-40ba-42e7-a5ca-33b8cdcc0d45/e700596b-03b0-4cee-ac5c-9212762c027a/coffee-beverages-explained-1080px.jpg\",\n \"width\": 1000,\n \"height\": 666\n }\n ]\n}\n```\n\n\n\n## Linked items element\n\n\nThe `value` of linked items elements is an array of strings. Each string represents a codename of a content item. The order of the codenames in the array matches the order of the content items in the UI. The content of these items and components can be found in the `modular_content` property of the API response when [retrieving content items](https://docs.kontent.ai/link-to/list_content_items). Within the item's `modular_content` property, the items and components are not in any particular order.\n\nHere's how linked items elements look in content types.\n\n\n\n\n```json\n\"facts\": {\n \"type\": \"modular_content\",\n \"name\": \"Facts\"\n}\n```\n\n\n\nHere's how linked items elements look in content items.\n\n\n\n\n```json\n\"facts\": {\n \"type\": \"modular_content\",\n \"name\": \"Facts\",\n \"value\": [\n \"our_philosophy\",\n \"how_we_source_our_coffees\",\n \"how_we_roast_our_coffees\"\n ]\n}\n```\n\n\n\n## Custom element\n\n\nThe `value` of custom elements is a string. If empty, the `value` is `null`.\n\nHere's how custom elements look in content types.\n\n\n\n\n```json\n\"color_picker\": {\n \"type\": \"custom\",\n \"name\": \"Color picker\"\n}\n```\n\n\n\nHere's how custom elements look in content items.\n\n\n\n\n```json\n\"color_picker\": {\n \"type\": \"custom\",\n \"name\": \"Color picker\"\n}\n```\n\n\n\n## Taxonomy element\n\n\nThe `value` of taxonomy elements is an array of selected taxonomy terms.\n\nHere's how taxonomy elements look in content types.\n\n\n\n\n```json\n\"personas\": {\n \"type\": \"taxonomy\",\n \"name\": \"Personas\",\n \"taxonomy_group\": \"personas\"\n}\n```\n\n\n\nHere's how taxonomy elements look in content items.\n\n\n\n\n```json\n\"personas\": {\n \"type\": \"taxonomy\",\n \"name\": \"Personas\",\n \"taxonomy_group\": \"personas\",\n \"value\": [\n {\n \"name\": \"Coffee lover\",\n \"codename\": \"coffee_lover\"\n }\n ]\n}\n```\n\n\n\n## URL slug element\n\n\nThe `value` of URL slug elements is a string.\n\nHere's how URL slug elements look in content types.\n\n\n\n\n```json\n\"url_slug\": {\n \"type\": \"url_slug\",\n \"name\": \"URL slug\"\n}\n```\n\n\n\nHere's how URL slug elements look in content items.\n\n\n\n\n```json\n\"url_slug\": {\n \"type\": \"url_slug\",\n \"name\": \"URL slug\",\n \"value\": \"brazil-natural-barra-grande\"\n}\n```\n\n\n\n## Content type snippet element\n\n\nThe content type snippet elements have no value of their own. In Delivery API, content type snippets are expanded into the elements they contain. You can recognize the elements expanded from snippets by element codenames.\n\nFor example, a content type snippet with two elements will be structured as the 2 elements directly, without any encapsulation. The codenames of these two elements will be in the following format: `__`.\n\nHere's how elements from snippets look in content types.\n\n\n\n\n```json\n\"seo_metatata__meta_keywords\": {\n \"type\": \"text\",\n \"name\": \"Meta keywords\"\n},\n\"seo_metatata__meta_description\": {\n \"type\": \"text\",\n \"name\": \"Meta description\"\n}\n```\n\n\n\nHere's how elements from snippets look in content items.\n\n\n\n\n```json\n\"seo_metatata__meta_keywords\": {\n \"type\": \"text\",\n \"name\": \"Meta keywords\",\n \"value\": \"donation, africa\"\n},\n\"seo_metatata__meta_description\": {\n \"type\": \"text\",\n \"name\": \"Meta description\",\n \"value\": \"Dancing Goat regularly donates money to Children in Africa, a foundation helping children with food, accommodation, education, and other essentials.\"\n}\n```\n\n\n", - "name": "Content elements" - }, { - "description": "Content types define the structure of [content items](https://docs.kontent.ai/link-to/content_items). Each content type consists of specific [content elements](https://docs.kontent.ai/link-to/content_elements) that define what kind of content (i.e., which data types) the structure holds.\n\n## Content type object\n\n\nTODO\n", - "name": "Content types" - }, { - "description": "Taxonomy groups are a tool you can use to tag content items with specific metadata.\n\nLearn more in [organizing content with taxonomies](https://docs.kontent.ai/link-to/organizing_your_content_with_taxonomies).\n\n## Taxonomy group object\n\n\nTODO\n", - "name": "Taxonomy groups" - }], - "components": { - "parameters": { - "project_id": { - "description": "Identifies your project.\n", - "in": "path", - "name": "project_id", - "required": true, - "schema": { - "$ref": "#/components/schemas/String" + }, + "/{project_id}/languages/{language_identifier}": { + "get": { + "description": "Retrieve a language from your project.\n", + "operationId": "retrieve-a-language", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/language_identifier_for_languages" + }], + "summary": "Retrieve a language", + "tags": ["Languages"], + "responses": { + "200": { + "description": "A single language object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" + }, + "example": { + "id": "2ea66788-d3b8-5ff5-b37e-258502e4fd5d", + "name": "German (Germany)", + "codename": "de-DE", + "external_id": "standard-german", + "is_active": true, + "is_default": false, + "fallback_language": { + "id": "3cd98a5a-d33a-4b00-9980-11e7a1c97bb2" + } + } + } + } + }, + "404": { + "description": "The specified language was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|3c987acab6ee204d9776e9d79be7407e.67117f28_", + "error_code": 111, + "message": "The requested language was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/2ea66788-d3b8-5ff5-b37e-258502e4fd5d \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/codename/de-DE \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/external-id/standard-german \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewLanguage()\n .byLanguageId('2ea66788-d3b8-5ff5-b37e-258502e4fd5d')\n // .byLanguageCodename('de-DE')\n // .byExternalId('standard-german')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "patch": { + "description": "Modify languages in your project.\n", + "operationId": "modify-a-language", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/language_identifier_for_languages" + }], + "summary": "Modify a language", + "tags": ["Languages"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LanguageOperationReplace" + }, + "example": [{ + "op": "replace", + "property_name": "fallback_language", + "value": { + "codename": "en-US" + } + }, { + "op": "replace", + "property_name": "name", + "value": "German" + }] + } + }, + "description": "Specifies the operations to perform over your project's languages.\n", + "required": true + }, + "responses": { + "200": { + "description": "The modified language object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" + }, + "example": { + "id": "2ea66788-d3b8-5ff5-b37e-258502e4fd5d", + "name": "German", + "codename": "de-DE", + "external_id": "standard-german", + "is_active": true, + "is_default": false, + "fallback_language": { + "id": "00000000-0000-0000-0000-000000000000" + } + } + } + } + }, + "400": { + "description": "The specified set of operations is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|a46b0a7019eff741b1dc82610ed60ccf.400dafcf_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Invalid operation with index '0': The specified fallback language is inactive or does not exist." + }] + } + } + } + }, + "404": { + "description": "The specified language was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|8bb04fee6bb3524a806a3da87b2dda72.ebe0cdcd_", + "error_code": 111, + "message": "The requested language was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PATCH \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/2ea66788-d3b8-5ff5-b37e-258502e4fd5d \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/codename/de-DE/ \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/languages/external-id/standard-german \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n [\n {\n \"op\": \"replace\",\n \"property_name\": \"fallback_language\",\n \"value\": {\n \t \"codename\": \"en-US\"\n }\n },\n {\n \"op\": \"replace\",\n \"property_name\": \"name\",\n \"value\": \"German\"\n }\n ]'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.modifyLanguage()\n .byLanguageId('2ea66788-d3b8-5ff5-b37e-258502e4fd5d')\n // .byLanguageCodename('de-DE')\n // .byExternalId('standard-german')\n .withData (\n [\n {\n op: \"replace\",\n property_name: \"fallback_language\",\n value: {\n codename: \"en-US\"\n }\n },\n {\n op: 'replace',\n property_name: \"name\",\n value: \"German\"\n }\n ]\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/workflow": { + "get": { + "description": "Get the workflow steps in your project.\n", + "operationId": "retrieve-workflow-steps", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Retrieve workflow steps", + "tags": ["Workflow and publishing"], + "responses": { + "200": { + "description": "A list of workflow steps in the specified project.\n", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/WorkflowStep" + }, + "uniqueItems": true, + "type": "array" + }, + "example": [{ + "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf", + "name": "Draft", + "transitions_to": ["13145328-b946-4e47-9c9d-6f40c7aaeaef"] + }, { + "id": "13145328-b946-4e47-9c9d-6f40c7aaeaef", + "name": "Review", + "transitions_to": ["88ac5e6e-1c5c-4638-96e1-0d61221ad5bf", "48de7f2d-80de-4a8e-9efb-fc23bffbf75a", "b4363ccd-8f21-45fd-a840-5843d7b7f008"] + }, { + "id": "48de7f2d-80de-4a8e-9efb-fc23bffbf75a", + "name": "SEO verification", + "transitions_to": ["13145328-b946-4e47-9c9d-6f40c7aaeaef", "99435d07-a9b7-4273-b439-a6e4bc125140"] + }, { + "id": "99435d07-a9b7-4273-b439-a6e4bc125140", + "name": "Ready for approval", + "transitions_to": ["48de7f2d-80de-4a8e-9efb-fc23bffbf75a", "a1b9efa3-8270-47e4-8d8d-b182710d1e3b"] + }, { + "id": "a1b9efa3-8270-47e4-8d8d-b182710d1e3b", + "name": "Approved", + "transitions_to": ["99435d07-a9b7-4273-b439-a6e4bc125140", "b4363ccd-8f21-45fd-a840-5843d7b7f008"] + }, { + "id": "9d2b0228-4d0d-4c23-8b49-01a698857709", + "name": "Scheduled", + "transitions_to": [] + }, { + "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008", + "name": "Published", + "transitions_to": [] + }] + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/workflow \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listWorkflowSteps()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/items/{item_identifier}/variants/{language_identifier}/workflow/{workflow_step_identifier}": { + "put": { + "description": "Change the workflow of the specified language variant to the specified workflow step. Equivalent to [updating the workflow in the UI](https://docs.kontent.ai/link-to/moving_content_items_through_their_workflow).\n* You cannot change the workflow step of a published language variant. You need to [unpublish it](https://docs.kontent.ai/link-to/unpublish_a_language_variant) or [create a new version](https://docs.kontent.ai/link-to/create_a_new_version_of_a_language_variant) first.\n* With this endpoint, you can change the workflow of the language variant from any step to any other step excluding \"Published\" or \"Scheduled\". For those steps, use the dedicated [Publish](https://docs.kontent.ai/link-to/publish_or_schedule_a_language_variant) operation instead.\n\n**Note**: The Management API ignores the [workflow transition limitations](https://docs.kontent.ai/link-to/setting_up_a_workflow_for_your_content) present in the UI.\n", + "operationId": "change-the-workflow-step-of-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }, { + "$ref": "#/components/parameters/language_identifier_for_variants" + }, { + "$ref": "#/components/parameters/workflow_step_identifier" + }], + "summary": "Change the workflow step of a language variant", + "tags": ["Workflow and publishing"], + "responses": { + "204": { + "description": "The workflow step of the specified language variant was updated.\n", + "content": { + "application/json": {} + } + }, + "400": { + "description": "The specified workflow operation is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "385bc5fe-cc64-4924-bee1-78f271d4bbc5", + "error_code": 215, + "message": "Cannot change workflow step to Published. If you want to publish a language variant via the Management API, use the '/publish' endpoint instead." + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "0d49e996-3543-45ac-8af5-62f142eb64d4", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES/workflow/024DB524-A7F4-46B6-8315-A43A0366C397 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.changeWorkflowStepOfLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .byWorkflowStepId('024DB524-A7F4-46B6-8315-A43A0366C397')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/items/{item_identifier}/variants/{language_identifier}/publish": { + "put": { + "description": "Change the workflow step of the specified language variant to \"Published\" or schedule publishing at the specified time.\n* Equivalent to the UI operations of [publishing](https://docs.kontent.ai/link-to/publishing_content_items) and [scheduling](https://docs.kontent.ai/link-to/scheduling_content_publishing) content.\n* The Management API ignores the [workflow transition limitations](https://docs.kontent.ai/link-to/setting_up_a_workflow_for_your_content) present in the UI. You can publish or schedule a language variant in any workflow step.\n* Scheduling a published language variant does nothing.\n", + "operationId": "publish-or-schedule-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }, { + "$ref": "#/components/parameters/language_identifier_for_variants" + }], + "summary": "Publish or schedule a language variant", + "tags": ["Workflow and publishing"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "scheduled_to": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date-time for scheduled publishing.\n\nIf you do not provide this property, the specified language variant is published immediately.\n", + "example": "2019-01-31T11:00:00+01:00", + "format": "date-time", + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "204": { + "description": "The specified language variant was published or scheduled.\n", + "content": { + "application/json": {} + } + }, + "400": { + "description": "The specified scheduled date is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "2f68a52f-dfa1-4eb6-8e53-c712d0cc044c", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "The provided value '2019-07-:00:00+01:00' is not a valid datetime string.", + "path": "scheduled_to" + }] + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "0d49e996-3543-45ac-8af5-62f142eb64d4", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES/publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES/publish \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"scheduled_to\": \"2021-01-31T11:00:00+01:00\"\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.publishOrScheduleLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .withData({\n scheduled_to: '2021-01-31T11:00:00+01:00'\n })\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/items/{item_identifier}/variants/{language_identifier}/new-version": { + "put": { + "description": "Create a new version of a published language variant (equivalent to the UI action of [creating new versions](https://docs.kontent.ai/link-to/creating_new_versions_of_content_items) of content) while keeping the original version published and available through the [Delivery API](https://docs.kontent.ai/link-to/delivery_api).\n\nYou can only create new versions of published language variants that don't already have a Draft (unpublished) version.\n", + "operationId": "create-a-new-version-of-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/language_identifier_for_variants" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }], + "summary": "Create a new version of a language variant", + "tags": ["Workflow and publishing"], + "responses": { + "204": { + "description": "A new version of the specified published language variant was created.\n" + }, + "400": { + "description": "The specified language variant is not published.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "550c4c30-1b9c-4fe4-8140-a9cda5cd7c11", + "error_code": 214, + "message": "Cannot create a new version of a language variant that is not published." + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "0d49e996-3543-45ac-8af5-62f142eb64d4", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/new-version \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/new-version \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/new-version \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES/new-version \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/new-version \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES/new-version \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.createNewVersionOfLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/items/{item_identifier}/variants/{language_identifier}/unpublish": { + "put": { + "description": "Unpublish a language variant (equivalent to [unpublishing content in the UI](https://docs.kontent.ai/link-to/unpublishing_content_items)) to make it no longer accessible through the [Delivery API](https://docs.kontent.ai/link-to/delivery_api).\n\nYou can only unpublish language variants that are published and don't already have a Draft (unpublished) version.\n", + "operationId": "unpublish-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }, { + "$ref": "#/components/parameters/language_identifier_for_variants" + }], + "summary": "Unpublish a language variant", + "tags": ["Workflow and publishing"], + "responses": { + "204": { + "description": "The specified language variant was unpublished and moved to the first workflow step.\n" + }, + "400": { + "description": "The specified language variant is not published.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "5872650e-32bb-4e23-9d73-ba5139b93898", + "error_code": 213, + "message": "Cannot unpublish a language variant that is not published." + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "0d49e996-3543-45ac-8af5-62f142eb64d4", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/unpublish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/unpublish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/unpublish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES/unpublish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/unpublish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES/unpublish \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.unpublishLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/items/{item_identifier}/variants/{language_identifier}/cancel-scheduled-publish": { + "put": { + "description": "Cancel scheduling of a language variant.\n\nEquivalent to [canceling scheduled content in the UI](https://docs.kontent.ai/link-to/scheduling_content_publishing). If the specified language variant is not scheduled, its workflow step is not changed.\n", + "operationId": "cancel-scheduled-publishing-of-a-language-variant", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/item_identifier_dc3e32b" + }, { + "$ref": "#/components/parameters/language_identifier_for_variants" + }], + "summary": "Cancel scheduled publishing of a language variant", + "tags": ["Workflow and publishing"], + "responses": { + "204": { + "description": "Scheduled publishing was canceled and the variant moved to the first workflow step.\n" + }, + "400": { + "description": "The specified language variant was not scheduled.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|f027690dca4a294a954f54378e68fa12.d197c75_", + "error_code": 218, + "message": "Cannot cancel scheduling of a language variant that is not scheduled to publish." + } + } + } + }, + "404": { + "description": "The specified language variant was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "0d49e996-3543-45ac-8af5-62f142eb64d4", + "error_code": 103, + "message": "The requested content item variant was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/cancel-scheduled-publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/f4b3fc05-e988-4dae-9ac1-a94aba566474/variants/codename/es-ES/cancel-scheduled-publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/cancel-scheduled-publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/codename/on_roasts/variants/codename/es-ES/cancel-scheduled-publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/d1f95fde-af02-b3b5-bd9e-f232311ccab8/cancel-scheduled-publish \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/items/external-id/59713/variants/codename/es-ES/cancel-scheduled-publish \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.cancelSheduledPublishingOfLanguageVariant()\n .byItemId('f4b3fc05-e988-4dae-9ac1-a94aba566474')\n // .byItemCodename('on_roasts')\n // .byItemExternalId('59713')\n .byLanguageId('d1f95fde-af02-b3b5-bd9e-f232311ccab8')\n // .byLanguageCodename('es-ES')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/types": { + "post": { + "description": "Create a new content type.\n", + "operationId": "add-a-content-type", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a content type", + "tags": ["Content types"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentType" + }, + "example": { + "external_id": "article", + "name": "Article", + "codename": "my_article", + "content_groups": [{ + "name": "Article copy", + "external_id": "article-copy" + }, { + "name": "Author", + "external_id": "author" + }], + "elements": [{ + "name": "Article title", + "codename": "title", + "type": "text", + "content_group": { + "external_id": "article-copy" + } + }, { + "name": "Article body", + "codename": "body", + "type": "rich_text", + "content_group": { + "external_id": "article-copy" + } + }, { + "name": "Author bio", + "codename": "bio", + "allowed_blocks": ["images", "text"], + "type": "rich_text", + "content_group": { + "external_id": "author" + } + }] + } + } + }, + "description": "The content type to be added.\n", + "required": true + }, + "responses": { + "201": { + "description": "The created content type.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentType" + }, + "example": { + "id": "d622fc28-5202-511a-9dbf-a3ee363b6c7c", + "codename": "my_article", + "last_modified": "2019-08-26T08:38:49.7302435Z", + "external_id": "article", + "name": "Article", + "content_groups": [{ + "id": "c2deb028-1bad-5191-952f-ace4b256ba61", + "name": "Article copy", + "codename": "article_copy", + "external_id": "article-copy" + }, { + "id": "46d8c4db-df5c-55ab-887a-458f7ad063a1", + "name": "Author", + "codename": "author", + "external_id": "author" + }], + "elements": [{ + "maximum_text_length": null, + "name": "Article title", + "guidelines": null, + "is_required": false, + "type": "text", + "id": "e32743cd-7616-4a4a-9948-c9fcb54bff3f", + "codename": "title", + "content_group": { + "id": "c2deb028-1bad-5191-952f-ace4b256ba61" + } + }, { + "maximum_text_length": null, + "maximum_image_size": null, + "allowed_content_types": [], + "image_width_limit": null, + "image_height_limit": null, + "allowed_image_types": "any", + "allowed_blocks": [], + "name": "Article body", + "guidelines": null, + "is_required": false, + "type": "rich_text", + "id": "bbddb422-774c-4226-984d-c15656df6108", + "codename": "body", + "content_group": { + "id": "c2deb028-1bad-5191-952f-ace4b256ba61" + } + }, { + "maximum_text_length": null, + "maximum_image_size": null, + "allowed_content_types": [], + "image_width_limit": null, + "image_height_limit": null, + "allowed_image_types": "any", + "allowed_blocks": ["images", "text"], + "name": "Author bio", + "guidelines": null, + "is_required": false, + "type": "rich_text", + "id": "1c795ec7-368c-4c22-830e-e8b969f596be", + "codename": "bio", + "content_group": { + "id": "46d8c4db-df5c-55ab-887a-458f7ad063a1" + } + }] + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentType" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "Provide taxonomy reference for taxonomy element." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"external_id\": \"article\",\n \"name\": \"Article\",\n \"codename\": \"my_article\",\n \"content_groups\": [\n {\n \"name\": \"Article copy\",\n \"external_id\": \"article-copy\"\n },\n {\n \"name\": \"Author\",\n \"external_id\": \"author\"\n }\n ],\n \"elements\": [\n {\n \"name\": \"Article title\",\n \"codename\": \"title\",\n \"type\": \"text\",\n \"content_group\": {\n \"external_id\": \"article-copy\"\n }\n },\n {\n \"name\": \"Article body\",\n \"codename\": \"body\",\n \"type\": \"rich_text\",\n \"content_group\": {\n \"external_id\": \"article-copy\"\n }\n },\n {\n \"name\": \"Author bio\",\n \"codename\": \"bio\",\n \"allowed_blocks\": [\n \t\"images\",\n \t\"text\"\n \t],\n \"type\": \"rich_text\",\n \"content_group\": {\n \"external_id\": \"author\"\n }\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient, ElementModels } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addContentType()\n .withData(\n {\n name: \"Article\",\n codename: \"my_article\",\n external_id: \"article\",\n content_groups: [\n {\n name: \"Article copy\",\n external_id: \"article-copy\",\n },\n {\n name: \"Author\",\n external_id: \"author\",\n }\n ],\n elements: [\n {\n name: \"Article title\",\n codename: \"title\",\n type: ElementModels.ElementType.text,\n content_group: {\n external_id: \"article-copy\"\n },\n },\n {\n name: \"Article body\",\n codename: \"body\",\n type: ElementModels.ElementType.richText,\n content_group: {\n external_id: \"article-copy\"\n },\n },\n {\n name: \"Author bio\",\n codename: \"bio\",\n type: ElementModels.ElementType.richText,\n allowed_blocks: [\n \t \"images\",\n \t \"text\"\n \t ],\n content_group: {\n external_id: \"author\"\n },\n },\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of content types.\n", + "operationId": "list-content-types", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" + }, { + "$ref": "#/components/parameters/x_continuation_4a04ea9" + }], + "summary": "List content types", + "tags": ["Content types"], + "responses": { + "200": { + "description": "A dynamically paginated list of content types.\n", + "content": { + "application/json": { + "schema": { + "required": ["types", "pagination"], + "properties": { + "types": { + "items": { + "$ref": "#/components/schemas/ContentType" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/pagination" + } + }, + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listContentTypes()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/types/{type_identifier}": { + "get": { + "description": "Retrieve information about a single content type.\n", + "operationId": "retrieve-a-content-type", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/type_identifier" + }], + "summary": "Retrieve a content type", + "tags": ["Content types"], + "responses": { + "200": { + "description": "A content type object with metadata about the type and a collection of its elements.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentType" + }, + "example": { + "id": "269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0", + "codename": "hosted_video", + "last_modified": "2017-06-27T12:55:39.054Z", + "external_id": "Content-Type-123", + "name": "Hosted video", + "content_groups": [], + "elements": [{ + "name": "Video ID", + "guidelines": "", + "type": "text", + "id": "116a2441-6441-7124-c85b-46a4fef5dcb9", + "codename": "video_id" + }, { + "mode": "single", + "options": [{ + "id": "523e6231-8d80-a158-3601-dffde4e64a78", + "codename": "youtube", + "name": "YouTube" + }, { + "id": "d66ffa49-86ff-eeaa-c33b-e5d9eefe8b81", + "codename": "vimeo", + "name": "Vimeo" + }], + "name": "Video host", + "guidelines": "", + "type": "multiple_choice", + "id": "87924912-4861-aa84-176a-1eae7b22529b", + "codename": "video_host" + }] + } + } + } + }, + "404": { + "description": "The specified content type was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "The requested content type '269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/codename/hosted_video \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/external-id/Content-Type-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewContentType()\n .byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')\n // .byTypeCodename('hosted_video')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "patch": { + "description": "Modify content types, their elements, and the configuration of specific objects.\n\nYou can modify the specified content type and its contents in three ways based on your chosen operation type (in the `op` body parameter):\n* `addInto` to add an element or content group to the content type or add an option to a multiple choice element.\n* `remove` to delete a specific element or content group from the content type or delete a specific option from a multiple choice element.\n* `replace` to change the value of a specific property of a specified object.\n\nFor any operation that does not affect the content type itself, you need to include a `{path_reference}` in the `path` body parameter for the object you want to modify. Path references can be by ID, codename, or external ID, but take a slightly different form from references to the content type:\n* `id:5eb3d03e-c69d-4e93-b4cc-76f453271386`\n* `codename:my_text_element`\n* `external_id:text_from_external_database` – Note that any special characters such as slashes (`/`) need to be escaped, so the external ID `external/id` would need to be added to `path` as `external_id:external\\/id`.\n", + "operationId": "modify-a-content-type", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/type_identifier" + }], + "summary": "Modify a content type", + "tags": ["Content types"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "discriminator": { + "mapping": { + "addInto": "#/components/schemas/TypeOperationAddInto", + "remove": "#/components/schemas/TypeOperationRemove", + "replace": "#/components/schemas/TypeOperationReplace" + }, + "propertyName": "op" + }, + "oneOf": [{ + "$ref": "#/components/schemas/TypeOperationAddInto" + }, { + "$ref": "#/components/schemas/TypeOperationRemove" + }, { + "$ref": "#/components/schemas/TypeOperationReplace" + }] + }, + "uniqueItems": true, + "type": "array" + }, + "example": [{ + "op": "replace", + "path": "/name", + "value": "A new type name" + }, { + "op": "replace", + "path": "/elements/codename:my_text_element/guidelines", + "value": "Here you can tell users how to fill in the element." + }, { + "op": "addInto", + "path": "/elements", + "value": { + "name": "My title", + "type": "text", + "guidelines": "Title of the article in plain text.", + "external_id": "my-title-id" + } + }, { + "op": "remove", + "path": "/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae" + }, { + "op": "remove", + "path": "/elements/external_id:my_multiple_choice/options/codename:my_option" + }, { + "op": "remove", + "path": "/elements/id:e94fab1f-c2c1-4f4a-b36c-3f7a0808d2b8/allowed_blocks/text" + }] + } + }, + "description": "A list of operations to perform over your project's content types.\n", + "required": true + }, + "responses": { + "200": { + "description": "The modified content type.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentType" + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|e70dfd410782714e9b3d9caf1a15ee38.bdac945_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Invalid operation with index '0': Cannot add the last allowed limitation type. Remove all limitation types in order to create a rich-text element without any limitations." + }] + } + } + } + }, + "404": { + "description": "The specified content type was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|eb2cacad4c0a544b885e2ea90c7ba7d3.d9d6cf96_", + "error_code": 107, + "message": "The requested content type was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PATCH \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/0be13600-e57c-577d-8108-c8d860330985 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/codename/my_article \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/external_id/my-article-id \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"A new type name\"\n },\n {\n \"op\": \"replace\",\n \"path\": \"/elements/codename:my_text_element/guidelines\",\n \"value\": \"Here you can tell users how to fill in the element.\"\n },\n {\n \"op\": \"addInto\",\n \"path\": \"/elements\",\n \"value\": {\n \"name\": \"My title\",\n \"type\": \"text\",\n \"guidelines\": \"Title of the article in plain text.\",\n \"external_id\": \"my-title-id\"\n }\n },\n {\n \"op\": \"remove\",\n \"path\": \"/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/elements/external_id:my-multiple-choice-id/options/codename:my_option\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/elements/id:e94fab1f-c2c1-4f4a-b36c-3f7a0808d2b8/allowed_blocks/text\"\n }\n]'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.modifyContentType()\n .byTypeId(\"0be13600-e57c-577d-8108-c8d860330985\")\n //.byTypeCodename(\"my_article\")\n //.byTypeExternalId(\"my-article-id\")\n .withData (\n [\n {\n op: \"replace\",\n path: \"/name\",\n value: \"A new type name\"\n },\n {\n op: \"replace\",\n path: \"/elements/codename:my_text_element/guidelines\",\n value: \"Here you can tell users how to fill in the element.\"\n },\n {\n op: \"addInto\",\n path: \"/elements\",\n value: {\n name: \"My title\",\n type: \"text\",\n guidelines: \"Title of the article in plain text.\",\n external_id: \"my-title-id\"\n }\n },\n {\n op: \"remove\",\n path: \"/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae\"\n },\n {\n op: \"remove\",\n path: \"/elements/external_id:my-multiple-choice-id/options/codename:my_option\"\n },\n {\n op: \"remove\",\n path: \"/elements/id:e94fab1f-c2c1-4f4a-b36c-3f7a0808d2b8/allowed_blocks/text\"\n }\n ]\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "delete": { + "description": "Delete an unused content type.\n", + "operationId": "delete-a-content-type", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/type_identifier" + }], + "summary": "Delete a content type", + "tags": ["Content types"], + "responses": { + "204": { + "description": "The specified type was deleted from the project.\n" + }, + "400": { + "description": "The specified type is used by content items and cannot be deleted.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|6374648c6c8f18449b027b68dad7808a.f72d851f_", + "error_code": 0, + "message": "Type 'Article (d622fc28-5202-511a-9dbf-a3ee363b6c7c)' is still used and cannot be archived." + } + } + } + }, + "404": { + "description": "The specified type was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "The requested content type was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/codename/hosted_video \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/types/external-id/Content-Type-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.deleteContentType()\n .byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')\n // .byTypeCodename('hosted_video')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/snippets": { + "post": { + "description": "Create a new snippet.\n", + "operationId": "add-a-content-type-snippet", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a content type snippet", + "tags": ["Content type snippets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentTypeSnippet" + }, + "example": { + "name": "Metadata", + "codename": "my_metadata", + "external_id": "my_metadata_elements", + "elements": [{ + "name": "Meta title", + "codename": "my_metadata__meta_title", + "guidelines": "Length: 30–60 characters", + "type": "text", + "external_id": "my-meta-title" + }, { + "name": "Meta description", + "codename": "my_metadata__meta_description", + "guidelines": "Length: 70-150 characters", + "type": "text", + "external_id": "my-meta-description" + }] + } + } + }, + "description": "The content type snippet to be added.\n", + "required": true + }, + "responses": { + "201": { + "description": "The created content type snippet.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentTypeSnippet" + }, + "example": { + "id": "c295baa0-f910-499f-9ca2-523be657019d", + "codename": "my_metadata", + "name": "Metadata", + "external_id": "my_metadata_elements", + "elements": [{ + "name": "Meta title", + "guidelines": "Length: 30–60 characters", + "type": "text", + "id": "c44bf9dd-aa3f-41c7-b4d9-a09390e41e16", + "codename": "my_metadata__meta_title", + "external_id": "my-meta-title" + }, { + "name": "Meta description", + "guidelines": "Length: 70-150 characters", + "type": "text", + "id": "59b9800b-81a9-4720-bef0-d4cecbaa646c", + "codename": "my_metadata__meta_description", + "external_id": "my-meta-description" + }] + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "4df10acd-4c69-4043-854f-bc175adbeb8f", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Provide a nonempty name which fits within 50 characters." + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{ \n \"name\":\"metadata\",\n \"codename\": \"my_metadata\",\n \"external_id\":\"snippet-item-123\",\n \"elements\":[\n { \n \"name\":\"Meta title\",\n \"codename\": \"my_metadata__meta_title\",\n \"guidelines\":\"Length: 30–60 characters\",\n \"type\":\"text\",\n \"external_id\":\"meta_title\"\n },\n { \n \"name\":\"Meta description\",\n \"codename\": \"my_metadata__meta_description\",\n \"guidelines\":\"Length: 70-150 characters\",\n \"type\":\"text\",\n \"external_id\":\"meta_description\"\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addContentTypeSnippet()\n .withData(\n {\n name: \"metadata\",\n codename: \"my_metadata\",\n external_id: \"snippet-item-123\",\n elements: [\n {\n name: \"Meta title\",\n codename: \"my_metadata__meta_title\",\n guidelines: \"Length: 30–60 characters\",\n type: ElementModels.ElementType.text,\n external_id: \"meta_title\"\n },\n {\n name: \"Meta description\",\n codename: \"my_metadata__meta_description\",\n guidelines: \"Length: 70-150 characters\",\n type: ElementModels.ElementType.text,\n external_id: \"meta_title\"\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of content type snippets.\n", + "operationId": "list-content-type-snippets", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" + }, { + "$ref": "#/components/parameters/x_continuation_4a04ea9" + }], + "summary": "List content type snippets", + "tags": ["Content type snippets"], + "responses": { + "200": { + "description": "A dynamically paginated list of content type snippets.\n", + "content": { + "application/json": { + "schema": { + "required": ["snippets", "pagination"], + "properties": { + "snippets": { + "items": { + "$ref": "#/components/schemas/ContentTypeSnippet" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/pagination" + } + }, + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listContentTypeSnippets()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/snippets/{snippet_identifier}": { + "get": { + "description": "Retrieve information about a single content type snippet.\n", + "operationId": "retrieve-a-content-type-snippet", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/snippet_identifier" + }], + "summary": "Retrieve a content type snippet", + "tags": ["Content type snippets"], + "responses": { + "200": { + "description": "A content type snippet with metadata.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentTypeSnippet" + }, + "example": { + "id": "baf884be-531f-441f-ae88-64205efdd0f6", + "codename": "my_metadata", + "last_modified": "2018-06-20T10:25:49.133Z", + "name": "My metadata", + "external-id": "snippet-type-123", + "elements": [{ + "name": "Meta title", + "guidelines": "Length: 30–60 characters", + "type": "text", + "id": "09398b24-61ed-512e-5b5c-affd54a098e5", + "codename": "my_metadata__meta_title" + }, { + "name": "Meta description", + "guidelines": "Length: 70–150 characters", + "type": "text", + "id": "2e555cc1-1eae-520c-189e-28548904f529", + "codename": "my_metadata__meta_description" + }] + } + } + } + }, + "404": { + "description": "The specified content type snippet was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "The requested content type snippet 'baf884be-531f-441f-ae88-64205efdd0f6' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/baf884be-531f-441f-ae88-64205efdd0f6 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/codename/metadata \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/external-id/snippet-type-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewContentTypeSnippet()\n .byTypeId('269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0')\n // .byTypeCodename('hosted_video')\n // .byTypeExternalId('snippet-type-123')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "patch": { + "description": "Modify content type snippets, their elements, and the configuration of specific objects.\n\nYou can modify the specified content type snippet and its contents in three ways based on your chosen operation type (in the `op` body parameter):\n* `addInto` to add an element to a content type snippet or add an option to a multiple choice element.\n* `remove` to delete a specific element from the specified content type snippet or delete a specific option from a multiple choice element.\n* `replace` to change the value of a specific property of a specified object.\n\nFor any operation that does not affect the content type snippet itself, you need to include a `{path_reference}` in the `path` body parameter for the object you want to modify. Path references can be by ID, codename, or external ID, but take a slightly different form from references to the content type snippet:\n* `id:5eb3d03e-c69d-4e93-b4cc-76f453271386`\n* `codename:snippet_codename__my_text_element`\n* `external_id:text_from_external_database` – Note that any special characters such as slashes (`/`) need to be escaped, so the external ID `external/id` would need to be added to `path` as `external_id:external\\/id`.\n", + "operationId": "modify-a-content-type-snippet", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/snippet_identifier" + }], + "summary": "Modify a content type snippet", + "tags": ["Content type snippets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "An array of operations to perform\n", + "items": { + "discriminator": { + "mapping": { + "addInto": "#/components/schemas/SnippetOperationAddInto", + "remove": "#/components/schemas/SnippetOperationRemove", + "replace": "#/components/schemas/SnippetOperationReplace" + }, + "propertyName": "op" + }, + "oneOf": [{ + "$ref": "#/components/schemas/SnippetOperationAddInto" + }, { + "$ref": "#/components/schemas/SnippetOperationRemove" + }, { + "$ref": "#/components/schemas/SnippetOperationReplace" + }] + }, + "type": "array" + }, + "example": [{ + "op": "replace", + "path": "/name", + "value": "A new snippet name" + }, { + "op": "replace", + "path": "/elements/codename:my_metadata__my_meta_description/guidelines", + "value": "Length: 70-150 characters." + }, { + "op": "addInto", + "path": "/elements", + "value": { + "name": "My meta title", + "type": "text", + "guidelines": "Length: 30–60 characters.", + "external_id": "my-meta-title-id" + } + }, { + "op": "remove", + "path": "/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae" + }, { + "op": "remove", + "path": "/elements/external_id:my_multiple_choice/options/codename:my_option" + }] + } + }, + "description": "The operations to perform on the content type snippets.\n", + "required": true + }, + "responses": { + "200": { + "description": "The modified content type snippet and its metadata.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ContentTypeSnippet" + }, + "example": { + "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": null, + "name": "My meta title", + "guidelines": "Length: 30–60 characters.", + "is_required": false, + "type": "text", + "external_id": "my-meta-title-id", + "id": "0eb2bcda-5b9f-4425-b9e1-c7679356e456", + "codename": "my_metadata_snippet__my_meta_title" + }, { + "maximum_text_length": { + "value": 150, + "applies_to": "characters" + }, + "name": "My meta description", + "guidelines": "Length: 70-150 characters.", + "is_required": false, + "type": "text", + "id": "f79ad793-b01d-42b0-b06c-7043cd9b6f31", + "codename": "my_metadata_snippet__my_meta_description" + }, { + "mode": "single", + "options": [{ + "id": "6bfe5a60-5cc2-4303-8f72-9cc53431046b", + "codename": "my_other_multiple_choice_option", + "name": "My other multiple choice option" + }, { + "id": "8e6ec8b1-6510-4b9b-b4be-6c977f4bdfbc", + "codename": "another_multiple_choice_option", + "name": "Another multiple choice option" + }], + "name": "My multiple choice", + "guidelines": null, + "is_required": false, + "id": "fcc30f1e-9abf-41da-8693-ed89f3be438d", + "codename": "my_metadata_snippet__my_multiple_choice", + "type": "multiple_choice", + "external_id": "my-multiple-choice-id" + }] + } + } + } + }, + "400": { + "description": "The specified set of operations is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|ac514428bcac904987759fbc2ae81138.29956127_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Invalid operation with index '0': The referenced object was not found." + }] + } + } + } + }, + "404": { + "description": "The specified content type snippet was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|eb2cacad4c0a544b885e2ea90c7ba7d3.d9d6cf96_", + "error_code": 109, + "message": "The requested content type snippet was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PATCH \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/baf884be-531f-441f-ae88-64205efdd0f6 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/codename/my_metadata_snippet \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/external_id/my-metadata-snippet-id \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"A new snippet name\"\n },\n {\n \"op\": \"replace\",\n \"path\": \"/elements/codename:my_metadata__my_meta_description/guidelines\",\n \"value\": \"Length: 70-150 characters.\"\n },\n {\n \"op\": \"addInto\",\n \"path\": \"/elements\",\n \"value\": {\n \"name\": \"My meta title\",\n \"type\": \"text\",\n \"guidelines\": \"Length: 30–60 characters.\",\n \"external_id\": \"my-meta-title-id\"\n }\n },\n {\n \"op\": \"remove\",\n \"path\": \"/elements/id:0b2015d0-16ae-414a-85f9-7e1a4b3a3eae\"\n },\n {\n \"op\": \"remove\",\n \"path\": \"/elements/external_id:my-multiple-choice-id/options/codename:my_option\"\n }\n]'" + }] + }, + "delete": { + "description": "Delete an unused content type snippet.\n", + "operationId": "delete-a-content-type-snippet", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/snippet_identifier" + }], + "summary": "Delete a content type snippet", + "tags": ["Content type snippets"], + "responses": { + "204": { + "description": "The specified snippet was deleted from the project.\n" + }, + "400": { + "description": "The specified snippet is still used in one or more content types.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|e7fd2e620a1e6445ab42f555d8fd7b6f.1c90015b_", + "error_code": 0, + "message": "Type 'Metadata (baf884be-531f-441f-ae88-64205efdd0f6)' is still used and cannot be archived." + } + } + } + }, + "404": { + "description": "The specified content type snippet was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "The requested content type snippet 'baf884be-531f-441f-ae88-64205efdd0f6' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/baf884be-531f-441f-ae88-64205efdd0f6 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/codename/metadata \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/snippets/external-id/snippet-type-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.deleteContentTypeSnippet()\n .byTypeId('baf884be-531f-441f-ae88-64205efdd0f6')\n // .byTypeCodename('metadata')\n // .byTypeExternalId('snippet-type-123')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/taxonomies": { + "post": { + "description": "Create a new taxonomy group.\n", + "operationId": "add-a-taxonomy-group", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a taxonomy group", + "tags": ["Taxonomy groups"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxonomyGroup" + }, + "example": { + "name": "Personas", + "external_id": "Tax-Group-123", + "codename": "people", + "terms": [{ + "name": "Coffee expert", + "external_id": "Tax-term-456", + "codename": "expert", + "terms": [{ + "name": "Barista", + "external_id": "Tax-term-789", + "terms": [] + }, { + "name": "Cafe owner", + "external_id": "Tax-term-101", + "terms": [] + }] + }, { + "name": "Coffee enthusiast", + "external_id": "Tax-term-112", + "codename": "enthusiast", + "terms": [{ + "name": "Coffee lover", + "codename": "lover", + "external_id": "Tax-term-131", + "terms": [] + }, { + "name": "Coffee blogger", + "codename": "blogger", + "external_id": "Tax-term-145", + "terms": [] + }] + }] + } + } + }, + "description": "The taxonomy group to add.\n", + "required": true + }, + "responses": { + "201": { + "description": "The added taxonomy group.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxonomyGroup" + }, + "example": { + "last_modified": "2018-11-14T13:03:39.6318181Z", + "name": "Personas", + "external_id": "Tax-Group-123", + "terms": [{ + "name": "Coffee expert", + "external_id": "Tax-term-456", + "terms": [{ + "name": "Barista", + "external_id": "Tax-term-789", + "terms": [], + "id": "9bee9779-a9c6-5d66-875b-aaf7093b4ac2", + "codename": "barista" + }, { + "name": "Cafe owner", + "external_id": "Tax-term-101", + "terms": [], + "id": "9b897d7b-ded7-5de1-aee1-1e90e43db747", + "codename": "cafe_owner" + }], + "id": "012a94e4-76b4-5a5d-95ce-164577c9b5e5", + "codename": "expert" + }, { + "name": "Coffee enthusiast", + "external_id": "Tax-term-112", + "terms": [{ + "name": "Coffee lover", + "external_id": "Tax-term-131", + "terms": [], + "id": "146c5e35-dffe-5977-b943-16f0e862af2e", + "codename": "lover" + }, { + "name": "Coffee blogger", + "external_id": "Tax-term-145", + "terms": [], + "id": "8d980871-c510-5a58-aad1-f40fc5f28bbd", + "codename": "blogger" + }], + "id": "6104cfd7-59db-51ff-a042-f82e1df18262", + "codename": "enthusiast" + }], + "id": "0be13600-e57c-577d-8108-c8d860330985", + "codename": "people" + } + } + } + }, + "400": { + "description": "The specified request body is invalid or the taxonomy group already exists.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "e92fe248-83b9-439b-a0be-8c9e7622f7c3", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "No terms were provided, provide at least an empty collection of terms." + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n {\n \"name\": \"Personas\",\n \"external_id\": \"Tax-Group-123\",\n \"codename\": \"people\",\n \"terms\": [\n {\n \"name\": \"Coffee expert\",\n \"external_id\": \"Tax-term-456\",\n \"codename\": \"expert\",\n \"terms\": [\n {\n \"name\": \"Barista\",\n \"external_id\": \"Tax-term-789\",\n \"terms\": []\n },\n {\n \"name\": \"Cafe owner\",\n \"external_id\": \"Tax-term-101\",\n \"terms\": []\n }\n ]\n },\n {\n \"name\": \"Coffee enthusiast\",\n \"external_id\": \"Tax-term-112\",\n \"codename\": \"enthusiast\",\n \"terms\": [\n {\n \"name\": \"Coffee lover\",\n \"external_id\": \"Tax-term-131\",\n \"codename\": \"lover\",\n \"terms\": []\n },\n {\n \"name\": \"Coffee blogger\",\n \"external_id\": \"Tax-term-145\",\n \"codename\": \"blogger\",\n \"terms\": []\n }\n ]\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addTaxonomy()\n .withData(\n {\n name: \"Personas\",\n externalId: \"Tax-Group-123\",\n codename: \"people\",\n terms: [\n {\n name: \"Coffee expert\",\n externalId: \"Tax-term-456\",\n codename: \"expert\",\n terms: [\n {\n name: \"Barista\",\n externalId: \"Tax-term-789\",\n terms: []\n },\n {\n name: \"Cafe owner\",\n externalId: \"Tax-term-101\",\n terms: []\n }\n ]\n },\n {\n name: \"Coffee enthusiast\",\n codename: \"enthusiast\",\n externalId: \"Tax-term-112\",\n terms: [\n {\n name: \"Coffee lover\",\n codename: \"lover\",\n externalId: \"Tax-term-131\",\n terms: []\n },\n {\n name: \"Coffee blogger\",\n codename: \"blogger\",\n externalId: \"Tax-term-145\",\n terms: []\n }\n ]\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of taxonomy groups in your project.\n", + "operationId": "list-taxonomy-groups", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" + }, { + "$ref": "#/components/parameters/x_continuation_4a04ea9" + }], + "summary": "List taxonomy groups", + "tags": ["Taxonomy groups"], + "responses": { + "200": { + "description": "A list of taxonomy groups\n", + "content": { + "application/json": { + "schema": { + "required": ["taxonomies", "pagination"], + "properties": { + "taxonomies": { + "description": "A list of taxonomies.\n", + "items": { + "$ref": "#/components/schemas/TaxonomyGroup" + }, + "uniqueItems": true, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/pagination" + } + }, + "type": "object" + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listTaxonomies()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/taxonomies/{taxonomy_group_identifier}": { + "get": { + "description": "Retrieve a single taxonomy group.\n", + "operationId": "retrieve-a-taxonomy-group", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/taxonomy_group_identifier" + }], + "summary": "Retrieve a taxonomy group", + "tags": ["Taxonomy groups"], + "responses": { + "200": { + "description": "A single taxonomy group with metadata.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxonomyGroup" + } + } + } + }, + "404": { + "description": "The specified taxonomy group was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "80006583-0000-f900-b63f-84710c7967bb", + "error_code": 107, + "message": "The requested taxonomy was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/0be13600-e57c-577d-8108-c8d860330985 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/codename/personas/ \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/external-id/Tax-Group-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + }, + "patch": { + "description": "Modify the specified taxonomy group and terms using the `replace`, `remove`, and `addInto` operations.\n", + "operationId": "modify-a-taxonomy-group", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/taxonomy_group_identifier" + }], + "summary": "Modify a taxonomy group", + "tags": ["Taxonomy groups"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "An array of operations to perform.\n", + "items": { + "discriminator": { + "mapping": { + "addInto": "#/components/schemas/TaxonomyOperationAddInto", + "remove": "#/components/schemas/TaxonomyOperationRemove", + "replace": "#/components/schemas/TaxonomyOperationReplace" + }, + "propertyName": "op" + }, + "oneOf": [{ + "$ref": "#/components/schemas/TaxonomyOperationAddInto" + }, { + "$ref": "#/components/schemas/TaxonomyOperationRemove" + }, { + "$ref": "#/components/schemas/TaxonomyOperationReplace" + }] + }, + "type": "array" + }, + "example": [{ + "op": "replace", + "property_name": "name", + "value": "Buyer personas" + }, { + "op": "replace", + "property_name": "codename", + "value": "personas" + }, { + "op": "replace", + "reference": { + "codename": "enthusiast" + }, + "property_name": "terms", + "value": [{ + "name": "Coffee lover", + "terms": [], + "codename": "lover" + }, { + "name": "Coffee blogger", + "codename": "blogger", + "terms": [{ + "name": "Coffee connoisseur", + "codename": "connoisseur", + "terms": [] + }] + }] + }, { + "op": "remove", + "reference": { + "id": "9b897d7b-ded7-5de1-aee1-1e90e43db747" + } + }, { + "op": "addInto", + "reference": { + "external_id": "Tax-term-456" + }, + "before": { + "external_id": "Tax-term-789" + }, + "value": { + "name": "Coffee roaster", + "codename": "roaster", + "terms": [] + } + }] + } + }, + "description": "The operations to perform on the specified taxonomy group.\n", + "required": true + }, + "responses": { + "200": { + "description": "The modified taxonomy group.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TaxonomyGroup" + }, + "example": { + "last_modified": "2019-04-02T08:08:40.3083064Z", + "id": "f30c7f72-e9ab-8832-2a57-62944a038809", + "name": "Buyer personas", + "codename": "personas", + "terms": [{ + "id": "012a94e4-76b4-5a5d-95ce-164577c9b5e5", + "name": "Coffee expert", + "codename": "coffee_expert", + "external_id": "Tax-term-456", + "terms": [{ + "id": "9b897d7b-ded7-5de1-aee1-1e90e43db747", + "name": "Coffee roaster", + "codename": "roaster", + "external_id": "Tax-term-101", + "terms": [] + }, { + "id": "9bee9779-a9c6-5d66-875b-aaf7093b4ac2", + "name": "Barista", + "codename": "barista", + "external_id": "Tax-term-789", + "terms": [] + }] + }, { + "id": "6104cfd7-59db-51ff-a042-f82e1df18262", + "name": "Coffee enthusiast", + "codename": "coffee_enthusiast", + "external_id": "Tax-term-112", + "terms": [{ + "id": "146c5e35-dffe-5977-b943-16f0e862af2e", + "name": "Coffee lover", + "codename": "coffee_lover", + "terms": [] + }, { + "id": "8d980871-c510-5a58-aad1-f40fc5f28bbd", + "name": "Coffee blogger", + "codename": "coffee_blogger", + "terms": [{ + "name": "Coffee connoisseur", + "codename": "connoisseur", + "terms": [] + }] + }] + }] + } + } + } + }, + "400": { + "description": "One of the specified operations is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "e92fe248-83b9-439b-a0be-8c9e7622f7c3", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "No terms were provided, provide at least an empty collection of terms." + }] + } + } + } + }, + "404": { + "description": "The specified taxonomy group was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|eb2cacad4c0a544b885e2ea90c7ba7d3.d9d6cf96_", + "error_code": 107, + "message": "The requested taxonomy was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PATCH \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/0be13600-e57c-577d-8108-c8d860330985 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/codename/personas/ \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/external-id/Tax-Group-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n[\n {\n \"op\": \"replace\",\n \"property_name\": \"name\",\n \"value\": \"Buyer personas\"\n },\n {\n \"op\": \"replace\",\n \"property_name\": \"codename\",\n \"value\": \"personas\"\n },\n {\n \"op\": \"replace\",\n \"reference\": {\n \"codename\": \"enthusiast\"\n },\n \"property_name\": \"terms\",\n \"value\": [\n {\n \"name\": \"Coffee lover\",\n \"terms\": [],\n \"codename\": \"lover\"\n },\n {\n \"name\": \"Coffee blogger\",\n \"codename\": \"blogger\",\n \"terms\": [\n {\n \"name\": \"Coffee connoisseur\",\n \"codename\": \"connoisseur\",\n \"terms\": []\n }\n ]\n }\n ]\n },\n {\n \"op\": \"remove\",\n \"reference\": {\n \"id\": \"9b897d7b-ded7-5de1-aee1-1e90e43db747\"\n }\n },\n {\n \"op\": \"addInto\",\n \"reference\": {\n \"external_id\": \"Tax-term-456\"\n },\n \"before\": {\n \"external_id\": \"Tax-term-789\"\n },\n \"value\": {\n \"name\": \"Coffee roaster\",\n \"codename\": \"roaster\",\n \"terms\": []\n }\n }\n]'" + }] + }, + "delete": { + "description": "Delete a taxonomy group specified by its internal ID, codename, or external ID.\n", + "operationId": "delete-a-taxonomy-group", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/taxonomy_group_identifier" + }], + "summary": "Delete a taxonomy group", + "tags": ["Taxonomy groups"], + "responses": { + "204": { + "description": "The specified taxonomy group was deleted.\n" + }, + "404": { + "description": "The specified taxonomy group was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "9e6a2ec1-fb8e-49af-b1bc-011960ce4e2a", + "error_code": 107, + "message": "The requested taxonomy was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/0be13600-e57c-577d-8108-c8d860330985 \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/codename/personas/ \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/taxonomies/external-id/Tax-Group-123 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.deleteTaxonomy()\n .byTaxonomyId(\"dbff8416-c4c7-45d2-b497-a4a71a5cbe30\")\n // .byTaxonomyCodename(\"personas_222\")\n //.byTaxonomyExternalId(\"Tax-Group-124\")\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }] + } + }, + "/{project_id}/files/{file_name}": { + "post": { + "description": "Add a new file. The uploaded file will not be visible in the Kentico Kontent UI unless you [add an asset](https://docs.kontent.ai/link-to/add_an_asset) using it.\n\n**Note**: Maximum size limit for binary files is 100 MB.\n\n\n\n

Adding assets is a 2-step process

\n
    \n
  1. Upload a binary file – after uploading, you get a file reference to uploaded file.
  2. \n
  3. Create a new asset – use the file reference to link the new asset with the file.
  4. \n
\n\n\n", + "operationId": "upload-a-binary-file", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/file_name" + }, { + "$ref": "#/components/parameters/content_type_eb3978b" + }, { + "$ref": "#/components/parameters/content_length" + }], + "summary": "Upload a binary file", + "tags": ["Assets"], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "description": "The binary data of the file.\n", + "required": true + }, + "responses": { + "200": { + "description": "A file reference to the uploaded binary file.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileReference" + }, + "example": { + "id": "806ec84e-7c71-4856-9519-ee3dd3558583", + "type": "internal" + } + } + } + }, + "400": { + "description": "The specified request body or the provided parameters are invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-c403-0080000000c2", + "error_code": 205, + "message": "The request does not contain required header Content-Type." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/files/which-brewing-fits-you-1080px.jpg \\\n --data-binary \"@which-brewing-fits-you-1080px.jpg\" \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: image/jpeg' \\\n --header 'Content-length: 125770'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\n// Note that this approach works when using Node.js. See a worked example using the browser: https://github.com/Enngage/@kentico/kontent-management-js-demo\nimport { ManagementClient } from '@kentico/kontent-management';\nimport { readFileSync } from 'fs';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nconst data = readFileSync('which-brewing-fits-you-1080px.jpg');\n\nclient.uploadBinaryFile()\n .withData({\n binaryData: data,\n contentLength: data.byteLength,\n contentType: 'image/jpg',\n filename: 'which-brewing-fits-you-1080px.jpg'\n })\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nstring filePath = Path.Combine(AppContext.BaseDirectory, @\"\\which-brewing-fits-you-1080px.jpg\");\nstring contentType = \"image/jpeg\";\n\n// Binary file reference to be used when adding a new asset\nFileReference fileReference = await client.UploadFileAsync(new FileContentSource(filePath, contentType));\n\n// To create an asset, see the \"Add an asset\" endpoint" + }] + } + }, + "/{project_id}/assets": { + "post": { + "description": "Use a file reference to link an existing [binary file](https://docs.kontent.ai/link-to/upload_a_binary_file) to a new asset. You can also [create assets by upserting](https://docs.kontent.ai/link-to/upsert_an_asset) (PUT `/assets/external-id/`).\n\n**Note**: Each binary file can be referenced only by a single asset.\n", + "operationId": "add-an-asset", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add an asset", + "tags": ["Assets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "An asset to create.\n", + "required": ["file_reference", "descriptions"], + "properties": { + "file_reference": { + "$ref": "#/components/schemas/FileReference" + }, + "title": { + "description": "The title of the new asset. Use this parameter to better identify and filter your assets in the UI.\n", + "example": "Coffee Brewing Techniques", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "external_id": { + "description": "The external ID of the new asset. Use this parameter as a unique identifier for your assets.\n\n**Note**: You cannot upsert external ID into already existing assets within your Kentico Kontent project.\n", + "example": "which-brewing-fits-you", + "type": "string" + }, + "descriptions": { + "description": "An array of asset descriptions.\n", + "items": { + "$ref": "#/components/schemas/AssetDescription" + }, + "type": "array" + } + }, + "type": "object" + }, + "example": { + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "title": "Coffee Brewing Techniques", + "folder": { + "external_id": "another-folder" + }, + "external_id": "which-brewing-fits-you", + "descriptions": [{ + "language": { + "codename": "en-US" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "codename": "es-ES" + }, + "description": "Técnicas para hacer café" + }] + } + } + }, + "description": "The asset to create.\n", + "required": true + }, + "responses": { + "201": { + "description": "The created asset.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Asset" + }, + "example": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "file_name": "which-brewing-fits-you-1080px.jpg", + "title": "Coffee Brewing Techniques", + "size": 125770, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "image_width": 1000, + "image_height": 666, + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Técnicas para hacer café" + }], + "external_id": "which-brewing-fits-you", + "last_modified": "2017-09-12T08:29:36.1645977Z" + } + } + } + }, + "400": { + "description": "The specified request was invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-1614-0080000000cd", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Required property 'description' not found in JSON. Path 'descriptions[0]', line 7, position 6.", + "path": "descriptions[0]", + "line": 7, + "position": 6 + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/projects/v2/975bf280-fd91-488c-994c-2f04416e5ee3/assets \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"file_reference\": {\n \"id\": \"fcbb12e6-66a3-4672-85d9-d502d16b8d9c\",\n \"type\": \"internal\"\n },\n \"folder\": {\n \"external_id\": \"another-folder\"\n },\n \"title\": \"Coffee Brewing Techniques\",\n \"external_id\": \"which-brewing-fits-you\",\n \"descriptions\": [\n {\n \"language\": {\n \"codename\": \"en-US\"\n },\n \"description\": \"Coffee Brewing Techniques\"\n },\n {\n \"language\": {\n \"codename\": \"es-ES\"\n },\n \"description\": \"Técnicas para hacer café\"\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.addAsset()\n .withData(\n {\n // To create a file reference, see the \"Upload a binary file\" endpoint\n fileReference: {\n id: 'fcbb12e6-66a3-4672-85d9-d502d16b8d9c',\n type: 'internal'\n },\n title: 'Coffee Brewing Techniques',\n externalId: 'which-brewing-fits-you',\n descriptions: [\n {\n language: {\n codename: 'en-US'\n },\n description: 'Coffee Brewing Techniques'\n },\n {\n language: {\n codename: 'es-ES'\n },\n description: 'Técnicas para hacer café'\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n \nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nAssetUpsertModel model = new AssetUpsertModel\n{\n // To create a file reference, see the \"Upload a binary file\" endpoint\n FileReference = fileReference,\n\n Title = \"Coffee Brewing Techniques\",\n \n Descriptions = new List \n {\n new AssetDescription { Description = \"Coffee Brewing Techniques\", Language = LanguageIdentifier.ByCodename(\"en-US\") },\n new AssetDescription { Description = \"Técnicas para hacer café\", Language = LanguageIdentifier.ByCodename(\"es-ES\") }\n }\n};\n\nAssetModel assetResult = await client.CreateAssetAsync(model);" + }] + }, + "get": { + "description": "Retrieve a dynamically paginated list of assets.\n", + "operationId": "list-assets", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/continuationtoken_1b2d9a9" + }, { + "$ref": "#/components/parameters/x_continuation_4a04ea9" + }], + "summary": "List assets", + "tags": ["Assets"], + "responses": { + "200": { + "description": "A dynamically paginated list of assets.\n", + "content": { + "application/json": { + "schema": { + "required": ["assets", "pagination"], + "properties": { + "assets": { + "description": "List of assets.\n", + "items": { + "$ref": "#/components/schemas/Asset" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/pagination" + } + }, + "type": "object" + }, + "example": { + "assets": [{ + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "file_name": "which-brewing-fits-you-1080px.jpg", + "title": "Coffee Brewing Techniques", + "size": 125770, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "image_width": 1000, + "image_height": 666, + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Técnicas para hacer café" + }], + "last_modified": "2017-09-12T08:29:36.1645977Z" + }, { + "id": "8858d272-777b-43bd-93be-53a98be97569", + "file_name": "cafe05.jpg", + "title": "Café - Los Angeles", + "size": 114844, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/8858d272-777b-43bd-93be-53a98be97569/cafe05.jpg", + "image_width": 849, + "image_height": 565, + "file_reference": { + "id": "8858d272-777b-43bd-93be-53a98be97569", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Dancing Goat Café - Los Angeles" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Dancing Goat Café - Los Angeles" + }], + "last_modified": "2017-07-04T10:29:35.0964697Z" + }, { + "id": "32d055c4-8b32-48f2-881d-058a1854e36e", + "file_name": "cafe06.jpg", + "title": "Café - New York", + "size": 275350, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/32d055c4-8b32-48f2-881d-058a1854e36e/cafe06.jpg", + "image_width": 849, + "image_height": 565, + "file_reference": { + "id": "32d055c4-8b32-48f2-881d-058a1854e36e", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Dancing Goat Café - New York" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Dancing Goat Café - New York" + }], + "last_modified": "2017-07-04T10:30:24.2190457Z" + }], + "pagination": { + "continuation_token": "MTAw", + "next_page": "https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets?continuationToken=MTAw" + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/continuation_token_error" + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.listAssets()\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nListingResponseModel responseAssets = await client.ListAssetsAsync();" + }] + } + }, + "/{project_id}/assets/{asset_identifier}": { + "get": { + "description": "Retrieve information about a single asset.\n", + "operationId": "retrieve-an-asset", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/asset_identifier" + }], + "summary": "Retrieve an asset", + "tags": ["Assets"], + "responses": { + "200": { + "description": "A single asset object with metadata about the asset and the referenced binary file.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Asset" + }, + "example": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "file_name": "which-brewing-fits-you-1080px.jpg", + "title": "Coffe Brewing Techniques", + "size": 125770, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "image_width": 1000, + "image_height": 666, + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Técnicas para hacer café" + }], + "last_modified": "2017-09-12T08:29:36.1645977Z" + } + } + } + }, + "404": { + "description": "The specified asset was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-0e3f-0080000000d9", + "error_code": 105, + "message": "The requested asset 'fcbb12e6-66a3-4672-85d9-d502d16b8d9d' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/fcbb12e6-66a3-4672-85d9-d502d16b8d9c \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/external-id/which-brewing-fits-you \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.viewAsset()\n .byAssetId('0270ea18-4842-4d09-9570-17b41bb37e2d')\n // .byAssetExternalId('which-brewing-fits-you')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nAssetIdentifier identifier = AssetIdentifier.ById(Guid.Parse(\"fcbb12e6-66a3-4672-85d9-d502d16b8d9c\"));\n// AssetIdentifier identifier = AssetIdentifier.ByExternalId(\"which-brewing-fits-you\");\n\nAssetModel responseAssets = await client.GetAssetAsync(identifier);" + }] + }, + "put": { + "description": "Update an existing asset or add a new asset specified by external ID.\n\n**Note**: If no asset with the specified external ID exists in the project, the system will try to create one. For existing assets, the API updates only the specified asset's descriptions and title.\n", + "operationId": "upsert-an-asset", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/asset_identifier_for_upsert" + }], + "summary": "Upsert an asset", + "tags": ["Assets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [{ + "$ref": "#/components/schemas/UpdateAsset" + }, { + "$ref": "#/components/schemas/CreateAsset" + }] + } + } + }, + "description": "The asset to update or create.\n", + "required": true + }, + "responses": { + "200": { + "description": "The specified asset was updated.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Asset" + }, + "example": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "folder": { + "external_id": "another-folder" + }, + "file_name": "which-brewing-fits-you-1080px.jpg", + "title": "Coffee Brewing Techniques", + "size": 125770, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "image_width": 1000, + "image_height": 666, + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Técnicas para hacer café" + }], + "last_modified": "2017-09-12T08:29:36.1645977Z" + } + } + } + }, + "201": { + "description": "The specified asset was created.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Asset" + }, + "example": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "file_name": "which-brewing-fits-you-1080px.jpg", + "title": "Coffee Brewing Techniques", + "size": 125770, + "type": "image/jpeg", + "url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "image_width": 1000, + "image_height": 666, + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "descriptions": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" + }, + "description": "Técnicas para hacer café" + }], + "external_id": "which-brewing-fits-you", + "last_modified": "2017-09-12T08:29:36.1645977Z" + } + } + } + }, + "400": { + "description": "The request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-1614-0080000000cd", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Required property 'description' not found in JSON. Path 'descriptions[0]', line 7, position 6.", + "path": "descriptions[0]", + "line": 7, + "position": 6 + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "# The 'file_reference' property in the request body is only required when creating a new asset\ncurl --request PUT \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/external-id/which-brewing-fits-you \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/fcbb12e6-66a3-4672-85d9-d502d16b8d9c \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n{\n \"file_reference\": {\n \"id\": \"fcbb12e6-66a3-4672-85d9-d502d16b8d9c\",\n \"type\": \"internal\"\n },\n \"title\": \"Coffee Brewing Techniques\",\n \"folder\": {\n \"external_id\": \"another-folder\"\n },\n \"descriptions\": [\n {\n \"language\": {\n \"codename\": \"en-US\"\n },\n \"description\": \"Coffee Brewing Techniques\"\n },\n {\n \"language\": {\n \"codename\": \"es-ES\"\n },\n \"description\": \"Técnicas para hacer café\"\n }\n ]\n}'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\n// Used when updating an existing item\nclient.updateAsset()\n .withData(\n {\n title: \"Coffee Brewing Techniques\",\n assetId: 'fcbb12e6-66a3-4672-85d9-d502d16b8d9c',\n descriptions: [\n {\n language: {\n codename: 'en-US'\n },\n description: 'Coffee Brewing Techniques'\n },\n {\n language: {\n codename: 'es-ES'\n },\n description: 'Técnicas para hacer café'\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });\n\n\n// Used when creating a new asset or updating an existing one\nclient.upsertAsset()\n .withData(\n {\n // 'fileReference' is only required when creating a new asset\n // To create a file reference, see the \"Upload a binary file\" endpoint\n fileReference: {\n id: 'fcbb12e6-66a3-4672-85d9-d502d16b8d9c',\n type: 'internal'\n },\n title: \"Coffee Brewing Techniques\",\n assetExternalId: 'which-brewing-fits-you',\n descriptions: [\n {\n language: {\n codename: 'en-US'\n },\n description: 'Coffee Brewing Techniques'\n },\n {\n language: {\n codename: 'es-ES'\n },\n description: 'Técnicas para hacer café'\n }\n ]\n }\n )\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\n// Note: When creating a new asset, use external ID as an identifier. When updating an asset, you can use internal ID or external ID\nAssetIdentifier identifier = AssetIdentifier.ByExternalId(\"which-brewing-fits-you\");\n// AssetIdentifier identifier = AssetIdentifier.ById(Guid.Parse(\"fcbb12e6-66a3-4672-85d9-d502d16b8d9c\"));\n\n// Used when updating an existing asset\nAssetUpdateModel updateModel = new AssetUpdateModel\n{\n\n Title = \"Coffee Brewing Techniques\",\n \n Descriptions = new List \n {\n new AssetDescription { Description = \"Coffee Brewing Techniques\", Language = LanguageIdentifier.ByCodename(\"en-US\") },\n new AssetDescription { Description = \"Técnicas para hacer café\", Language = LanguageIdentifier.ByCodename(\"es-ES\") }\n }\n};\n\n// Used when creating a new asset or updating an existing one\nAssetUpsertModel upsertModel = new AssetUpsertModel\n{\n // 'fileReference' is only required when creating a new asset\n // To create a file reference, see the \"Upload a binary file\" endpoint\n FileReference = fileReference,\n\n Title = \"Coffee Brewing Techniques\",\n \n Descriptions = new List\n {\n new AssetDescription { Description = \"Coffee Brewing Techniques\", Language = LanguageIdentifier.ByCodename(\"en-US\") },\n new AssetDescription { Description = \"Técnicas para hacer café\", Language = LanguageIdentifier.ByCodename(\"es-ES\") }\n }\n};\n\nAssetModel updatedAssetResponse = await client.UpdateAssetAsync(identifier, updateModel);\nAssetModel createdAssetResponse = await client.UpsertAssetByExternalIdAsync(identifier, upsertModel);" + }] + }, + "delete": { + "description": "Delete an unused asset from your project.\n", + "operationId": "delete-an-asset", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/asset_identifier" + }], + "summary": "Delete an asset", + "tags": ["Assets"], + "responses": { + "204": { + "description": "The specified asset was deleted from the project.\n" + }, + "404": { + "description": "The specified asset was already deleted or doesn't exist.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "00000000-0000-0000-6f12-0080000000c7", + "error_code": 105, + "message": "The requested asset 'fcbb12e6-66a3-4672-85d9-d502d16b8d9c' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/fcbb12e6-66a3-4672-85d9-d502d16b8d9c \\\n# --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/assets/external-id/which-brewing-fits-you \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.deleteAsset()\n .byAssetId('1b458663-d23a-441c-8cc2-c2825fe53b48')\n // .byAssetExternalId('which-brewing-fits-you')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\nAssetIdentifier identifier = AssetIdentifier.ById(Guid.Parse(\"fcbb12e6-66a3-4672-85d9-d502d16b8d9c\"));\n// AssetIdentifier identifier = AssetIdentifier.ByExternalId(\"which-brewing-fits-you\");\n\nawait client.DeleteAssetAsync(identifier);" + }] + } + }, + "/{project_id}/folders": { + "get": { + "description": "Retrieve an array of all asset folders in your project.\n", + "operationId": "retrieve-asset-folders", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Retrieve asset folders", + "tags": ["Assets"], + "responses": { + "200": { + "description": "All asset folders in the project.\n", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/AssetFolders" + }, + "type": "array" + }, + "example": { + "last_modified": "2019-11-07T09:25:44.0680996", + "folders": [{ + "id": "958001d8-2228-4373-b966-5262b5b96f71", + "name": "Top level folder", + "external_id": "top-folder", + "folders": [{ + "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0", + "name": "Second level folder", + "external_id": "second-folder", + "folders": [] + }] + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/folders \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + }, + "post": { + "description": "Add one or more asset folders to a project. If your project already has folders, use [modify asset folders](https://docs.kontent.ai/link-to/modify_asset_folders) instead.\n", + "operationId": "add-asset-folders", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add asset folders", + "tags": ["Assets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetFolders" + }, + "example": { + "folders": [{ + "name": "Top level folder", + "external_id": "top-folder", + "folders": [{ + "name": "Second level folder", + "external_id": "second-folder", + "folders": [] + }] + }] + } + } + }, + "description": "The asset folders to add.\n" + }, + "responses": { + "201": { + "description": "The created asset folders object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetFolders" + }, + "example": { + "last_modified": "2019-11-07T09:25:44.0680996", + "folders": [{ + "id": "958001d8-2228-4373-b966-5262b5b96f71", + "name": "Top level folder", + "external_id": "top-folder", + "folders": [{ + "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0", + "name": "Second level folder", + "external_id": "second-folder", + "folders": [] + }] + }] + } + } + } + }, + "400": { + "description": "The specified request body is invalid or the project already has folders.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|550362d54e086e4a873c8b98bfcfa857.8c40c1ec_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Provide nonempty name which fits within 250 characters." + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/folders \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"folders\": [\n {\n \"name\": \"Top level folder\",\n \"external_id\": \"top-folder\",\n \"folders\": [\n {\n \"name\": \"Second level folder\",\n \"external_id\": \"second-folder\",\n \"folders\": []\n }\n ]\n }\n ]\n}'" + }] + }, + "patch": { + "description": "Modify the folders in your project using the `addInto`, `remove`, and `rename` operations.\n", + "operationId": "modify-asset-folders", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Modify asset folders", + "tags": ["Assets"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "Specifies the operation to perform.\n* `addInto` to add new folders\n* `remove` to delete folders\n* `rename` to rename folders\n", + "items": { + "discriminator": { + "mapping": { + "addInto": "#/components/schemas/AddInto", + "remove": "#/components/schemas/Remove", + "rename": "#/components/schemas/Rename" + }, + "propertyName": "op" + }, + "oneOf": [{ + "$ref": "#/components/schemas/AddInto" + }, { + "$ref": "#/components/schemas/Remove" + }, { + "$ref": "#/components/schemas/Rename" + }] + }, + "uniqueItems": true, + "type": "array" + }, + "example": [{ + "op": "addinto", + "value": { + "external_id": "another-folder", + "name": "Another second level folder", + "folders": [] + }, + "reference": { + "external_id": "top-folder" + }, + "after": { + "external_id": "second-folder" + } + }, { + "op": "remove", + "reference": { + "external_id": "extra-folder" + } + }, { + "op": "rename", + "value": "A new name", + "reference": { + "external_id": "second-folder" + } + }] + } + }, + "description": "The operation to perform on the folders.\n", + "required": true + }, + "responses": { + "200": { + "description": "The modified folders in the project.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AssetFolders" + }, + "example": { + "last_modified": "2019-11-07T09:46:52.7735578Z", + "folders": [{ + "id": "82fdeb78-e60a-5236-878f-f3673508b513", + "external_id": "top-folder", + "name": "Top level folder", + "folders": [{ + "id": "3db723f5-2197-5df5-8da3-943c46956616", + "external_id": "second-folder", + "name": "A new name", + "folders": [] + }, { + "id": "6b7a4d43-56a3-5617-bb5e-4236e8ba2b27", + "external_id": "another-folder", + "name": "Another second level folder", + "folders": [] + }] + }] + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|610c79fba4c2a84191ffd1fe4677921f.8c41fe23_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Invalid operation with index '1': The referenced object was not found." + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request PATCH \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/folders \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'\n --data '\n[\n {\n \"op\": \"addinto\",\n \"value\": {\n \"external_id\": \"another-folder\",\n \"name\": \"Another second level folder\",\n \"folders\": []\n },\n \"reference\" : {\n \t\"external_id\": \"top-folder\"\n },\n \"after\": {\n \"external_id\": \"second-folder\"\n }\n },\n {\n \"op\": \"remove\",\n \"reference\" : {\n \"external_id\": \"extra-folder\"\n }\n },\n {\n \"op\": \"rename\",\n \"value\":\"A new name\",\n \"reference\" : {\n \"external_id\": \"second-folder\"\n }\n }\n]'" + }] + } + }, + "/{project_id}": { + "get": { + "description": "Retrieve the ID and display name of your project.\n", + "operationId": "retrieve-project-information", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Retrieve project information", + "tags": ["Project information"], + "responses": { + "200": { + "description": "The project ID and display name.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + }, + "example": { + "id": "975bf280-fd91-488c-994c-2f04416e5ee3", + "name": "Sample Project" + } + } + } + }, + "404": { + "description": "The requested project is archived.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|297f7b9e2c9113438004b21063787915.c46264bc_", + "error_code": 0, + "message": "The requested Project '975bf280-fd91-488c-994c-2f04416e5ee3' was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3 \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + } + }, + "/{project_id}/validate": { + "post": { + "description": "Checks your project's content items for issues, such as:\n* Content elements [referencing](https://docs.kontent.ai/link-to/references) non-existing objects.\n* Values of content elements not meeting the limitations configured in content types.\n* Content types referencing non-existing taxonomy groups.\n\nWe recommend that you use this endpoint after successfully importing content into your project.\n", + "operationId": "validate-project-content", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Validate project content", + "tags": ["Project validation"], + "responses": { + "200": { + "description": "A project report summarizing the issues found in the specified project.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectReport" + }, + "example": { + "project": { + "id": "975bf280-fd91-488c-994c-2f04416e5ee3", + "name": "Sample Project" + }, + "variant_issues": [{ + "item": { + "id": "b2fea94c-73fd-42ec-a22f-f409878de187", + "name": "Origins of Arabica Bourbon", + "codename": "origins_of_arabica_bourbon" + }, + "language": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "English (United States)", + "codename": "en-US" + }, + "issues": [{ + "element": { + "id": "ee7c3687-b469-6c56-3ac6-c8dfdc8b58b5", + "name": "Related articles", + "codename": "related_articles" + }, + "messages": ["Element 'Related articles' contains a content module Colombia Carlos Imbachi of type Coffee that is not allowed in this context."] + }] + }, { + "item": { + "id": "cf106f4e-30a4-42ef-b313-b8ea3fd3e5c5", + "name": "Coffee Beverages Explained", + "codename": "coffee_beverages_explained" + }, + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8", + "name": "Spanish (Spain)", + "codename": "es-ES" + }, + "issues": [{ + "element": { + "id": "ee7c3687-b469-6c56-3ac6-c8dfdc8b58b5", + "name": "Related articles", + "codename": "related_articles" + }, + "messages": ["Element 'Related articles' is required but has no value", "Element 'Related articles' should have at least 1 content module(s) but has 0 content module(s)."] + }, { + "element": { + "id": "b9dc537c-2518-e4f5-8325-ce4fce26171e", + "name": "Meta description", + "codename": "meta_description" + }, + "messages": ["Element 'Meta description' should have at most 160 characters(s) but has 174 character(s)."] + }] + }], + "type_issues": [{ + "type": { + "id": "929985ac-4aa5-436b-85a2-94c2d4fbbebd", + "name": "Coffee", + "codename": "coffee" + }, + "issues": [{ + "element": { + "id": "1ee64175-fde7-fc1e-5259-511a31c326c3", + "name": "Product status", + "codename": "product_status" + }, + "messages": ["Element 'Product status' contains references to non-existing taxonomy group with ID 79b1c5b6-30bc-d076-a236-d9ec9f1ff01b."] + }] + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/validate \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }, { + "lang": "JavaScript", + "source": "// Tip: Find more about JS/TS SDKs at https://docs.kontent.ai/javascript\n// Using ES6 syntax\nimport { ManagementClient } from '@kentico/kontent-management';\n\nconst client = new ManagementClient({\n projectId: '',\n apiKey: ''\n});\n\nclient.validateProjectContent()\n .forProjectId('')\n .toObservable()\n .subscribe((response) => {\n console.log(response);\n },\n (error) => {\n console.log(error);\n });" + }, { + "lang": ".NET", + "source": "// Tip: Find more about .NET SDKs at https://docs.kontent.ai/net\nusing Kentico.Kontent.Management;\nusing Kentico.Kontent.Management.Models.ProjectReport;\n\nManagementOptions options = new ManagementOptions\n{\n ApiKey = \"\",\n ProjectId = \"\"\n};\n\nManagementClient client = new ManagementClient(options);\n\n// Checks your project and stores the validation report in the response\nProjectReportModel response = await client.ValidateProjectAsync();" + }] + } + }, + "/{project_id}/webhooks": { + "post": { + "description": "Add new webhooks to a given project.\n", + "operationId": "add-a-webhook", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Add a webhook", + "tags": ["Webhooks"], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + }, + "example": { + "name": "Example", + "url": "https://example.com", + "secret": "secret", + "triggers": { + "delivery_api_content_changes": [{ + "type": "content_item_variant", + "operations": ["publish", "unpublish"] + }, { + "type": "taxonomy", + "operations": ["archive", "restore", "upsert"] + }], + "workflow_step_changes": [{ + "type": "content_item_variant", + "transitions_to": [{ + "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008" + }, { + "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf" + }] + }] + } + } + } + }, + "description": "The webhook to be added.\n" + }, + "responses": { + "201": { + "description": "The added webhook object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + }, + "example": { + "name": "Example", + "url": "https://example.com", + "secret": "secret", + "triggers": { + "delivery_api_content_changes": [{ + "type": "content_item_variant", + "operations": ["publish", "unpublish"] + }, { + "type": "taxonomy", + "operations": ["archive", "restore", "upsert"] + }], + "workflow_step_changes": [{ + "type": "content_item_variant", + "transitions_to": [{ + "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008" + }, { + "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf" + }] + }] + } + } + } + } + }, + "400": { + "description": "The specified request body is invalid.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|99d4a0bf4b2aff4eabbc160d79690402.9fa0eaf1_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "Provide nonempty name which fits within 200 characters." + }] + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request POST \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/webhooks \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json' \\\n --data '\n{\n \"name\": \"Example\",\n \"url\": \"https://example.com\",\n \"secret\": \"secret\",\n \"triggers\": {\n \"delivery_api_content_changes\": [\n {\n \"type\": \"content_item_variant\",\n \"operations\": [\n \"publish\", \n \"unpublish\" \n ]\n },\n {\n \"type\": \"taxonomy\",\n \"operations\": [\n \"archive\",\n \"restore\",\n \"upsert\" \n ]\n }\n ],\n \"workflow_step_changes\": [\n {\n \"type\": \"content_item_variant\",\n \"transitions_to\": [ \n { \"id\": \"b4363ccd-8f21-45fd-a840-5843d7b7f008\" },\n { \"id\": \"88ac5e6e-1c5c-4638-96e1-0d61221ad5bf\" }\n ]\n }\n ]\n }\n}'" + }] + }, + "get": { + "description": "Retrieves webhooks within a given project.\n", + "operationId": "retrieve-webhooks", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }], + "summary": "Retrieve webhooks", + "tags": ["Webhooks"], + "responses": { + "200": { + "description": "A list of webhooks in the project.\n", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Webhook" + }, + "type": "array" + }, + "example": [{ + "last_modified": "2019-09-18T12:13:19.0256989Z", + "id": "d53360f7-79e1-42f4-a524-1b53a417d03e", + "name": "Example", + "url": "https://example.com", + "secret": "secret", + "triggers": { + "delivery_api_content_changes": [{ + "type": "content_item_variant", + "operations": ["publish", "unpublish"] + }, { + "type": "taxonomy", + "operations": ["archive", "restore", "upsert"] + }], + "workflow_step_changes": [{ + "type": "content_item_variant", + "transitions_to": [{ + "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008" + }, { + "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf" + }] + }] + } + }] + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/webhooks \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + } + }, + "/{project_id}/webhooks/{webhook_identifier}": { + "get": { + "description": "Retrieves a webhook specified by its internal ID.\n", + "operationId": "retrieve-a-webhook", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/webhook_identifier" + }], + "summary": "Retrieve a webhook", + "tags": ["Webhooks"], + "responses": { + "200": { + "description": "A single webhook object.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Webhook" + } + } + } + }, + "404": { + "description": "The specified webhook was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|f5e9980562323e4b9b23588a141d323a.2774b2ca_", + "error_code": 111, + "message": "The requested webhook was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request GET \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/webhooks/d53360f7-79e1-42f4-a524-1b53a417d03e \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + }, + "delete": { + "description": "Delete a webhook specified by its internal ID.\n", + "operationId": "delete-a-webhook", + "parameters": [{ + "$ref": "#/components/parameters/project_id" + }, { + "$ref": "#/components/parameters/webhook_identifier" + }], + "summary": "Delete a webhook", + "tags": ["Webhooks"], + "responses": { + "204": { + "description": "The specified webhook was deleted from the project.\n", + "content": { + "application/json": {} + } + }, + "404": { + "description": "The specified webhook was not found.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|4917a91f0f3c1640a41e5afda87f57b5.9fa110d9_", + "error_code": 111, + "message": "The requested webhook was not found." + } + } + } + } + }, + "x-code-samples": [{ + "lang": "REST", + "source": "curl --request DELETE \\\n --url https://manage.kontent.ai/v2/projects/975bf280-fd91-488c-994c-2f04416e5ee3/webhooks/d53360f7-79e1-42f4-a524-1b53a417d03e \\\n --header 'Authorization: Bearer ' \\\n --header 'Content-type: application/json'" + }] + } + } + }, + "servers": [{ + "description": "Management API v2 (BETA)", + "url": "https://manage.kontent.ai/v2/projects" + }], + "tags": [{ + "description": "By default, the API keys for the Management API are **valid for 4,000 days**. The scope of the API keys is **per project per user**. This means you need a separate API key for each of your projects.\n\nThe API key inherits the identity of the user who generated it. Operations performed with the key will show in [your version history](https://docs.kontent.ai/link-to/comparing_and_restoring_versions) as changes made by the specific user.\n\nIf you regenerate the API key before its expiration date, the system will revoke the previous API key. For requests made with a revoked API key, you'll receive the `403 Unauthorized` error response.\n\n\n\n\n```json\n{\n \"request_id\": \"800000c0-0001-fc00-b63f-84710c7967bb\",\n \"error_code\": 7,\n \"message\": \"The provided API key was revoked. You can find a valid API key for this project in the Kentico Kontent app.\"\n}\n```\n\n\n\n**Note**: 5 days before the API key expires, we will send a notification email to users with the *Manage APIs* [capability](https://docs.kontent.ai/link-to/role_capabilities).\n", + "name": "API key scope and validity" + }, { + "description": "Rate limits specify the number of requests you or your application can make to the Management API within a specific time window. There are three separate time windows (second, minute, hour) allowing a different number of requests each.\n\nBy default, the Management API enforces the following rate limits\n* **10** requests per second\n* **400** requests per minute\n* **15000** requests per hour\n\nThese [limits apply to each API key](https://docs.kontent.ai/link-to/api_key_scope_and_validity) for the Management API.\n\n**Note**: We strongly advise against making multiple requests to the API in parallel. Doing so may cause unpredictable behavior and lead to inconsistencies in your content. We recommend that you wait for each request to finish before sending another one.\n\nWhen you reach the limit of a specific time window, the API will reject the request and respond with the [429 HTTP error](https://httpstatuses.com/429 \"Too Many Requests\").\n\n\n\n\n```json\n{\n \"request_id\": \"80000004-0002-fd00-b63f-84710c7967bb\",\n \"error_code\": 10000,\n \"message\": \"API rate limit exceeded. Please retry your request later.\"\n}\n```\n\n\n\nThe error response will include the [`Retry-After` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) that tells you how many *seconds* you need to wait before attempting further requests. Each failed request is perfectly safe to retry.\n\nIf you begin to receive [429 HTTP errors](https://httpstatuses.com/429 \"Too Many Requests\"), reduce the frequency of your requests.\n", + "name": "Rate limiting" + }, { + "description": "References identify objects within your project. For example, you can use references to specify content types, content items, languages, and more.\n\nWhen specifying references to objects, the object can be identified by **one** of three properties:\n1. Its internal ID, such as `18b43cc5-f4fd-0172-842b-3ae2c878cf6f`\n * Generated by the system automatically.\n * Can be used to specify any object.\n2. Its codename, such as `item_codename`\n * Initially generated from the object's display name (see below for how).\n * Can be used to specify most objects.\n3. Its external ID, such as `object-id-from-another-system`\n * Specified when creating the object through the Management API. The external ID cannot be changed.\n * Can be used to specify user-created assets, content items, content types, content groups, elements, languages, taxonomy groups, and taxonomy terms.\n\n### Rules for codenames\n\nWhen editing codenames, the new codenames must meet the following conditions:\n* Only lowercase letters, numbers, and underscores are permitted.\n* Codenames must start with a letter or an underscore and have at least one character.\n* Codenames are usually limited to 60 characters, but longer codenames are allowed for multiple choice options and taxonomy terms.\n* Codenames of elements within a snippet must be prefixed with the snippet's codename.\n* Codenames must be unique.\n\nThis means the following applies when codenames are generated automatically:\n* All letters are made lowercase.\n* All forbidden characters are replaced by `_`.\n* For any names that start with a number, the codename will start with `n`.\n* Codenames that duplicate another codename will have a random string attached to the end.\n* Codenames of elements within a snippet will be prefixed with the snippet's codename.\n* Codenames will be cut off at the character limit.\n\n## Reference object\n\n\nThe API uses internal IDs for referencing objects. This means that the reference objects in the API responses will always use internal IDs.\n\n \n\n## External IDs for imported content\n\n\nWhen [adding new content types](https://docs.kontent.ai/link-to/add_a_content_type) to your project, content groups must be referenced by their external IDs. By using external IDs to reference other objects in your project, you can import your content in the order you prefer. For example, when importing multiple articles that contain images, you can reference these images with external IDs, such as `roaster` or `coffee-cup`, before uploading them.\n\nThe referenced images will be visible in the UI only after you [add them as assets](https://docs.kontent.ai/link-to/upsert_an_asset) via the Management API. With this approach, you can choose whether you want to create content items first and then upload binary files for assets, or vice versa.\n\nThis means you can use external IDs to reference objects that don't yet exist in the project and add the objects via the API later.\n\nTo check whether your project contains any references to not-yet-created objects, see how to [validate project content](https://docs.kontent.ai/link-to/validate_project_content).\n\n**Note**: References to non-existent objects will be stored and retrieved via the Management API as internal IDs.\n\n\n\n

Referencing objects that are not in your project yet

\n

The Management API supports referencing of non-existent objects in the following elements:

\n\n

See how to import linked content to learn more.

\n\n\n\n### Missing objects in the UI\n\nIf you reference non-existent objects by external IDs in your elements, the referenced objects won't be shown in the user interface because the system cannot find those objects. The referenced assets, content items, and taxonomy terms will be displayed after you create them with their specific external IDs via the Management API.\n\nTo add the missing objects, see:\n* [Upsert a content item](https://docs.kontent.ai/link-to/upsert_a_content_item) to create content items specified by external IDs.\n* [Upsert an asset](https://docs.kontent.ai/link-to/upsert_an_asset) to create assets specified by external IDs.\n* [Add a taxonomy group](https://docs.kontent.ai/link-to/add_a_taxonomy_group) to create taxonomy groups with external IDs.\n", + "name": "References" + }, { + "description": "To manage content items via the Management API, you need to send requests to URIs based on the following patterns:\n* Using internal IDs: `/items/`\n* Using codenames: `/items/codename/`\n* Using external IDs: `/items/external-id/`\n\nTo [retrieve language variants](https://docs.kontent.ai/link-to/retrieve_variants_of_an_item) of a specific content item, you can list the variants by specifying the internal ID, codename, or external ID of the content item.\n\n## Content item object\n\n\nThe content item object contains metadata about your content, such as the name of the content item and when the item was last modified. The content item object does not store the content itself. The content for each language variant of a content item is saved in [language variants](https://docs.kontent.ai/link-to/language_variants), with each content item having as many variants as there are active languages in your project.\n\n \n", + "name": "Content items" + }, { + "description": "When you retrieve or update [language variants](https://docs.kontent.ai/link-to/language_variants), you will work with a collection of elements. The elements collection contains the elements as defined in the content type.\n\n**Note**: When retrieving language variants, the Management API will always reference content elements with their internal IDs. When creating or updating language variants via the API, you can reference content elements by their internal IDs or codenames.\n\n## Asset element\n\n\n \n\n## Custom element\n\n\n \n\n## Date and time element\n\n\n \n\n## Linked items element\n\n\n \n\n## Multiple choice element\n\n\n \n\n## Number element\n\n\n \n\n## Rich text element\n\n\n \n\n### HTML5 elements allowed in rich text\n\nThe rich text value can contain specific HTML elements and must form a valid HTML5 fragment. When transforming HTML to JSON, make sure to escape all double quotes.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n` and `` tags are not supported.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n**Types**\n\n\n\n**HTML elements**\n\n\n\n**Notes**\n\n
Paragraphs\n\n`

...

`\n\n
Must be used at the top level.
Headings\n\n`

...

`, `

...

`, ` 

...

`, `

...

`\n\n
Must be used at the top level.
Bold text\n\n`...`\n\n\n\nMust be nested. The `` tag is not supported.\n\n
Italic text\n\n`...`\n\n\n\nMust be nested. The `` tag is not supported.\n\n
Superscript\n\n`...`\n\nSuperscript and subscript are mutually exclusive.
Subscript\n\n`...`\n\nSuperscript and subscript are mutually exclusive.
Code\n\n`...`\n\nMust be nested.
\n\n[Lists](#section/Rich-text-element/lists-in-rich-text)\n\n\n\n`
  1. ...
`, `
  • ...
`\n\n
Must be nested.
\n\n[Tables](#section/Rich-text-element/tables-in-rich-text)\n\n\n\n`
...
`\n\n
\n\nMust be used at the top level. The `
\n\n[Links](#section/Rich-text-element/links-in-rich-text)\n\n\n\n`...`\n\n\n\nCan be used at the top level and nested. For the list of supported `` attributes, see [Links in rich text](#section/Rich-text-element/links-in-rich-text).\n\n
\n\n[Assets](#section/Rich-text-element/assets-in-rich-text)\n\n\n\n`
`\n\n
Must be used at the top level.
\n\n[Content items](#section/Rich-text-element/content-items-in-rich-text) and [components](#section/Rich-text-element/components-in-rich-text)\n\n\n\n``\n\nMust be used at the top level.
Line breaks\n\n`
`\n\n
\n\n
\n\n### Assets in rich text\n\nAssets in rich text are defined by the block element `
` which requires one of the following attributes: `data-asset-id` or `data-asset-external-id`. The `data-asset-external-id` attribute can also reference an object that was not yet imported to Kentico Kontent. See more details about [external IDs for imported content](#section/External-IDs-for-imported-content).\n\nWhen inserting values in rich text, the `` element is optional. Otherwise, the `` element requires the attributes `src` and `data-asset-id`.\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"asset_referenced_by_internal_id\"\n },\n \"value\": \"
\"\n...\n \"element\": {\n \"codename\": \"asset_referenced_by_internal_id\"\n },\n \"value\": \"
\"\n...\n}\n```\n\n\n\n### Components in rich text\n\nComponents in rich text are defined by the `` block element. The `` element requires the `type`, `data-type`, and `data-id` attributes.\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"component_referenced_by_internal_id\"\n },\n \"value\": \"\"\n...\n}\n```\n\n\n\nFor each component in the text, the rich text object's `components` property must hold a matching component object. When specifying components in the rich text's `value` property, you need to provide a unique ID (GUID) for the `data-id` attribute of each component.\n\n#### Component object\n\n \n\n#### Nesting of components\n\nIf the inserted component contains a rich text element, the rich text element may contain more components. These nested components may contain another rich text element with more components, and so on. The components can be nested up to 6 levels deep.\n\n\n\n\n```json\n{\n \"element\": {\n \"id\": \"49150275-064b-5314-be6e-b93e1d7661e1\"\n },\n \"value\": \"

Content in rich text on level 1

\\n\",\n \"components\": [\n {\n \"id\": \"382abced-bfb6-4ee9-a2d4-2c3b8cd8ba5d\",\n \"type\": {\n \"id\": \"f4cb13df-d61d-572e-8f3b-3afe7e3a7ea1\"\n },\n \"elements\": [\n {\n \"element\": {\n \"id\": \"0b9173d6-1c94-5fb0-a010-86eef9013fd4\"\n },\n \"value\": \"

Component on level 2

\\n\",\n \"components\": [\n {\n \"id\": \"7c1ca8b2-2fa8-41d8-be02-bf157d3fa225\",\n \"type\": {\n \"id\": \"37684e4c-9303-589b-a937-c7c165171b38\"\n },\n \"elements\": [\n {\n \"element\": {\n \"id\": \"ff50c0e0-226e-5474-b71b-2af194edd7c4\"\n },\n \"value\": \"

Nested component on level 3

\",\n \"components\": []\n }\n ]\n }\n ]\n },\n {\n \"element\": {\n \"id\": \"edd22f22-ccd6-56e6-9fe2-676a7e250d8c\"\n },\n \"value\": [\n {\n \"id\": \"f206b928-7609-5192-bd31-6eb6aae48096\"\n }\n ]\n }\n ]\n }\n ]\n}\n```\n\n\n\n### Content items in rich text\n\nContent items in rich text are defined by the `` block element. The `` element requires the attributes `type`, `data-type`, and either `data-id` or `data-external-id`. The `data-external-id` attribute can also reference an object that has not yet been imported to Kentico Kontent. See more details about [external IDs for imported content](#section/External-IDs-for-imported-content).\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"item_referenced_by_internal_id\"\n },\n \"value\": \"\"\n...\n \"element\": {\n \"codename\": \"item_referenced_by_external_id\"\n },\n \"value\": \"\"\n...\n}\n```\n\n\n\n### Links in rich text\n\nLinks in rich text are defined as the `` element, for example, `Link`. These links can be used for web URLs, email addresses, assets, and content items. For each of the link types, the `` element supports a different set of required and optional attributes.\n\n#### Links to URLs\n\nLinks to URLs require the `href` attribute.\n\n\n\n

Inserting URL values

\n

When inserting URL values, the system might add the http:// prefix in case the provided URL is invalid or not safe. For example, URLs using the javascript protocol will be prefixed. URL values starting with /, ?, or # are allowed.

\n

Examples of how inserted URLs are stored:

\n
    \n
  • http://example.comhttp://example.com
  • \n
  • https://example.comhttps://example.com
  • \n
  • ftp://example.comftp://example.com
  • \n
  • example.comhttp://example.com
  • \n
  • about-us.htmlhttp://about-us.html
  • \n
  • /about-us.html/about-us.html
  • \n
  • ?query?query
  • \n
  • #anchor#anchor
  • \n
  • javascript:alert()http://javascript:alert()
  • \n
  • javascript://%0aalert()http://javascript://%0aalert()
  • \n
  • data:text/html,<script>alert()</script>http://data:text/html,<script>alert()</script>
  • \n
\n\n\n\nOptionally, the link can specify a title and whether the link should be opened in a new browser window.\n* If the link should provide a title, the `
` element must specify the title attribute with a value.\n* If the link should open in a new window, the `` element must specify the data-new-window attribute set to true.\n\n**Note**: Other `` attributes, such as `target` and `rel`, are not supported for URL links.\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"link_to_url\"\n },\n \"value\": \"example link\"\n...\n \"element\": {\n \"codename\": \"link_to_url_new_window\"\n },\n \"value\": \"example link\"\n...\n \"element\": {\n \"codename\": \"link_to_url_with_title\"\n },\n \"value\": \"example link\"\n...\n}\n```\n\n\n\n#### Links to email addresses\n\nEmail links require the `data-email-address` attribute . Optionally, the link can contain the `data-email-subject` attribute.\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"link_to_email_address\"\n },\n \"value\": \"reach out\"\n...\n}\n```\n\n\n\n#### Links to assets\n\nLinks to assets require one of the following attributes: `data-asset-id` or `data-asset-external-id`. The `data-asset-external-id` attribute can also reference an object that has not yet been imported to Kentico Kontent. See more details about [external IDs for imported content](#section/External-IDs-for-imported-content).\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"asset_linked_by_internal_id\"\n },\n \"value\": \"Hario Mini Mill\"\n...\n \"element\": {\n \"codename\": \"asset_linked_by_external_id\"\n },\n \"value\": \"Hario Mini Mill\"\n...\n}\n```\n\n\n\n#### Links to content items\n\nLinks to content items within a single Kentico Kontent project require one of the following attributes: `data-item-id` or `data-item-external-id`. The `data-item-external-id` attribute can also reference an object that has not yet been imported to Kentico Kontent. See more details about [external IDs for imported content](#section/External-IDs-for-imported-content).\n\n\n\n\n```json\n{\n...\n \"element\": {\n \"codename\": \"item_linked_by_internal_id\"\n },\n \"value\": \"On Roasts\"\n...\n \"element\": {\n \"codename\": \"item_linked_by_external_id\"\n },\n \"value\": \"On Roasts\"\n...\n}\n```\n\n\n\n### Lists in rich text\n\nLists in rich text are defined as standard HTML lists, either ordered (`
    `) or unordered (`
      `). Each list item can contain another nested list, a piece of HTML formatted text, or be empty.\n\n\n\n\n```json\n{\n...\n \"value\": \"
      1. A list item
      2. Another list item
        • Nested list item
      \"\n...\n}\n```\n\n\n\n### Tables in rich text\n\nTables in rich text elements are defined as standard HTML tables with the table cells and rows contained within the `` element. Note that the tables cells and rows cannot be merged.\n\n\n\n\n```json\n{\n...\n \"value\": \"
      Type AType BType C
      12.43.1434.1
      \"\n...\n}\n```\n\n\n\n## Taxonomy element\n\n\n \n\n## Text element\n\n\n \n\n## URL slug element\n\n\n \n", + "name": "Elements in language variants" + }, { + "description": "Language variants represent a localized variant of a content item. For example, when your project contains 2 active languages, each content item in that project can have 2 language variants.\n\n\n\n

      Deactivated languages

      \n

      If a language is deactivated in the project settings, the respective language variants cannot be retrieved via the Management API. In such cases, the API will return a 404 not found error.

      \n\n\n\nEvery language variant is generally tied to a specific [content item](https://docs.kontent.ai/link-to/content_items_087d28e) and project [language](https://docs.kontent.ai/link-to/languages). This means you need to specify a language identifier when you request the variant, even if your project contains only one language.\n\nTo manage language variants via the Management API, send requests to URLs based on the following patterns:\n* Item ID + Language ID: `/items//variants/`\n* Item ID + Language codename: `/items//variants/codename/`\n* Item codename + Language ID: `/items/codename//variants/`\n* Item codename + Language codename: `/items/codename//variants/codename/`\n* Item external ID + Language ID: `/items/external-id//variants/`\n* Item external ID + Language codename: `/items/external-id//variants/codename/`\n\nThese endpoints accept GET, PUT, and DELETE requests, allowing you to retrieve, upsert, and delete language variants. You can mix and match the identifiers of content items and languages when requesting language variants.\n\n**Tip**: If you need to [return all the language variants for a specific content type](https://docs.kontent.ai/link-to/list_language_variants_for_a_specific_content_type), you can use a single GET request. The API returns a paginated response limited to up to 50 language variant objects per page.\n\n## Language variant object\n\n\n \n\n**Note**: When copying or migrating language variants, you can take the language variant object returned when [retrieving a language variant](https://docs.kontent.ai/link-to/retrieve_a_language_variant) and use it without modification in the body of a [request to upsert a language variant](https://docs.kontent.ai/link-to/upsert_a_language_variant).\n", + "name": "Language variants" + }, { + "description": "Languages let you create localized content. Your content items can contain as many [language variants](https://docs.kontent.ai/link-to/language_variants) as there are active languages in your project.\n\n## Language object\n\n\n \n", + "name": "Languages" + }, { + "description": "Each language variant of a content item has a workflow step. A workflow step indicates a specific stage in the content production process, for example, Draft -> Review -> Legal approval -> Published.\n\nThe workflow step can affect who can edit the language variant, and who can move it further along the workflow. Learn more about [setting up a workflow](https://docs.kontent.ai/link-to/setting_up_a_workflow_for_your_content) for your content.\n\nThe Management API allows you to programmatically:\n* [List all workflow steps in the project](https://docs.kontent.ai/link-to/retrieve_workflow_steps)\n* [Change the workflow step of a language variant](https://docs.kontent.ai/link-to/change_the_workflow_step_of_a_language_variant)\n* [Publish a language variant](https://docs.kontent.ai/link-to/publish_or_schedule_a_language_variant)\n* [Create a new version of a language variant](https://docs.kontent.ai/link-to/create_a_new_version_of_a_language_variant)\n* [Unpublish a language variant](https://docs.kontent.ai/link-to/unpublish_a_language_variant)\n* [Cancel scheduled publishing of a language variant](https://docs.kontent.ai/link-to/cancel_scheduled_publishing_of_a_language_variant)\n\n## Workflow step object\n\n\n \n", + "name": "Workflow and publishing" + }, { + "description": "When you retrieve or update [content types](https://docs.kontent.ai/link-to/content_types_09b103e), you will work with a collection of elements.\n\n## Asset element in type\n\n\n \n\n## Content type snippet element in type\n\n\nThe content type snippet elements contain the `snippet` property with a [reference](https://docs.kontent.ai/link-to/references) to a specific content type snippet.\n\nLearn more about [reusing collections of elements](https://docs.kontent.ai/link-to/reusing_collections_of_elements_with_snippets) with snippets.\n\n \n\n## Custom element in type\n\n\nFind more about about custom elements in [Integrating your own content editing features](https://docs.kontent.ai/link-to/integrating_your_own_content_editing_features).\n\n \n\n## Date and time element in type\n\n\n \n\n## Guidelines element in type\n\n\nGuidelines elements do not contain the `name` property.\n\n \n\n## Linked items element in type\n\n\n \n\n## Number element in type\n\n\n \n\n## Multiple choice element in type\n\n\n \n\n## Rich text element in type\n\n\n \n\n## Taxonomy element in type\n\n\n \n\n## Text element in type\n\n\n \n\n## URL slug element in type\n\n\nLearn more about the usages of [URL slugs](https://docs.kontent.ai/link-to/creating_seo_friendly_urls) and [content type snippets](https://docs.kontent.ai/link-to/reusing_collections_of_elements_with_snippets) within Kentico Kontent.\n\n \n", + "name": "Elements in content types" + }, { + "description": "## Content type object\n\n\nThe content type object contains information about the structure of your content.\n\n \n\n## Content group object\n\n\nContent group objects are present in content type objects and element objects with more than one content group. Content group objects are not present in the content type snippet `snippet` element.\n\n \n", + "name": "Content types" + }, { + "description": "The Content type snippet model is structurally identical to the [Content type model](https://docs.kontent.ai/link-to/content_types_09b103e), except it can NOT contain the following elements:\n* URL slug element\n* Snippet element\n", + "name": "Content type snippets" + }, { + "description": "Taxonomies are a versatile tool for categorizing and organizing your content. Learn more about the [use cases for taxonomies](https://docs.kontent.ai/link-to/organizing_your_content_with_taxonomies) and see how to [retrieve content tagged with a specific taxonomy term](https://docs.kontent.ai/link-to/getting_articles_tagged_with_a_taxonomy_term).\n\n## Taxonomy group object\n\n\n \n", + "name": "Taxonomy groups" + }, { + "description": "Assets in Kentico Kontent consist of a reference to a binary file and metadata describing the file. Each binary file can be referenced only by a single asset. Once an asset is created, the file it references cannot be changed, you can only modify the asset's descriptions and title. Note that binary files that are not used by any assets will not be visible in the Kentico Kontent UI.\n\n\n\n

      Adding assets is a 2-step process

      \n
        \n
      1. Upload a binary file – after uploading, you get a file reference to uploaded file.
      2. \n
      3. Create a new asset – use the file reference to link the new asset with the file.
      4. \n
      \n\n\n\n## Asset object\n\n\n \n\n## Asset folders object\n\n\nAsset folders are ways for you to organize the assets in your projects. The asset folders object contains all folders within a given project.\n\n \n", + "name": "Assets" + }, { + "description": "The project information object contains basic information about your project, i.e., the project ID and display name. By calling the [Retrieve project information](https://docs.kontent.ai/link-to/retrieve_project_information) endpoint, you can also validate your [Management API key](https://docs.kontent.ai/link-to/api_key_scope_and_validity).\n\n## Project information object\n\n\n \n", + "name": "Project information" + }, { + "description": "After [importing your content](https://docs.kontent.ai/link-to/importing_to_kentico_kontent) in Kentico Kontent, you can [validate the whole project](https://docs.kontent.ai/link-to/validate_project_content) to find out whether there are any issues within the imported content.\n\n## Project report object\n\n\nA project validity report contains a list of issues found in language variants and content types. The issues can indicate that either certain elements reference non-existing objects or contain values that do not meet the limitations set by a content type.\n\n \n\n## Element issue object\n\n\nFor each issue found in a specific language variant or content type, the `issues` array will contain an element issue with metadata about the element and a list of validation messages describing the problem.\n\nA note on terminology in messages: A \"content module\" is a content item referenced in *Linked items* or *Rich text* elements. See [Linked content and components](https://docs.kontent.ai/link-to/linked_content_and_components) for more details.\n\n \n", + "name": "Project validation" + }, { + "description": "Webhooks are useful for receiving notifications when something in your project changes, such as newly published content. Learn more about [webhook types](https://docs.kontent.ai/link-to/webhooks_reference) and [how they are put into practice](https://docs.kontent.ai/link-to/using_webhooks_for_automatic_updates).\n\n## Webhook object\n\n\n \n", + "name": "Webhooks" + }], + "x-api-status": "Beta", + "components": { + "parameters": { + "project_id": { + "description": "Identifies your project.\n", + "in": "path", + "name": "project_id", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "item_identifier_dc3e32b": { + "description": "Identifies the content item by internal ID (e.g., `f4b3fc05-e988-4dae-9ac1-a94aba566474`), external ID (e.g., `external-id/59713`), or codename (e.g., `codename/on_roasts`).\n", + "in": "path", + "name": "item_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "continuationtoken_1b2d9a9": { + "description": "Determines the page of results to retrieve.\n\nTo get the next page, see the pagination object in the response and set the `continuationToken` parameter to the value of the `continuation_token` property.\n", + "in": "query", + "name": "continuationToken", + "deprecated": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "x_continuation_4a04ea9": { + "description": "Determines the page of results to retrieve.\n\nTo get the next page, see the pagination object in the response and set the `x-continuation` parameter to the value of the `continuation_token` property.\n", + "in": "header", + "name": "x-continuation", + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "item_identifier_for_upsert": { + "description": "Identifies a content item by its internal ID (e.g., `f4b3fc05-e988-4dae-9ac1-a94aba566474`), external ID (e.g., `external-id/59713`), or codename (e.g., `codename/on_roasts `).\n* When creating a new content item, use an external ID as the item's identifier.\n* When updating an existing content item, identify the item by its internal ID, external ID, or codename.\n\n\n\n

      External IDs

      \n

      If the specified external ID is not used by an existing content item, the API will create a new item. If the content item specified by the external ID already exists, the properties specified in the request body will be updated.

      \n\n\n", + "in": "path", + "name": "item_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "type_identifier_for_variants": { + "description": "Identifies the language variant's content type by internal ID (e.g., `b7aa4a53-d9b1-48cf-b7a6-ed0b182c4b89`) or codename (e.g., `codename/article`).\n", + "in": "path", + "name": "type_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "type_identifier_for_components": { + "description": "Identifies the component's content type by internal ID (e.g., `269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0`) or codename (e.g., `codename/hosted_video`).\n", + "in": "path", + "name": "type_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "language_identifier_for_variants": { + "description": "Identifies the language by its internal ID (e.g., `d1f95fde-af02-b3b5-bd9e-f232311ccab8`) or codename (e.g., `codename/es-ES`).\n", + "in": "path", + "name": "language_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "language_identifier_for_languages": { + "description": "Identifies the language by its internal ID (e.g., `2ea66788-d3b8-5ff5-b37e-258502e4fd5d`), external ID (e.g., `external-id/standard-german`), or codename (e.g., `codename/de-DE`).\n", + "in": "path", + "name": "language_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "workflow_step_identifier": { + "description": "The identifier of a specific workflow step. You can specify the workflow step only by its internal ID.\n", + "in": "path", + "name": "workflow_step_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "type_identifier": { + "description": "Identifies the content type by internal ID (e.g., `269202ad-1d9d-47fd-b3e8-bdb05b3e3cf0`), external ID (e.g., `external-id/Content-Type-123`), or codename (e.g., `codename/hosted_video`).\n", + "in": "path", + "name": "type_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "snippet_identifier": { + "description": "Identifies a specific content type snippet by its internal ID (e.g., `baf884be-531f-441f-ae88-64205efdd0f6`), external ID (e.g., `external-id/snippet-type-123`), or codename (e.g., `codename/metadata`).\n", + "in": "path", + "name": "snippet_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "taxonomy_group_identifier": { + "description": "The identifier of a specific [taxonomy group](https://docs.kontent.ai/link-to/taxonomy_groups_37f45a1). You can specify a taxonomy group by its internal ID (e.g., `0be13600-e57c-577d-8108-c8d860330985`), external ID (e.g., `external-id/Tax-Group-123`), or codename {e.g., `codename/personas`).\n", + "in": "path", + "name": "taxonomy_group_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "file_name": { + "description": "Specifies the name of the uploaded binary file. The file name specified in the URL will be used for the asset name when you create an asset.\n", + "in": "path", + "name": "file_name", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "content_type_eb3978b": { + "description": "Specifies the [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the binary data.\n", + "in": "header", + "name": "Content-type", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "content_length": { + "description": "Specifies the size of the binary file in bytes.\n", + "in": "header", + "name": "Content-length", + "required": true, + "schema": { + "$ref": "#/components/schemas/Integer" + } + }, + "asset_identifier": { + "description": "Identifies the asset by internal ID (e.g., `fcbb12e6-66a3-4672-85d9-d502d16b8d9c`) or external ID (e.g., `external-id/which-brewing-fits-you`).\n", + "in": "path", + "name": "asset_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "asset_identifier_for_upsert": { + "description": "Identifies an asset by its internal ID (e.g., `fcbb12e6-66a3-4672-85d9-d502d16b8d9c`) or external ID (e.g., `external-id/which-brewing-fits-you`).\n* When adding a new asset, use an external ID as the asset's identifier.\n* When updating an existing asset, identify the asset either by its internal ID or external ID.\n\n\n\n

      External IDs

      \n

      If the specified external ID is not used by an existing asset, the API will create a new asset. For existing assets, the API updates only the specified asset's descriptions and title.

      \n\n\n", + "in": "path", + "name": "asset_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + }, + "webhook_identifier": { + "description": "Identifies a specific [webhook](https://docs.kontent.ai/link-to/webhooks) by its internal ID.\n", + "in": "path", + "name": "webhook_identifier", + "required": true, + "schema": { + "$ref": "#/components/schemas/String" + } + } + }, + "requestBodies": {}, + "responses": { + "continuation_token_error": { + "description": "The specified continuation token is incorrect.\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + }, + "example": { + "request_id": "|9d8951f5b06a1947a8f1d042c590662a.81f7e2f_", + "error_code": 1007, + "message": "Query parameter 'continuationToken' is invalid. Please include the valid token specified in the pagination response." + } + } + } + } + }, + "schemas": { + "String": { + "type": "string" + }, + "Reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to a specific object in the project.\n", + "properties": { + "id": { + "description": "The referenced object's internal ID.\n", + "example": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53", + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The referenced object's codename.\n", + "example": "object_codename", + "writeOnly": true, + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "external_id": { + "description": "The referenced object's external ID.\n", + "example": "your-own-custom-identifier", + "writeOnly": true, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, + "ContentItem": { + "required": ["name", "type"], + "properties": { + "id": { + "description": "The content item's internal ID.\n", + "example": "f4b3fc05-e988-4dae-9ac1-a94aba566474", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "name": { + "description": "The content item's display name.\n", + "example": "On Roasts", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "codename": { + "description": "The content item's codename. Unless set while [creating the content item](https://docs.kontent.ai/link-to/add_a_content_item), it is [initially generated](#tag/References/rules-for-codenames) from the item's `name` and can later be [modified](https://docs.kontent.ai/link-to/upsert_a_content_item).\n", + "example": "on_roasts", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "type": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the item's content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "sitemap_locations": { + "description": "The content item's location (or locations) in the project sitemap.\n\n\n\n

      Deprecation notice

      \n

      Sitemap has been deprecated since April 2019. The sitemap_locations property is a legacy property.

      \n\n\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + }, + "external_id": { + "description": "The content item's external ID. The external ID can be used as a unique identifier to retrieve content from a different system.\n\n**Note**: External IDs cannot be [upserted into exisiting items](https://docs.kontent.ai/link-to/upsert_a_content_item).\n", + "example": "my-item-identifier", + "type": "string" + }, + "last_modified": { + "description": "The [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date and time of the last change to the content item.\n\n**Note**: Moving content items through workflow doesn't affect the `last_modified` value.\n", + "example": "2019-04-04T13:45:30.7692802Z", + "readOnly": true, + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "ValidationError": { + "required": ["message"], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + }, + "line": { + "type": "integer" + }, + "position": { + "type": "integer" + } + }, + "type": "object" + }, + "Error": { + "description": "Error response\n", + "example": { + "request_id": "|797b0d5e2cecaf41b17a5aa4ca1b9276.d1956d1_", + "error_code": 5, + "message": "The provided request body is invalid. See the 'validation_errors' attribute for more information and specify a valid JSON object.", + "validation_errors": [{ + "message": "No patch operations were provided, provide at least one operation." + }] + }, + "required": ["request_id", "error_code", "message"], + "properties": { + "request_id": { + "description": "The performed request's unique ID.\n", + "format": "uuid", + "type": "string" + }, + "error_code": { + "description": "The specific internal code for the type of error. Only useful for finding patterns among error requests.\n", + "format": "int32", + "minimum": 100, + "maximum": 500, + "type": "integer" + }, + "message": { + "description": "The error message explaining why the error occurred.\n", + "type": "string" + }, + "validation_errors": { + "description": "A list of specific issues that occurred when processing the request.\n", + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array" + } + }, + "type": "object" + }, + "pagination": { + "description": "Information about the next page of results.\n", + "required": ["continuation_token", "next_page"], + "properties": { + "continuation_token": { + "description": "Identifier of the next page of results. Is `null` when on the last page of results.\n", + "example": "+RID:~...", + "nullable": true, + "type": "string" + }, + "next_page": { + "description": "A URL to the next page of results. Is `null` when on the last page of results.\n", + "example": "https://manage.kontent.ai/v2/projects//?continuationToken=%2bRID%3a~...", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "UpdateItem": { + "description": "The content item to update.\n", + "example": { + "name": "On Roasts", + "codename": "my_article_on_roasts", + "sitemap_locations": [{ + "codename": "articles" + }] + }, + "required": ["name"], + "properties": { + "name": { + "description": "The content item's display name.\n", + "example": "On Roasts", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "codename": { + "description": "The content item's codename. Unless set while [creating the content item](https://docs.kontent.ai/link-to/add_a_content_item), it is [initially generated](#tag/References/rules-for-codenames) from the item's `name` and can later be [modified](https://docs.kontent.ai/link-to/upsert_a_content_item). When only updating the `name` property, the item's `codename` is not affected by this change.\n", + "example": "my_article_on_roasts", + "type": "string" + }, + "sitemap_locations": { + "description": "One or more references to sitemap locations.\n\n\n\n

      Deprecation notice

      \n

      Sitemap has been deprecated since April 2019. The sitemap_locations property is a legacy property.

      \n\n\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "CreateItem": { + "description": "The content item to insert.\n", + "example": { + "name": "On Roasts", + "codename": "my_article_on_roasts", + "type": { + "codename": "article" + }, + "sitemap_locations": [{ + "codename": "articles" + }] + }, + "allOf": [{ + "$ref": "#/components/schemas/UpdateItem" + }, { + "required": ["type"], + "properties": { + "type": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the item's content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }] + }, + "AssetInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "The value of asset elements is an array of [Reference](https://docs.kontent.ai/link-to/references) objects. Each object represents a single asset. Every asset can be referenced only once.\n\nWhen retrieving asset elements, the Management API will always reference assets with their internal IDs. When updating asset elements via the API, you can reference an asset by its internal ID or external ID.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "CustomElementInVariant": { + "description": "**Note**: The Management API currently does not support upserting Custom elements.\n", + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "When retrieving and updating custom elements, the format of the value will be identical for both GET and PUT operations.\n", + "example": "#00ffff", + "nullable": true, + "minLength": 0, + "maxLength": 100000, + "type": "string" + } + }, + "type": "object" + }, + "DateTimeInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string.\n\nWhen retrieving and updating Date & time elements, the format of the value will be identical for both GET and PUT operations.\n", + "example": "2017-10-31T00:00:00Z", + "nullable": true, + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "LinkedItemsInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "The value of *Linked items* elements is an array of [Reference](https://docs.kontent.ai/link-to/references) objects. Each reference represents a single content item. Every content item can be referenced only once.\n\nWhen retrieving *Linked items* elements, the Management API will always reference content items with their internal IDs. When updating *Linked items* elements via the API, you can reference a content item by its internal ID, codename, or external ID.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "type": "array" + } + }, + "type": "object" + }, + "MultipleChoiceInVariant": { + "example": [{ + "id": "a831d60b-ff0e-7df1-61d2-73e851a5deab" + }, { + "id": "0378b1b7-2425-4c20-bc0c-7fd355d568ed" + }], + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "The value of *Multiple choice* elements is an array of [Reference](https://docs.kontent.ai/link-to/references) objects. Each reference represents one of the multiple choice options, each with a unique identifier.\n\nIf the multiple choice element is configured as single option (i.e., radio buttons), its `value` array must contain a reference to exactly one option. When configured as multiple option (i.e., checkboxes), the array can contain references to as many options as are defined in the content type. In case no option is selected, the value of the element will be an empty array.\n\nWhen retrieving *Multiple choice* elements, the Management API will always reference the multiple choice options with their internal IDs. When updating multiple choice elements via the API, you can reference an option by its internal ID or codename.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "NumberInVariant": { + "required": ["elements", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "When retrieving and updating *Number* elements, the format of the value will be identical for both GET and PUT operations.\n", + "example": 8, + "nullable": true, + "format": "float", + "type": "number" + } + }, + "type": "object" + }, + "TaxonomyInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "The value of taxonomy elements is an array of [Reference](https://docs.kontent.ai/link-to/references) objects. Each reference represents a taxonomy term of a specific taxonomy group. Every taxonomy term can be referenced only once.\n\nWhen retrieving taxonomy elements, the Management API will always reference taxonomy terms with their internal IDs. When updating taxonomy elements via the API, you can reference a taxonomy term by its internal ID, external ID or codename.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "TextInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "When retrieving and updating text elements, the format of the `value` property will be identical for both GET and PUT operations.\n", + "example": "Article body", + "nullable": true, + "maxLength": 100000, + "type": "string" + } + }, + "type": "object" + }, + "UrlSlugInVariant": { + "required": ["element"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "mode": { + "description": "Determines the element's mode of operation.\n* `autogenerated` means the URL slug element sets its value automatically based on the value of a specified text element.\n* `custom` means the URL slug element's value is not affected by changes in a specified text element and can be set manually.\n\n**Note**: You can change the text element the URL slug depends on either [in the UI](/tutorials/set-up-projects/define-content-models/configuring-limitations-in-content-types#a-how-to-configure-limitations) or [via the API](https://docs.kontent.ai/link-to/modify_a_content_type).\n", + "example": "autogenerated", + "enum": ["autogenerated", "custom"], + "default": "custom", + "type": "string" + }, + "value": { + "description": "The element's value.\n* When upserting the element with the `mode` set to `autogenerated`, the `value` is ignored and can be omitted.\n* If the value is upserted, the element's mode changes to `custom` automatically.\n\n\n\n

      Automatic vs. manual mode

      \n

      The URL slug element can function in two modes, automatic and manual. When creating language variants in automatic mode, the system automatically generates the element's value based on the text element of your choice.

      \n

      If you modify the element's value directly (either in UI or via API), the element switches to the manual mode. In this mode, the element does not react to changes made to the dependent text element. Learn about creating SEO-friendly URLs in your projects.

      \n\n\n", + "example": "user-and-seo-friendly-url-slug", + "type": "string" + } + }, + "type": "object" + }, + "RichTextComponent": { + "properties": { + "id": { + "description": "The component's ID. Must match the `data-id` of the component object inside the `value` of the rich text element.\n", + "example": "382abced-bfb6-4ee9-a2d4-2c3b8cd8ba5d", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "type": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the component's content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "elements": { + "description": "The component's elements based on the specified content type.\n", + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/AssetInVariant" + }, { + "$ref": "#/components/schemas/CustomElementInVariant" + }, { + "$ref": "#/components/schemas/DateTimeInVariant" + }, { + "$ref": "#/components/schemas/LinkedItemsInVariant" + }, { + "$ref": "#/components/schemas/MultipleChoiceInVariant" + }, { + "$ref": "#/components/schemas/NumberInVariant" + }, { + "$ref": "#/components/schemas/RichTextInVariant" + }, { + "$ref": "#/components/schemas/TaxonomyInVariant" + }, { + "$ref": "#/components/schemas/TextInVariant" + }, { + "$ref": "#/components/schemas/UrlSlugInVariant" + }] + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "RichTextInVariant": { + "required": ["element", "value"], + "properties": { + "element": { + "$ref": "#/components/schemas/Reference" + }, + "value": { + "description": "By default, if there is no text, the rich text value is a single empty paragraph: `


      `. The value can contain HTML formatted text, specific HTML elements and must form a valid HTML5 fragment.\n\n\n\n

      Nesting HTML elements in rich text

      \n

      At the top level, only the following elements are allowed: <p>, <h1>, <h2>, <h3>, <h4>, <ul>, <ol>, <table>, <object> (for content items and components), and <figure> (for images). These top-level elements can NOT be nested except for lists (<ul> and <ol>). Text is not allowed at the top level with the exception of new lines and white space characters.

      \n

      The <p>, <h1>, <h2>, <h3>, <h4>, <li>, and <td> elements can contain text and the following inline elements: <a>, <code>, <em>, <strong>, <sub>, <sup>. These elements can also contain <br/> elements for specifying break lines.

      \n

      The <a>, <code>, <em>, and <strong> inline elements can be nested but they cannot cross one another. For example, it's not allowed to open the <em> element, then the <strong> element, and then close the <em> element. Lists can be nested as long as the nested list (<ul> or <ol>) is the last HTML element of the list item, for example, <ol><li>List item<ul><li>Nested list item</li></ul></li></ol>.

      \n\n\n\nFor more information see the list of [supported HTML elements and their syntax](#section/Rich-text-element/html5-elements-allowed-in-rich-text).\n", + "example": "...

      Medium roast

      \\n

      These exempt a stronger flavor than light roasts. The beans are still more matte than oily1.

      \\n
      \\n

      Caffeine contents are decreased. Medium roasts lack the grainy taste of lighter roasts. You also get a more balanced flavor, aroma and acidity.

      \\n\\n ...", + "maxLength": 100000, + "type": "string" + }, + "components": { + "description": "A list of [components](#section/Rich-text-element/components-in-rich-text) used in the rich text's `value`.\n\n**Note**: The components can be nested up to 6 levels deep.\n", + "example": { + "id": "382abced-bfb6-4ee9-a2d4-2c3b8cd8ba5d", + "type": { + "id": "f4cb13df-d61d-572e-8f3b-3afe7e3a7ea1" + }, + "elements": [{ + "element": { + "id": "0b9173d6-1c94-5fb0-a010-86eef9013fd4" + }, + "value": "

      Component on level 2

      \n", + "components": [{ + "id": "7c1ca8b2-2fa8-41d8-be02-bf157d3fa225", + "type": { + "id": "37684e4c-9303-589b-a937-c7c165171b38" + }, + "elements": [{ + "element": { + "id": "ff50c0e0-226e-5474-b71b-2af194edd7c4" + }, + "value": "

      Nested component on level 3

      ", + "components": [] + }] + }] + }, { + "element": { + "id": "edd22f22-ccd6-56e6-9fe2-676a7e250d8c" + }, + "value": [{ + "id": "f206b928-7609-5192-bd31-6eb6aae48096" + }] + }] + }, + "items": { + "$ref": "#/components/schemas/RichTextComponent" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "LanguageVariant": { + "description": "Localized variant of a content item.\n", + "required": ["elements", "workflow_step", "item", "language", "last_modified"], + "properties": { + "elements": { + "description": "List of elements as defined in the item's [content type](https://docs.kontent.ai/link-to/content_types_09b103e).\n", + "example": [{ + "element": { + "id": "c7c3b834-2222-5677-89c4-b46f04489109" + }, + "value": "Text element value" + }, { + "components": [{ + "id": "518d8f59-940e-40b1-a90f-bef4ee6e7325", + "type": { + "id": "a21859b5-9b76-4065-8d68-778e9fcc514e" + }, + "elements": [{ + "components": [], + "element": { + "id": "0a331b5f-bbda-42b3-aaf7-090eb424da05" + }, + "value": "

      This is a component referenced in the rich text's value.

      " + }, { + "element": { + "id": "df9d6c65-666f-475e-9113-1e2480afdc58" + }, + "value": [{ + "id": "f96b88cd-f5a2-49f1-bcdf-35a503aec569" + }] + }] + }], + "element": { + "id": "0ddd5a94-0360-5126-92e6-264dfbb61849" + }, + "value": "

      Rich text element value with a link to a content item and a component.

      \n" + }, { + "element": { + "id": "aa031bec-0012-4b60-8926-7dcbfc5a2efe" + }, + "value": [] + }, { + "mode": "manual", + "element": { + "id": "53a5eecb-f295-59b4-a07d-19655b6ad860" + }, + "value": "custom-url-slug-value" + }], + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/AssetInVariant" + }, { + "$ref": "#/components/schemas/CustomElementInVariant" + }, { + "$ref": "#/components/schemas/DateTimeInVariant" + }, { + "$ref": "#/components/schemas/LinkedItemsInVariant" + }, { + "$ref": "#/components/schemas/MultipleChoiceInVariant" + }, { + "$ref": "#/components/schemas/NumberInVariant" + }, { + "$ref": "#/components/schemas/RichTextInVariant" + }, { + "$ref": "#/components/schemas/TaxonomyInVariant" + }, { + "$ref": "#/components/schemas/TextInVariant" + }, { + "$ref": "#/components/schemas/UrlSlugInVariant" + }] + }, + "uniqueItems": true, + "type": "array" + }, + "workflow_step": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the variant's current [workflow step](https://docs.kontent.ai/link-to/workflow_and_publishing).\n", + "example": { + "id": "dc87d7cf-424b-4b89-9519-c9f79a3458b7" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "item": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content item.\n", + "example": { + "id": "82ef61f4-ccee-42ac-95e2-1a44beda9625" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "language": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the language of the variant. Note that the default language will always have the ID of `00000000-0000-0000-0000-000000000000`.\n", + "example": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date and time of the last change of content.\n", + "example": "2020-02-27T19:08:25.404Z", + "readOnly": true, + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "Language": { + "required": ["id", "name", "codename"], + "properties": { + "id": { + "description": "The language's internal ID. Note that the ID of the default language is always `00000000-0000-0000-0000-000000000000`.\n", + "example": "00000000-0000-0000-0000-000000000000", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "The language's display name.\n", + "example": "Default project language", + "maxLength": 25, + "type": "string" + }, + "codename": { + "description": "The language's codename. Initially generated from the language's `name` unless the language is [added via API](https://docs.kontent.ai/link-to/add_a_language).\n", + "example": "default", + "maxLength": 25, + "type": "string" + }, + "external_id": { + "description": "[External ID](https://docs.kontent.ai/link-to/references) of the language. Only present if defined when creating the language.\n", + "type": "string" + }, + "is_active": { + "description": "A flag determining whether the language is active.\n", + "example": false, + "type": "boolean" + }, + "is_default": { + "description": "A flag determining whether the language is default.\n", + "example": true, + "readOnly": true, + "type": "boolean" + }, + "fallback_language": { + "description": "Language to use when the current language contains no content. With multiple languages you can create [fallback chains](https://docs.kontent.ai/link-to/localization_in_kentico_kontent).\n", + "example": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "LanguageOperationReplace": { + "required": ["op", "property_name", "value"], + "properties": { + "op": { + "description": "The operation to perform.\n", + "example": "replace ", + "enum": ["replace"], + "type": "string" + }, + "property_name": { + "description": "The name of the [language](https://docs.kontent.ai/link-to/languages) property that you want to modify.\n* Use `name` to change the display name of the language.\n* Use `codename` to change the language codename.\n* Use `fallback_language` to change the fallback language for the specified language.\n* Use `is_active` to determine whether the language will be set as active.\n", + "example": "codename", + "enum": ["name", "codename", "fallback_language", "is_active"], + "type": "string" + }, + "value": { + "description": "The value or object to insert in the specified property. The format of the `value` property depends on value of the `property_name` property.\n* For `property_name` of `name` or `codename`, the `value` property is string.\n* For `property_name` of `fallback_language`, the `value` property is a [Reference](https://docs.kontent.ai/link-to/references) object.\n* For `property_name` of `is_active`, the `value` property is boolean.\n", + "oneOf": [{ + "type": "string" + }, { + "$ref": "#/components/schemas/Reference" + }, { + "example": false, + "type": "boolean" + }] + } + }, + "type": "object" + }, + "WorkflowStep": { + "example": { + "id": "16221cc2-bd22-4414-a513-f3e555c0fc93", + "name": "Copywriting", + "transitions_to": ["a3d4309f-f1e0-432e-bd95-7137b5abd8ba", "90bb6851-7a47-4c77-ae98-06a15431857f", "dc87d7cf-424b-4b89-9519-c9f79a3458b7"] + }, + "required": ["id", "name", "transitions_to"], + "properties": { + "id": { + "description": "Internal ID of the workflow step.\n", + "format": "uuid", + "type": "string" + }, + "name": { + "description": "Display name of the workflow step.\n", + "type": "string" + }, + "transitions_to": { + "description": "The workflow steps that this step can transition to, represented by their internal IDs.\n", + "items": { + "format": "uuid", + "type": "string" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "CountLimitation": { + "required": ["value", "condition"], + "properties": { + "value": { + "description": "Specifies the image size or how many times something can be used within the element.\n", + "example": 256, + "format": "int32", + "type": "integer" + }, + "condition": { + "description": "Specifies how to apply the `value`.\n", + "example": "at_least", + "enum": ["at_most", "exactly", "at_least"], + "type": "string" + } + }, + "type": "object" + }, + "AssetInType": { + "required": ["name", "type"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "Photo", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "type": { + "description": "The element's type.\n", + "example": "asset", + "enum": ["asset"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "30ca5bc8-4f2a-47b9-a9e7-0d13a2935e10", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "photo", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "profile-picture", + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Optional photo of the author.", + "nullable": true, + "type": "string" + }, + "asset_count_limit": { + "description": "Specifies the limitation for the number of assets allowed within the element.\n", + "example": { + "value": 1, + "condition": "exactly" + }, + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "maximum_file_size": { + "description": "Specifies the maximum file size in bytes.\n", + "example": 262144, + "format": "int32", + "type": "integer" + }, + "allowed_file_types": { + "description": "Specifies the allowed file types.\n* `adjustable` for [images that that support image transformation](https://docs.kontent.ai/link-to/image_transformation_reference)\n* `any` for any file type\n", + "example": "adjustable", + "enum": ["adjustable", "any"], + "type": "string" + }, + "image_width_limit": { + "description": "Specifies the width limitation for the asset.\n", + "example": null, + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "image_height_limit": { + "description": "Specifies the height limitation for the asset.\n", + "example": null, + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": true, + "type": "boolean" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "CustomElementInType": { + "description": "Custom elements contain the additional properties `source_url`, `json_parameters`, and `allowed_elements`.\n", + "required": ["name", "type", "source_url"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "Color picker", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "type": { + "description": "The element's type.\n", + "example": "custom", + "enum": ["custom"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "2f9dea65-a6d3-49e7-9297-56d8034e8f42", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "color_picker", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "color-picker", + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Always pick colors based on the brand manuals.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "source_url": { + "description": "Absolute URL that hosts your custom element.\n", + "example": "https://kentico.github.io/kontent-custom-element-samples/ColorPicker/color-picker.html", + "type": "string" + }, + "json_parameters": { + "description": "Optional parameters that allow you to use the element in different content types or provide customizable layout.\n\nThe value must be valid a stringified JSON.\n", + "example": "{\\\"brand_colors_only\\\":\\\"true\\\"}", + "type": "string" + }, + "allowed_elements": { + "description": "Specifies the elements that this custom element can read from.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "DateTimeInType": { + "required": ["name", "type"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "Birth date", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Proivde exact birth date and time with one minute precision.", + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "date_time", + "enum": ["date_time"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "4f64afc0-5102-4fad-b564-baadb375ab73", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "birth_date", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "birth-date", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "GuidelinesInType": { + "description": "Guidelines elements do not contain the `name` property. The value of the `guidelines` property must follow the same limitations as the value of [Rich text elements](https://developer.kenticocloud.com/reference#content-management-api-v2-rich-text-element).\n\n**Note**: Guidelines cannot contain assets, content items, or components.\n", + "required": ["guidelines", "type"], + "properties": { + "guidelines": { + "description": "Specifies the instructions for contributors on what to fill in the other elements.\n\n**Note**: The value of the `guidelines` property must follow the same limitations as the value of [rich text elements](#section/Rich-text-element). In addition, the guidelines element cannot contain assets, content items, or components.\n", + "example": "

      Naming and usage

      ...", + "minLength": 1, + "maxLength": 100000, + "type": "string" + }, + "type": { + "description": "The element's type.\n", + "example": "guidelines", + "enum": ["guidelines"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "19e15fe8-900a-4456-84eb-16430dc35e88", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `id`.\n", + "example": "n19e15fe8_900a_4456_84eb_16430dc35e88", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "additional-information", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "LinkedItemsInType": { + "required": ["name", "type"], + "properties": { + "item_count_limit": { + "description": "Specifies the limitation for the number of items allowed within the element.\n", + "example": { + "value": 1, + "condition": "exactly" + }, + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "allowed_content_types": { + "description": "Specifies allowed file types as an array of [references](https://docs.kontent.ai/link-to/references) to the content types.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + }, + "name": { + "description": "The element's display name.\n", + "example": "Fun facts", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Keep them light and fun.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "modular_content", + "enum": ["modular_content"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "63c0a251-f455-45c8-95bd-542c1358b1a8", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "fun_facts", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "my-fun-facts", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "MultipleChoiceOption": { + "required": ["name"], + "properties": { + "id": { + "description": "The multiple choice option's internal ID.\n", + "example": "6bfe5a60-5cc2-4303-8f72-9cc53431046b", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The multiple choice option's codename.\n\n**Note**: Initially generated from the option's display name. The codename [can be changed](https://docs.kenticocloud.com/tutorials/set-up-projects/define-content-models/creating-and-deleting-content-types#a-editing-codenames) manually in the UI.\n", + "example": "option_name", + "type": "string" + }, + "name": { + "description": "The multiple choice option's display name.\n", + "example": "Option name", + "minLength": 1, + "maxLength": 150, + "type": "string" + } + }, + "type": "object" + }, + "MultipleChoiceInType": { + "description": "Multiple choice elements contain additional `mode` and `options` properties.\n", + "required": ["name", "type", "options"], + "properties": { + "mode": { + "description": "Defines whether the multiple choice element acts as a single choice (shown as radio buttons in the UI) or multiple choice (shown as checkboxes in the UI).\n", + "example": "single", + "enum": ["single", "multiple"], + "type": "string" + }, + "options": { + "description": "The element's multiple choice options.\n", + "items": { + "$ref": "#/components/schemas/MultipleChoiceOption" + }, + "uniqueItems": true, + "type": "array" + }, + "name": { + "description": "The element's display name.\n", + "example": "Product state", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Specify all possible options.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": true, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "multiple_choice", + "enum": ["multiple_choice"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "fcc30f1e-9abf-41da-8693-ed89f3be438d", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "product_state", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "product-state-id", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "example": "975bf280-fd91-488c-994c-2f04416e5ee3" + "type": "object" }, - "language": { - "description": "Determines which language variant of content items to return. By default, the API returns content in the default language.\n\n**Note**: If the requested content is not available in the specified language variant, the API follows the [language fallbacks](/tutorials/set-up-projects/set-up-languages/localization-in-kentico-cloud#a-understanding-language-fallbacks \"Understanding language fallbacks\") as configured in the [Localization](https://docs.kontent.ai/link-to/localization_in_kentico_kontent) settings of your project.\n", - "in": "query", - "name": "language", - "schema": { - "$ref": "#/components/schemas/String" + "NumberInType": { + "required": ["name", "type"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "Number", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Provide a number.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "number", + "enum": ["number"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "b18cbb42-9649-4870-b2d6-805238a34ae9", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "number", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "my-number", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "example": "en-US" + "type": "object" }, - "elements": { - "description": "Determines the elements to retrieve using a comma-separated list of element codenames. The `elements` query parameter applies to all content items within the response.\n\nIf not specified, all elements are retrieved. For more details, see [Projection](https://docs.kontent.ai/link-to/projection).\n", - "in": "query", - "name": "elements", - "explode": false, - "style": "form", - "schema": { - "$ref": "#/components/schemas/StringArray" + "LengthLimitation": { + "description": "Specifies the maximum text length.\n", + "required": ["value", "applies_to"], + "properties": { + "value": { + "description": "The maximum number of characters or words.\n", + "example": 60, + "type": "integer" + }, + "applies_to": { + "description": "Determines whether the value applies to characters or words.\n", + "example": "characters", + "enum": ["words", "characters"], + "type": "string" + } }, - "example": "title,summary,post_date,teaser_image" + "type": "object" }, - "order": { - "description": "Determines the order of the retrieved content items. By default, the items are sorted alphabetically by their codenames from A to Z in descending order.\n\nTo sort content items in ascending order, set the parameter value to `[asc]` where is the name of the object property you want to sort by. For example, `order=elements.title[asc]`. Similarly, to sort in descending order, you can use the `[desc]` modifier. You can sort by properties of both the `system` and `elements}~ objects of content items.\n\n**Examples**\n* Sort by date – `order=system.last_modified[desc]`\n* Sort by a content item name – `order=system.name[asc]`\n* Sort by an element value – `order=elements.[asc]`\n", - "in": "query", - "name": "order", - "schema": { - "$ref": "#/components/schemas/String" + "AllowedBlocksValue": { + "example": "text", + "enum": ["images", "text", "tables", "components-and-items"], + "type": "string" + }, + "AllowedBlocks": { + "description": "Specifies which blocks are allowed inside your rich text element. You can allow text, tables, images, and components and items. To allow all blocks, leave the array empty. If you include all values, the response will return a validation error.\n", + "example": ["text"], + "items": { + "$ref": "#/components/schemas/AllowedBlocksValue" }, - "example": "elements.post_date[desc]" + "type": "array" }, - "depth": { - "description": "Determines the level of nesting for content items that the API returns. By default, only the first level of linked items is returned, which is the same as setting `depth=1`.\n\nIf you need to exclude all linked items from the response, set the parameter to `0`. Note that components are always present in response. See [Linked content and components](https://docs.kontent.ai/link-to/linked_content_and_components) for more details.\n", - "in": "query", - "name": "depth", - "schema": { - "$ref": "#/components/schemas/Integer" + "RichTextInType": { + "example": { + "maximum_text_length": null, + "maximum_image_size": null, + "allowed_content_types": [{ + "id": "41bf32d8-cbba-4d54-8048-002a21ba5a21" + }, { + "id": "ebc7f3ef-061d-4369-b92f-1512305f0dcd" + }], + "image_width_limit": null, + "image_height_limit": null, + "allowed_image_types": "any", + "allowed_blocks": ["components-and-items"], + "name": "Properties", + "guidelines": "Use only items and components in this element.", + "is_required": false, + "type": "rich_text", + "external_id": "88385bcc-6e62-4e2c-93d2-29b2e5506ea4", + "id": "e7226530-f5d8-5b74-a9e7-261d0be7547d", + "codename": "properties", + "content_group": { + "id": "78876c93-4a61-4fa3-a3b7-d2619b2625fa" + } + }, + "required": ["name", "type"], + "properties": { + "maximum_text_length": { + "$ref": "#/components/schemas/LengthLimitation" + }, + "maximum_image_size": { + "description": "Specifies the maximum image size in bytes.\n", + "format": "int32", + "type": "integer" + }, + "allowed_content_types": { + "description": "Specifies a list of allowed content types as an array of [references](https://docs.kontent.ai/link-to/references).\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "uniqueItems": true, + "type": "array" + }, + "allowed_blocks": { + "$ref": "#/components/schemas/AllowedBlocks" + }, + "image_width_limit": { + "description": "Specifies the width limitation for images.\n", + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "image_height_limit": { + "description": "Specifies the height limitation for images.\n", + "allOf": [{ + "$ref": "#/components/schemas/CountLimitation" + }] + }, + "allowed_image_types": { + "description": "Specifies which image types are allowed.\n* `adjustable` for [images that that support image transformation](https://docs.kontent.ai/link-to/image_transformation_reference)\n* `any` for any image type\n", + "enum": ["adjustable", "any"], + "type": "string" + }, + "name": { + "description": "The element's display name.\n", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "enum": ["rich_text"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "example": 1 + "type": "object" }, - "skip": { - "description": "The number of items to skip when requesting a list of objects. If the `skip` parameter is not specified, the API returns the first page of results.\n\nYou can combine the `limit` and `skip` parameters to specify page size and page number. For example, to set a page size to 10 and get the second page of results, you can use this combination `limit=10&skip=10`.\n", - "in": "query", - "name": "skip", - "schema": { - "$ref": "#/components/schemas/Integer" + "SnippetInType": { + "description": "The content type snippet elements contain the `snippet` property with a [reference](https://docs.kontent.ai/link-to/references) to a specific content type snippet.\n\nLearn more about [reusing collections of elements](https://docs.kontent.ai/link-to/reusing_collections_of_elements_with_snippets) with snippets.\n", + "required": ["type", "id", "codename", "snippet"], + "properties": { + "snippet": { + "description": "The element's [reference](https://docs.kontent.ai/link-to/references) to a specific content type snippet.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "type": { + "description": "The element's type.\n", + "example": "snippet", + "enum": ["snippet"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "15e39f98-1586-4f05-b260-36684600b205", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "seo_metadata", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "my-seo-metadata", + "type": "string" + } }, - "example": 10 + "type": "object" }, - "limit_8cd54e2": { - "description": "The number of items to retrieve in a single request. If the `limit` parameter is not specified, the API returns all items by default.\n\nIf the limit is lower than the total number of items matching your query, the `next_page` property in the `pagination` object of the API response will contain a URL to the next page of results.\n", - "in": "query", - "name": "limit", - "schema": { - "$ref": "#/components/schemas/Integer" + "TaxonomyInType": { + "required": ["taxonomy_group", "type"], + "properties": { + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Be sure to be in the correct group", + "nullable": true, + "type": "string" + }, + "taxonomy_group": { + "description": "Specifies a [reference](https://docs.kontent.ai/link-to/references) to the taxonomy group that the element uses.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "taxonomy", + "enum": ["taxonomy"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "fdcdd09e-7599-4f24-b8eb-fdf318e1072e", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "personas", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "business-personas", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "example": 10 + "type": "object" }, - "x_kc_wait_for_loading_new_content": { - "description": "Determines whether the API waits while fetching content, if the requested content has changed since the last request. This is useful when retrieving changed content in reaction to a [webhook](https://docs.kontent.ai/link-to/using_webhooks_for_automatic_updates) call.\n\nBy default, when the header is not set, the API serves stale content (if cached by the CDN) while it's fetching the new content to minimize wait time. To always fetch new content, set the header value to `true`.\n", - "in": "header", - "name": "X-KC-Wait-For-Loading-New-Content", - "schema": { - "$ref": "#/components/schemas/Boolean" - } + "TextInType": { + "description": "Text elements may specify the maximum allowed length using the `maximum_text_length` property, which takes a length limitation object.\n", + "required": ["name", "type"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "Title", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Keep it short.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "text", + "format": "text", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "7dc115d0-e9f8-4947-9cfb-9a26485975ae", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "title", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "my-text-element", + "type": "string" + }, + "maximum_text_length": { + "$ref": "#/components/schemas/LengthLimitation" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" }, - "item_codename": { - "description": "Identifies the content item by codename.\n", - "in": "path", - "name": "item_codename", - "required": true, - "schema": { - "$ref": "#/components/schemas/String" + "DependsOn": { + "description": "Specifies the text element that provides the default value to the URL slug element. The dependent text element can be part of a content type snippet.\n", + "example": { + "element": { + "id": "c7c3b834-2222-5677-89c4-b46f04489109" + }, + "snippet": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + } + }, + "required": ["element"], + "properties": { + "element": { + "description": "The dependent text element specified as a [reference](https://docs.kontent.ai/link-to/references).\n", + "example": { + "id": "c7c3b834-2222-5677-89c4-b46f04489109" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "snippet": { + "description": "The content type snippet, specified as a [reference](https://docs.kontent.ai/link-to/references), that contains the dependent text element.\n\n**Note**: The `snippet` property is not present if the text element is in the same content type.\n", + "example": { + "id": "67faca73-bfd3-4600-b6c4-9cc91cc8d85f" + }, + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "example": "on_roasts" + "type": "object" }, - "x_continuation": { - "description": "Determines the next page of results to retrieve. By default, when the header is not set, the API returns the first page of results.\n\nIf there are more items to enumerate, the response will come with the `X-Continuation` header. To get the next page of results, use the `X-Continuation` header from the response in your request.\n", - "in": "header", - "name": "X-Continuation", - "schema": { - "$ref": "#/components/schemas/String" - } + "UrlSlugInType": { + "required": ["name", "type", "depends_on"], + "properties": { + "name": { + "description": "The element's display name.\n", + "example": "URL slug", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "depends_on": { + "$ref": "#/components/schemas/DependsOn" + }, + "guidelines": { + "description": "The element's guidelines, providing instructions on what to fill in.\n", + "example": "Auto-generated from Title. Only change if necessary.", + "nullable": true, + "type": "string" + }, + "is_required": { + "description": "Determines whether the element must be filled in.\n", + "example": false, + "nullable": true, + "type": "boolean" + }, + "type": { + "description": "The element's type.\n", + "example": "url_slug", + "enum": ["url_slug"], + "type": "string" + }, + "id": { + "description": "The element's internal ID.\n", + "example": "8f43fd1b-e11d-494b-a85f-478db1703c21", + "readOnly": true, + "type": "string" + }, + "codename": { + "description": "The element's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the element's `name`.\n", + "example": "url_slug", + "type": "string" + }, + "external_id": { + "description": "The element's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "my-url-slug", + "type": "string" + }, + "content_group": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the content group the element is used in.\n\n**Note**: The `content_group` property is only present if one or more content groups are defined in the content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" }, - "type_codename": { - "description": "Identifies the content type by codename.\n", - "in": "path", - "name": "type_codename", - "required": true, - "schema": { - "$ref": "#/components/schemas/String" + "ContentGroup": { + "required": ["name"], + "properties": { + "id": { + "description": "The content group's internal ID.\n", + "example": "325107f6-5dfb-21a1-b24e-fa13be1fef1c", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "name": { + "description": "The content group's display name.\n", + "example": "My first group", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "codename": { + "description": "The content group's codename. Unless specified, [initially generated](#tag/References/rules-for-codenames) from the group's `name`.\n", + "example": "my_first_group", + "readOnly": true, + "type": "string" + }, + "external_id": { + "description": "The content group's external ID. When [adding a new content type](https://docs.kontent.ai/link-to/add_a_content_type) with content groups, you can only reference the new content groups using their [external IDs](https://docs.kontent.ai/link-to/references).\n", + "example": "first-group", + "type": "string" + } }, - "example": "article" + "type": "object" }, - "element_codename": { - "description": "Identifies the element by codename within the specified content type.\n\n**Note**: The element's codename has no relation to the type of the element.\n", - "in": "path", - "name": "element_codename", - "required": true, - "schema": { - "$ref": "#/components/schemas/String" + "ContentType": { + "description": "A content type object\n", + "required": ["elements", "name"], + "properties": { + "id": { + "description": "The content type's internal ID.\n", + "example": "975bf280-fd91-488c-994c-2f04416e5ee3", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The content type's codename. Unless set while [creating the content type](https://docs.kontent.ai/link-to/add_a_content_type), it is [initially generated](#tag/References/rules-for-codenames) from the type's `name` and can later be [modified](https://docs.kontent.ai/link-to/modify_a_content_type).\n", + "example": "about_us", + "type": "string" + }, + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date and time of the last change to the content type.\n", + "example": "2016-10-20T12:03:17.4685693Z", + "readOnly": true, + "format": "date-time", + "type": "string" + }, + "name": { + "description": "The content type's display name.\n", + "example": "About us", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "elements": { + "description": "Elements within the content type.\n\n**Note**: The order of the Element objects might not match the order in the UI.\n", + "example": [{ + "maximum_text_length": null, + "name": "Name", + "guidelines": "Provide author's full name.", + "is_required": true, + "type": "text", + "id": "4af91e26-fa91-4ecf-9936-99d8622d0898", + "codename": "name" + }, { + "asset_count_limit": { + "value": 1, + "condition": "exactly" + }, + "maximum_file_size": 262144, + "allowed_file_types": "adjustable", + "image_width_limit": null, + "image_height_limit": null, + "name": "Photo", + "guidelines": "Optionally, upload a photo of the author.", + "is_required": false, + "type": "asset", + "id": "30ca5bc8-4f2a-47b9-a9e7-0d13a2935e10", + "codename": "photo" + }], + "items": { + "oneOf": [{ + "$ref": "#/components/schemas/AssetInType" + }, { + "$ref": "#/components/schemas/CustomElementInType" + }, { + "$ref": "#/components/schemas/DateTimeInType" + }, { + "$ref": "#/components/schemas/GuidelinesInType" + }, { + "$ref": "#/components/schemas/LinkedItemsInType" + }, { + "$ref": "#/components/schemas/MultipleChoiceInType" + }, { + "$ref": "#/components/schemas/NumberInType" + }, { + "$ref": "#/components/schemas/RichTextInType" + }, { + "$ref": "#/components/schemas/SnippetInType" + }, { + "$ref": "#/components/schemas/TaxonomyInType" + }, { + "$ref": "#/components/schemas/TextInType" + }, { + "$ref": "#/components/schemas/UrlSlugInType" + }] + }, + "uniqueItems": true, + "type": "array" + }, + "external_id": { + "description": "The content type's [external ID](https://docs.kontent.ai/link-to/references). **Note**: Only present if defined when [creating the content type](https://docs.kontent.ai/link-to/add_a_content_type) via API.\n", + "example": "my-author", + "type": "string" + }, + "content_groups": { + "description": "The collection will be empty if the content type contains no content groups.\n", + "example": [], + "items": { + "$ref": "#/components/schemas/ContentGroup" + }, + "type": "array" + } }, - "example": "processing" + "type": "object" }, - "taxonomy_group_codename": { - "description": "Identifies the taxonomy group by codename.\n", - "in": "path", - "name": "taxonomy_group_codename", - "required": true, - "schema": { - "$ref": "#/components/schemas/String" + "TypeOperationAddInto": { + "required": ["op", "value"], + "properties": { + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "addInto", + "enum": ["addInto", "replace", "remove"], + "type": "string" + }, + "path": { + "description": "A string identifying where the new object or property should be added. The exact path depends on what you are trying to add and where. If you are trying to add a property to a given element, a `{path_reference}` is needed for that element.\n1. To add a new element, set `path` to: `/elements`.\n2. To add a new content group, set `path` to: `/content_groups`.\n3. To add an allowed content type to a rich text or linked items element, set `path` to: `/elements/{path_reference}/allowed_content_types`.\n4. To add an allowed element to a custom element, set `path` to: `/elements/{path_reference}/allowed_elements`.\n5. To add a new multiple choice option, set `path` to: `/elements/{path_reference}/options`.\n6. To add a block so it can be used in a rich text element, set `path` to: `/elements/{path_reference}/allowed_blocks`.\n", + "example": "/elements/codename:rich_text/allowed_content_types", + "writeOnly": true, + "type": "string" + }, + "value": { + "description": "The object to add. The value depends on the selected `path`:\n1. To add a new element, use a content element object.\n2. To add a new content group, use a content group object.\n3. To add an allowed content type to a rich text or linked items element, use a [reference](https://docs.kontent.ai/link-to/references) object that points to a specific content type.\n4. To add an allowed element to a custom element, use a [reference](https://docs.kontent.ai/link-to/references) object that points to the specific element.\n5. To add an option to a multiple choice element, use an option object.\n6. To add a block so it can be used in a rich text element, use the allowed blocks value string.\n\n(Note that `value` can also be used together with the deprecated `property_name`).\n", + "oneOf": [{ + "$ref": "#/components/schemas/AssetInType" + }, { + "$ref": "#/components/schemas/ContentGroup" + }, { + "$ref": "#/components/schemas/CustomElementInType" + }, { + "$ref": "#/components/schemas/DateTimeInType" + }, { + "$ref": "#/components/schemas/GuidelinesInType" + }, { + "$ref": "#/components/schemas/LinkedItemsInType" + }, { + "$ref": "#/components/schemas/MultipleChoiceOption" + }, { + "$ref": "#/components/schemas/MultipleChoiceInType" + }, { + "$ref": "#/components/schemas/NumberInType" + }, { + "$ref": "#/components/schemas/Reference" + }, { + "$ref": "#/components/schemas/TaxonomyInType" + }, { + "$ref": "#/components/schemas/TextInType" + }, { + "$ref": "#/components/schemas/UrlSlugInType" + }, { + "$ref": "#/components/schemas/AllowedBlocksValue" + }] + }, + "before": { + "description": "An *optional* [reference to the object](https://docs.kontent.ai/link-to/references) before which you want to add the new object.\n\nFor example, to add an element or multiple choice option before an existing element or option named \"Text\", you can set `before` to `{codename: text}`.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "after": { + "description": "An *optional* [reference to the object](https://docs.kontent.ai/link-to/references) after which you want to add the new object.\n\nFor example, to add an element or multiple choice option after an existing element or option named \"Text\", you can set `after` to `{codename: text}`.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://docs.kontent.ai/link-to/references) to the object you want to add into.\n* To add an element to a content type, the reference must point to the content type you're changing.\n* To add an allowed content type to a rich text or linked items element, the reference must point to the specific element within the specified content type.\n* To add an allowed element to a custom element, the reference must point to the specific custom element within the specified content type.\n* To add an option to a multiple choice element, the reference must point to the specific multiple choice element within the specified content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "property_name": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nThe property into which you want to add a new object.\n* To add elements to a content type, the `property_name` must be `elements`.\n* To add an allowed content type to a rich text or linked items element, the `property_name` must be `allowed_content_types`.\n* To add an allowed element to a custom element, the `property_name` must be `allowed_elements`\n* To add an option to a multiple choice element, the `property_name` must be `options`.\n", + "example": "elements", + "enum": ["allowed_content_types", "allowed_elements", "elements", "options"], + "type": "string" + } }, - "example": "personas" - } - }, - "requestBodies": {}, - "responses": {}, - "schemas": { - "String": { - "type": "string" + "type": "object" }, - "StringArray": { - "items": { - "$ref": "#/components/schemas/String" + "TypeOperationRemove": { + "required": ["op"], + "properties": { + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "remove", + "enum": ["addInto", "replace", "remove"], + "type": "string" + }, + "path": { + "description": "A string identifying the specific object or property that should be removed. The exact path depends on what you are trying to remove. In each case, a `{path_reference}` is needed for the given object.\n\nTo remove given objects:\n* For an element, set `path` to: `/elements/{path_reference}`.\n* For an allowed content type from a rich text or linked items element, set `path` to: `/elements/{path_reference}/allowed_content_types/{path_reference}`, where the first {path_reference} is to the rich text or linked items element and the second is to the allowed content type to be removed.\n* For an allowed element from a custom element, set `path` to: `/elements/{path_reference}/allowed_element/{path_reference}`, where the first {path_reference} is to the custom element and the second is to the allowed element to be removed.\n* For a multiple choice option, set `path` to: `/elements/{path_reference}/options/{path_reference}`, where the first {path_reference} is to the multiple choice element and the second is to the option to be removed.\n* For a content group, set `path` to: `/content_groups/{path_reference}`. **Note**: This will also remove all elements contained within the content group.\n* For a rich-text element limitation, set `path` to: `/elements/{path_reference}/allowed_blocks/{block}`, where {block} is the given type of limitation you want to remove.\n", + "example": "/elements/codename:multiple_choice_element/options/external_id:option_1", + "writeOnly": true, + "type": "string" + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://developer.kenticocloud.com/reference#content-management-api-v2-reference-object) to the object that you want to remove.\n* To remove an element from the specified content type, the `reference` must point to the element you want to remove.\n* To remove an option from a multiple choice element, the `reference` must point to the specific multiple choice option within the specified content type.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } }, - "type": "array" + "type": "object" }, "Integer": { "format": "int32", @@ -1338,98 +6242,315 @@ "example": false, "type": "boolean" }, - "AssetInItem": { - "required": ["type", "name", "value"], + "TypeOperationReplace": { + "required": ["op", "value"], "properties": { - "type": { - "enum": ["asset"], + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "replace", + "enum": ["addInto", "replace", "remove"], "type": "string" }, - "name": { + "path": { + "description": "A string identifying what property should be replaced. The exact path depends on what you are trying to replace. If you are trying to add a property to a given object, a `{path_reference}` is needed for that object.\n* To change the content type's name, set `path` to: `/name`.\n* To change the content type's codename, set `path` to: `/codename`.\n* To change the name of a content group, set `path` to: `/content_groups/{path_reference}/name`.\n* To change a given property of an element, set `path` to: `/elements/{path_reference}/{property_name}`, where the available values for `property_name` will depend on the specific element you are referencing.\n* To change a property of a multiple choice option, set `path` to: `/elements/{path_reference}/options/{path_reference}`, where the first {path_reference} is to the multiple choice element and the second is to the option you want to modify.\n\nFor all elements (including multiple choice options), you can specify the properties to be modified based on the [element type](#tag/Elements-in-content-types). You cannot modify the `external_id`, `id`, or `type` of the elements. It is also not possible to replace individual values for an object (such as the value of a limitation object) – you need to replace the entire object at once. You also cannot replace the allowed blocks for rich text elements; you need to add or remove the blocks one by one.\n", + "example": "/elements/codename:cool_text/name", + "writeOnly": true, "type": "string" }, "value": { - "items": { - "required": ["name", "type", "size", "description", "url", "width", "height"], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "size": { - "format": "int32", - "type": "integer" - }, - "url": { - "type": "string" - }, - "width": { - "format": "int32", - "type": "integer" - }, - "height": { - "format": "int32", - "type": "integer" - } + "description": "The value to insert into the property specified in `path` where the format depends on the specific property.\n\n(Note that `value` can also be used together with the deprecated `property_name`).\n", + "example": "An element name", + "oneOf": [{ + "$ref": "#/components/schemas/Reference" + }, { + "$ref": "#/components/schemas/String" + }, { + "$ref": "#/components/schemas/Integer" + }, { + "$ref": "#/components/schemas/Boolean" + }, { + "$ref": "#/components/schemas/CountLimitation" + }, { + "$ref": "#/components/schemas/DependsOn" + }, { + "description": "A collection of [references](https://docs.kontent.ai/link-to/references) used for defining `allowed_content_types` in rich text and linked items elements and `allowed_elements` in custom elements.\n", + "example": [{ + "external_id": "state-of-product" + }, { + "id": "1df5b5b2-a19a-401d-a351-0f9bb612ea67" + }, { + "codename": "a_great_type" + }], + "items": { + "$ref": "#/components/schemas/Reference" }, - "type": "object" - }, - "type": "array" + "type": "array" + }] + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://docs.kontent.ai/link-to/references) to the object whose property you want to modify (replace its value).\n\nYou can reference the specified content type, any of its elements, or an option of a multiple choice element.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "property_name": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nThe property for which you want to replace the value.\n\nFor content types, you can specify the `name` and `codename` properties.\n\nFor elements, you can specify the following properties:\n* Asset – `allowed_file_types` (string), `asset_count_limit` (Count limitation object), `codename` (string), `guidelines` (string), `image_height_limit` (Count limitation object), `image_width_limit` (Count limitation object), `is_required` (boolean), `maximum_file_size` (integer), `name` (string)\n* Content type snippet – `snippet` ([reference](https://docs.kontent.ai/link-to/references) to a snippet)\n* Custom element – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string), `json_parameters` (string), `source_url` (string)\n* Date & Time – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string)\n* Guidelines – `guidelines` (string)\n* Linked items – `codename` (string), `guidelines` (string), `is_required` (boolean), `item_count_limit` (Count limitation object), `name` (string)\n* Multiple choice – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string), `mode` (string)\n* Multiple choice option – `codename` (string), `name` (string)\n* Number – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string)\n* Taxonomy – `codename` (string), `guidelines` (string), `is_required` (boolean), `taxonomy_group` ([reference](https://docs.kontent.ai/link-to/references) to a taxonomy group)\n* Text – `codename` (string), `guidelines` (string), `is_required` (boolean), `maximum_text_length` (integer), `name` (string)\n* Rich text – `allowed_image_types` (string), `codename` (string), `guidelines` (string), `is_required` (boolean), `image_height_limit` (Count limitation object), `image_width_limit` (Count limitation object), `maximum_image_size` (integer), `maximum_text_length` (integer), `name` (string)\n* URL slug – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string), `depends_on` (Depends on object)\n", + "example": "guidelines", + "deprecated": true, + "enum": ["name", "guidelines", "snippet", "json_parameters", "source_url", "mode", "taxonomy_group", "depends_on"], + "type": "string" } }, "type": "object" }, - "CustomElementInItem": { - "required": ["type", "name", "value"], + "ContentTypeSnippet": { + "description": "A content type snippet object\n", + "required": ["id", "name", "elements", "last_modified"], "properties": { - "type": { - "enum": ["custom"], + "id": { + "description": "Unique internal identifier of the content type snippet.\n", + "example": "baf884be-531f-441f-ae88-64205efdd0f6", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "codename": { + "description": "The content type snippet's codename. Unless set while [creating the content type snippet](https://docs.kontent.ai/link-to/add_a_content_type_snippet), it is [initially generated](#tag/References/rules-for-codenames) from the snippet's `name` and can later be [modified](https://docs.kontent.ai/link-to/modify_a_content_type_snippet).\n", + "example": "my_metadata", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date and time of the last content type snippet change.\n", + "example": "2019-10-20T12:03:17.4685693Z", + "readOnly": true, + "format": "date-time", "type": "string" }, "name": { + "description": "Display name of the content type snippet.\n", + "example": "My metadata", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "elements": { + "description": "Elements within the snippet.\n", + "example": "[\n {\n \"name\": \"Meta title\",\n \"guidelines\": \"Length: 30–60 characters\",\n \"type\": \"text\",\n \"id\": \"09398b24-61ed-512e-5b5c-affd54a098e5\",\n \"codename\": \"my_metadata__meta_title\"\n },\n {\n \"name\": \"Meta description\",\n \"guidelines\": \"Length: 70–150 characters\",\n \"type\": \"text\",\n \"id\": \"2e555cc1-1eae-520c-189e-28548904f529\",\n \"codename\": \"my_metadata__meta_description\"\n }\n ]", + "oneOf": [{ + "$ref": "#/components/schemas/AssetInType" + }, { + "$ref": "#/components/schemas/CustomElementInType" + }, { + "$ref": "#/components/schemas/DateTimeInType" + }, { + "$ref": "#/components/schemas/GuidelinesInType" + }, { + "$ref": "#/components/schemas/LinkedItemsInType" + }, { + "$ref": "#/components/schemas/MultipleChoiceInType" + }, { + "$ref": "#/components/schemas/NumberInType" + }, { + "$ref": "#/components/schemas/TaxonomyInType" + }, { + "$ref": "#/components/schemas/TextInType" + }, { + "$ref": "#/components/schemas/RichTextInType" + }] + }, + "external_id": { + "description": "The content type snippet's external ID. Only present if defined when [adding the snippet](https://docs.kontent.ai/link-to/add_a_content_type_snippet).\n", + "example": "my-valuable-metadata", + "type": "string" + } + }, + "type": "object" + }, + "SnippetOperationAddInto": { + "required": ["op", "value"], + "properties": { + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "addInto", + "enum": ["addInto", "remove", "replace"], + "type": "string" + }, + "path": { + "description": "A string identifying where the new object or property should be added. The exact path depends on what you are trying to add and where. If you are trying to add a property to a given element, a `{path_reference}` is needed for that element.\n1. To add a new element, set `path` to: `/elements`.\n2. To add an allowed content type to a rich text or linked items element, set `path` to: `/elements/{path_reference}/allowed_content_types`.\n3. To add an allowed element to a custom element, set `path` to: `/elements/{path_reference}/allowed_elements`.\n4. To add a new multiple choice option, set `path` to: `/elements/{path_reference}/options`.\n", + "example": "/elements/codename:snippet_codename__rich_text/allowed_content_types", + "writeOnly": true, "type": "string" }, "value": { - "nullable": true, + "description": "The object to add. The value depends on the selected `path`:\n1. To add a new element, use a content element object.\n2. To add an allowed content type to a rich text or linked items element, use a [reference](https://docs.kontent.ai/link-to/references) object that points to a specific content type.\n3. To add an allowed element to a custom element, use a [reference](https://docs.kontent.ai/link-to/references) object that points to the specific element with this content type snippet.\n4. To add an option to a multiple choice element, use an option object.\n\nNote: You cannot add a URL slug element or another content type snippet as new objects.\n\n(Note that `value` can also be used together with the deprecated `property_name`).\n", + "oneOf": [{ + "$ref": "#/components/schemas/AssetInType" + }, { + "$ref": "#/components/schemas/CustomElementInType" + }, { + "$ref": "#/components/schemas/DateTimeInType" + }, { + "$ref": "#/components/schemas/GuidelinesInType" + }, { + "$ref": "#/components/schemas/LinkedItemsInType" + }, { + "$ref": "#/components/schemas/MultipleChoiceInType" + }, { + "$ref": "#/components/schemas/MultipleChoiceOption" + }, { + "$ref": "#/components/schemas/NumberInType" + }, { + "$ref": "#/components/schemas/RichTextInType" + }, { + "$ref": "#/components/schemas/TaxonomyInType" + }, { + "$ref": "#/components/schemas/TextInType" + }] + }, + "before": { + "description": "An *optional* [reference to the object](https://docs.kontent.ai/link-to/references) before which you want to add the new object.\n\nFor example, to add a content element or option before an existing element or option named \"Text\", you can set `before` to `{\"codename\": \"snippet_codename__text\"}`.\n\n**Note**: The `before` and `after` parameters are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "after": { + "description": "An *optional* [reference to the object](https://docs.kontent.ai/link-to/references) after which you want to add the new object.\n\nFor example, to add a content element or option after an existing element or option named \"Text\", you can set `after` to `{\"codename\": \"snippet_codename__text\"}`.\n\n**Note**: The `before` and `after` parameters are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://docs.kontent.ai/link-to/references) to the object you want to add into.\n* To add an element to a content type snippet, the reference must point to the content type snippet you're changing.\n* To add an allowed content type to a rich text or linked items element, the reference must point to the specific element within the specified content type snippet.\n* To add an allowed element to a custom element, the reference must point to the specific custom element within the specified content type snippet.\n* To add an option to a multiple choice element, the reference must point to the specific multiple choice element within the specified content type snippet.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "property_name": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nThe property into which you want to add a new object.\n* To add elements to a content type, the `property_name` must be `elements`.\n* To add an allowed content type to a rich text or linked items element, the `property_name` must be `allowed_content_types`.\n* To add an allowed element to a custom element, the `property_name` must be `allowed_elements`.\n* To add an option to a multiple choice element, the `property_name` must be `options`.\n", + "example": "elements", + "deprecated": true, + "enum": ["elements", "options"], "type": "string" } }, "type": "object" }, - "DateTimeInItem": { - "required": ["type", "name", "value"], + "SnippetOperationRemove": { + "required": ["op"], "properties": { - "type": { - "enum": ["date_time"], + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "remove", + "enum": ["addInto", "remove", "replace"], "type": "string" }, - "name": { + "path": { + "description": "A string identifying the specific object or property that should be removed. The exact path depends on what you are trying to remove. In each case, a `{path_reference}` is needed for the given object.\n\nTo remove given objects:\n* For an element, set `path` to: `/elements/{path_reference}`.\n* For an allowed content type from a rich text or linked items element, set `path` to: `/elements/{path_reference}/allowed_content_types/{path_reference}`, where the first {path_reference} is to the rich text or linked items element and the second is to the allowed content type to be removed.\n* For an allowed element from a custom element, set `path` to: `/elements/{path_reference}/allowed_element/{path_reference}`, where the first {path_reference} is to the custom element and the second is to the allowed element to be removed.\n* For a multiple choice option, set `path` to: `/elements/{path_reference}/options/{path_reference}`, where the first {path_reference} is to the multiple choice element and the second is to the option to be removed.\n", + "example": "/elements/codename:multiple_choice_element/options/external_id:option_1", + "writeOnly": true, + "type": "string" + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://developer.kenticocloud.com/reference#content-management-api-v2-reference-object) to the object that you want to remove.\n* To remove an element from the specified content type, the reference must point to the element you want to remove.\n* To remove an option from a multiple choice element, the reference must point to the specific multiple choice option within the specified content type.\n\n**Note**: You cannot remove a text element used in a URL slug element.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "SnippetOperationReplace": { + "required": ["op", "value"], + "properties": { + "op": { + "description": "Defines the operation to perform. You can use: `addInto` to add new objects, `remove` to delete objects, or `replace` to modify specific properties.\n", + "example": "replace", + "enum": ["addInto", "remove", "replace"], + "type": "string" + }, + "path": { + "description": "A string identifying what property should be replaced. The exact path depends on what you are trying to replace. If you are trying to add a property to a given object, a `{path_reference}` is needed for that object.\n* To change the content type snippet's name, set `path` to: `/name`.\n* To change the content type snippet's codename, set `path` to: `/codename`.\n* To change a given property of an element, set `path` to: `/elements/{path_reference}/{property_name}`, where the available values for `property_name` will depend on the specific element you are referencing.\n* To change a property of a multiple choice option, set `path` to: `/elements/{path_reference}/options/{path_reference}`, where the first {path_reference} is to the multiple choice element and the second is to the option you want to modify.\n\nFor all elements (including multiple choice options), you can specify the properties to be modified based on the [element type](#tag/Elements-in-content-types). You cannot modify the `external_id`, `id`, or `type` of the elements. It is also not possible to replace individual values for an object (such as the value of a limitation object) – you need to replace the entire object at once. You also cannot replace the allowed blocks for rich text elements; you need to add or remove the blocks one by one.\n\nFor content type snippets, you cannot modify content type snippet or URL slug elements.\n", + "writeOnly": true, "type": "string" }, "value": { - "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted string\n", - "nullable": true, - "format": "date-time", + "description": "The value to insert into the property specified in `path` where the format depends on the specific property.\n\n(Note that `value` can also be used together with the deprecated `property_name`).\n", + "oneOf": [{ + "$ref": "#/components/schemas/Reference" + }, { + "$ref": "#/components/schemas/String" + }, { + "$ref": "#/components/schemas/Boolean" + }, { + "$ref": "#/components/schemas/Integer" + }, { + "$ref": "#/components/schemas/CountLimitation" + }, { + "description": "A collection of [references](https://docs.kontent.ai/link-to/references) used for defining `allowed_content_types` in rich text and linked items elements and `allowed_elements` in custom elements.\n", + "example": [{ + "external_id": "state-of-product" + }, { + "id": "1df5b5b2-a19a-401d-a351-0f9bb612ea67" + }, { + "codename": "a_great_type" + }], + "items": { + "$ref": "#/components/schemas/Reference" + }, + "type": "array" + }] + }, + "reference": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nA [reference](https://docs.kontent.ai/link-to/references) to the object whose property you want to modify (replace its value).\n\nYou can reference the specified content type snippet, any of its elements, or an option of a multiple choice element.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "property_name": { + "description": "\n\n

      This property is deprecated in favor of the path property.

      \n\n\n\nThe property for which you want to replace the value.\n\nFor elements, you can specify the following properties:\n* Asset – `allowed_file_types` (string), `asset_count_limit` (Count limitation object), `codename` (string), `guidelines` (string), `image_height_limit` (Count limitation object), `image_width_limit` (Count limitation object), `is_required` (boolean), `maximum_file_size` (integer), `name` (string)\n* Custom element – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string), `json_parameters` (string), `source_url` (string)\n* Date & Time – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string)\n* Guidelines – `guidelines` (string)\n* Linked items – `codename` (string), `guidelines` (string), `is_required` (boolean), `item_count_limit` (Count limitation object), `name` (string)\n* Multiple choice – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string), `mode` (string)\n* Multiple choice option – `codename` (string), `name` (string)\n* Number – `codename` (string), `guidelines` (string), `is_required` (boolean), `name` (string)\n* Taxonomy – `codename` (string), `guidelines` (string), `is_required` (boolean), `taxonomy_group` ([reference](https://docs.kontent.ai/link-to/references) to a taxonomy group)\n* Text – `codename` (string), `guidelines` (string), `is_required` (boolean), `maximum_text_length` (Length limitation object), `name` (string)\n* Rich text – `allowed_image_types` (string), `codename` (string), `guidelines` (string), `is_required` (boolean), `image_height_limit` (Count limitation object), `image_width_limit` (Count limitation object), `maximum_image_size` (integer), `maximum_text_length` (Length limitation object), `name` (string)\n", + "example": "guidelines", + "deprecated": true, "type": "string" } }, "type": "object" }, - "LinkedItemsInItem": { - "required": ["type", "name", "value"], + "TaxonomyTerm": { + "description": "The taxonomy term object contains metadata about a single taxonomy term and a collection of its descendant taxonomy terms.\n", + "required": ["name", "terms"], "properties": { - "type": { - "enum": ["modular_content"], + "codename": { + "description": "The taxonomy term's codename. Unless you set it (such as while [creating a taxonomy group](https://docs.kontent.ai/link-to/add_a_taxonomy_group)), it is initially generated from the term's `name` and can later be [modified](https://docs.kontent.ai/link-to/modify_a_taxonomy_group).\n", + "example": "barista", + "minLength": 1, + "maxLength": 210, + "type": "string" + }, + "external_id": { + "description": "The taxonomy term's [external ID](https://docs.kontent.ai/link-to/references).\n", + "example": "barista-term", + "type": "string" + }, + "id": { + "description": "The taxonomy term's internal ID.\n", + "example": "e3c04146-f5a6-49b0-ba5b-e040d126fb3a", + "readOnly": true, + "format": "uuid", "type": "string" }, "name": { + "description": "The taxonomy term's display name.\n", + "example": "Barista", + "minLength": 1, + "maxLength": 200, "type": "string" }, - "value": { + "terms": { + "description": "Any terms nested within this term.\n\n**Note**: The number of terms is limited to 1000.\n", "items": { - "$ref": "#/components/schemas/String" + "$ref": "#/components/schemas/TaxonomyTerm" }, "uniqueItems": true, "type": "array" @@ -1437,469 +6558,859 @@ }, "type": "object" }, - "NumberInItem": { - "required": ["type", "name", "value"], + "TaxonomyGroup": { + "description": "The taxonomy group object contains all information about your taxonomy group, such as its metadata and a collection of its taxonomy terms.\n", + "required": ["name", "terms"], "properties": { - "type": { - "enum": ["number"], + "codename": { + "description": "The taxonomy group's codename. Unless set while [creating a taxonomy group](https://docs.kontent.ai/link-to/add_a_taxonomy_group), it is [initially generated](#tag/References/rules-for-codenames) from the group's `name` and can later be [modified](https://docs.kontent.ai/link-to/modify_a_taxonomy_group).\n", + "example": "personas", + "minLength": 1, + "maxLength": 60, + "type": "string" + }, + "external_id": { + "description": "The taxonomy group's [external ID](https://docs.kontent.ai/link-to/references). **Note**: Only present if specified when [creating the taxonomy group](https://docs.kontent.ai/link-to/add_a_taxonomy_group) via API.\n", + "example": "my-little-taxopony", + "type": "string" + }, + "id": { + "description": "The taxonomy group's internal ID.\n", + "example": "bef9dd62-a3b8-4146-83e4-33be707899b4", + "readOnly": true, + "format": "uuid", + "type": "string" + }, + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date/time of the last change to the taxonomy group or its terms.\n", + "example": "2018-11-14T14:05:43.9190528Z", + "readOnly": true, + "format": "date-time", "type": "string" }, "name": { + "description": "The taxonomy group's display name.\n", + "example": "Personas", + "minLength": 1, + "maxLength": 50, + "type": "string" + }, + "terms": { + "description": "All terms in the taxonomy group. **Note**: The number of terms is limited to 1000.\n", + "items": { + "$ref": "#/components/schemas/TaxonomyTerm" + }, + "type": "array" + } + }, + "type": "object" + }, + "TaxonomyOperationAddInto": { + "required": ["op", "value"], + "properties": { + "op": { + "description": "Specifies the operation to perform.\n* `replace` to modify taxonomy groups or terms\n* `remove` to delete taxonomy terms\n* `addInto` to add new taxonomy terms\n", + "example": "addInto", + "enum": ["addInto", "remove", "replace"], "type": "string" }, + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to existing taxonomy terms to which the new terms will be added.\n\nNot required if you are adding the terms only to the group specified in the `taxonomy_group_identifier`.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, "value": { - "nullable": true, - "format": "float", - "type": "number" + "description": "The taxonomy term object you want to add.\n", + "allOf": [{ + "$ref": "#/components/schemas/TaxonomyTerm" + }] + }, + "after": { + "description": "An *optional* [reference](https://docs.kontent.ai/link-to/references) to the taxonomy term after which you want to add the new taxonomy term.\n\nFor example, to add a term after the existing \"Personas\" term , you can set `after` to `{codename: personas}`.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "before": { + "description": "An *optional* [reference](https://docs.kontent.ai/link-to/references) to the taxonomy term before which you want to add the new taxonomy term.\n\nFor example, to add a term before the existing \"Personas\" term, you can set `before` to `{codename: personas}`.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "TaxonomyOperationRemove": { + "required": ["op", "reference"], + "properties": { + "op": { + "description": "Specifies the operation to perform.\n* `replace` to modify taxonomy groups or terms\n* `remove` to delete taxonomy terms\n* `addInto` to add new taxonomy terms\n", + "enum": ["addInto", "remove", "replace"], + "type": "string" + }, + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the existing taxonomy term that you want to delete.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + } + }, + "type": "object" + }, + "TaxonomyOperationReplace": { + "required": ["op", "property_name", "value"], + "properties": { + "op": { + "description": "Specifies the operation to perform.\n* `replace` to modify taxonomy groups or terms\n* `remove` to delete taxonomy terms\n* `addInto` to add new taxonomy terms\n", + "example": "replace", + "enum": ["addInto", "remove", "replace"], + "type": "string" + }, + "property_name": { + "description": "Specifies the property of the taxonomy group or term that you want to replace.\n\nThe value of `property_name` can be one of the following:\n* Use `codename` to change the codename of the group or terms.\n* Use `name` to change the name of the group or terms.\n* Use `terms` to change the descendant taxonomy terms of the group of term.\n", + "enum": ["name", "terms"], + "type": "string" + }, + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to existing taxonomy terms you want to modify.\n\nNot required if you want to modify the taxonomy group specified in the `taxonomy_group_identifier`.\n", + "allOf": [{ + "$ref": "#/components/schemas/Reference" + }] + }, + "value": { + "description": "Based on the value of `property_name`, the `value` can be either string or an array of taxonomy terms:\n* For a `property_name` of `name` or `codename`, the `value` is  a string.\n* For a `property_name` of `terms`, the `value` is  an array of taxonomy term objects.\n", + "oneOf": [{ + "minLength": 1, + "maxLength": 200, + "type": "string" + }, { + "description": "An array of taxonomy terms\n", + "items": { + "$ref": "#/components/schemas/TaxonomyTerm" + }, + "uniqueItems": true, + "type": "array" + }] } }, "type": "object" }, - "image": { - "description": "Each object in the images collection represents an image id, e.g., `14mio`.\n", - "required": ["image_id", "description", "url", "width", "height"], + "FileReference": { + "description": "Points to a specific binary file uploaded to your project.\n", + "required": ["id", "type"], "properties": { - "image_id": { + "id": { + "description": "The binary file's internal ID.\n", + "format": "uuid", + "type": "string" + }, + "type": { + "description": "The type of the file reference.\n", + "enum": ["internal"], "type": "string" + } + }, + "type": "object" + }, + "AssetDescription": { + "description": "An asset description defines a description of an asset for a single [language](https://docs.kontent.ai/link-to/languages).\n", + "required": ["language", "description"], + "properties": { + "language": { + "$ref": "#/components/schemas/Reference" }, "description": { - "description": "Used for the alt attribute of an tag.\n", + "description": "Description of the asset for a single language.\n", + "type": "string" + } + }, + "type": "object" + }, + "Asset": { + "description": "A single asset object.\n", + "required": ["descriptions", "file_name", "file_reference", "id", "image_height", "image_width", "last_modified", "size", "title", "type", "url"], + "properties": { + "descriptions": { + "description": "The asset's description for each active language.\n", + "example": [{ + "language": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "description": "Alt text in default language for the asset." + }], + "items": { + "$ref": "#/components/schemas/AssetDescription" + }, + "uniqueItems": true, + "type": "array" + }, + "external_id": { + "description": "The asset's external ID. The external ID can be specified when [adding assets](https://docs.kontent.ai/link-to/add_an_asset) (POST `/assets`) or [upserting assets](https://docs.kontent.ai/link-to/upsert_an_asset) (PUT `/assets/external-id/`). If not specified, the `external_id` property is not present.\n", + "example": "which-brewing-fits-you", "type": "string" }, - "url": { - "description": "Absolute URL for the image\n", + "file_name": { + "description": "The file's name.\n\n**Note**: Determined by the file referenced in the `file_reference` property.\n", + "example": "which-brewing-fits-you-1080px.jpg", + "readOnly": true, + "type": "string" + }, + "file_reference": { + "$ref": "#/components/schemas/FileReference" + }, + "folder": { + "description": "A [reference](https://docs.kontent.ai/link-to/references) to the folder containing the asset. Not present if the asset is not in a folder.\n", + "example": { + "id": "8fe4ff47-0ca8-449d-bc63-c280efee44ea" + }, + "required": ["id"], + "properties": { + "id": { + "description": "The referenced folder's ID.\n", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The asset's internal ID.\n", + "example": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "readOnly": true, + "format": "uuid", "type": "string" }, - "width": { + "image_height": { + "description": "The image's height in pixels. Is `null` if the file is not an image.\n\n**Note**: Determined by the file referenced in the `file_reference` property.\n", + "example": 666, + "nullable": true, + "readOnly": true, + "format": "int32", + "type": "integer" + }, + "image_width": { + "description": "The image's width in pixels. Is `null` if the file is not an image.\n\n**Note**: Determined by the file referenced in the `file_reference` property.\n", + "example": 1000, + "nullable": true, + "readOnly": true, "format": "int32", "type": "integer" }, - "height": { + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date and time of the last change to the asset.\n", + "example": "2019-09-12T08:29:36.1645977Z", + "readOnly": true, + "format": "date-time", + "type": "string" + }, + "size": { + "description": "The file's size in bytes.\n\n**Note**: Determined by the file referenced in the `file_reference` property.\n", + "example": 125770, + "readOnly": true, "format": "int32", "type": "integer" + }, + "title": { + "description": "The asset's display name. The title can be specified when [adding assets](https://docs.kontent.ai/link-to/add_an_asset), [updating or upserting assets](https://docs.kontent.ai/link-to/upsert_an_asset). If not specified, the `title ` property is `null`.\n", + "example": "Coffee brewing techniques", + "nullable": true, + "type": "string" + }, + "type": { + "description": "The file's [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).\n\n**Note**: Determined by the file referenced in the `file_reference` property.\n", + "example": "image/jpeg", + "readOnly": true, + "type": "string" + }, + "url": { + "description": "The asset's URL.\n", + "example": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "ReferenceWithoutCodename": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to a specific object in the project.\n", + "properties": { + "id": { + "description": "The referenced object's internal ID.\n", + "example": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53", + "format": "uuid", + "type": "string" + }, + "external_id": { + "description": "The referenced object's external ID.\n", + "example": "your-own-custom-identifier", + "writeOnly": true, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, + "UpdateAsset": { + "description": "The asset to update.\n", + "example": { + "title": "Coffee Brewing Techniques", + "folder": { + "external_id": "another-folder" + }, + "descriptions": [{ + "language": { + "codename": "en-US" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "codename": "es-ES" + }, + "description": "Técnicas para hacer café" + }] + }, + "required": ["descriptions"], + "properties": { + "descriptions": { + "description": "Asset descriptions for each active language.\n", + "items": { + "$ref": "#/components/schemas/AssetDescription" + }, + "type": "array" + }, + "folder": { + "description": "A reference to the folder the asset should be placed in. To return an asset to the top level outside any folders, use `\"id\" : \"00000000-0000-0000-0000-000000000000\"`.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] + }, + "title": { + "description": "The title of the new asset. Use this parameter to better identify and filter your assets in the UI.\n", + "example": "Coffee Brewing Techniques", + "minLength": 1, + "maxLength": 50, + "type": "string" } }, "type": "object" }, - "RichTextLink": { - "description": "The name of the object represents a content item ID, such as `f4b3fc05-e988-4dae-9ac1-a94aba566474`.\n", - "required": ["type", "codename", "url_slug"], + "CreateAsset": { + "description": "The asset to create.\n", + "example": { + "file_reference": { + "id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", + "type": "internal" + }, + "title": "Coffee Brewing Techniques", + "folder": { + "external_id": "another-folder" + }, + "descriptions": [{ + "language": { + "codename": "en-US" + }, + "description": "Coffee Brewing Techniques" + }, { + "language": { + "codename": "es-ES" + }, + "description": "Técnicas para hacer café" + }] + }, + "allOf": [{ + "$ref": "#/components/schemas/UpdateAsset" + }, { + "required": ["file_reference"], + "properties": { + "file_reference": { + "$ref": "#/components/schemas/FileReference" + } + }, + "type": "object" + }] + }, + "AssetFolder": { + "required": ["folders", "id", "name"], "properties": { - "type": { - "description": "Content type of the content item\n", + "external_id": { + "description": "The folder's [external ID](https://docs.kontent.ai/link-to/references). Only present if specified when [adding folders](https://docs.kontent.ai/link-to/add_assets_folders) or [modifying the folders collection to add new folders](https://docs.kontent.ai/link-to/modify_asset_folders).\n", + "example": "cafe-locations", "type": "string" }, - "codename": { - "description": "Codename of the content item\n", + "folders": { + "description": "Any folders contained within the given folder.\n", + "example": [{ + "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0", + "name": "Level 2", + "folders": [] + }], + "items": { + "$ref": "#/components/schemas/AssetFolder" + }, + "type": "array" + }, + "id": { + "description": "The folder's internal ID.\n", + "example": "958001d8-2228-4373-b966-5262b5b96f71", + "readOnly": true, "type": "string" }, - "url_slug": { - "description": "URL slug of the content item. If the item doesn't use a URL slug element, value of `url_slug` is empty string.\n", + "name": { + "description": "The folder's name.\n", + "example": "Café locations", + "minLength": 1, + "maxLength": 200, "type": "string" } }, "type": "object" }, - "RichTextInItem": { - "required": ["type", "name", "images", "links", "modular_content", "value"], + "AssetFolders": { + "description": "All folders within a project.\n", + "example": { + "last_modified": "2019-11-07T09:25:44.0680996Z", + "folders": [{ + "id": "958001d8-2228-4373-b966-5262b5b96f71", + "name": "Top level folder", + "external_id": "top-folder", + "folders": [{ + "id": "9ca927b6-6e4d-4d6b-81e3-ec5e8f7772a0", + "name": "Second level folder", + "external_id": "second-folder", + "folders": [] + }] + }] + }, + "required": ["folders", "last_modified"], "properties": { - "type": { - "enum": ["rich_text"], - "type": "string" - }, - "name": { - "example": "Description", - "type": "string" - }, - "images": { - "description": "Each object in the images collection represents an image id, e.g., `14mio`.\n", - "additionalProperties": { - "$ref": "#/components/schemas/image" - }, - "type": "object" - }, - "links": { - "description": "Contains metadata for each link to a content item\n", - "additionalProperties": { - "$ref": "#/components/schemas/RichTextLink" - }, - "type": "object" - }, - "modular_content": { + "folders": { "items": { - "$ref": "#/components/schemas/String" + "$ref": "#/components/schemas/AssetFolder" }, - "uniqueItems": true, "type": "array" }, - "value": { - "description": "If the element does not contain any text, its value defaults to a single empty paragraph: `


      `.\n", + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date/time of the last change to the folder.\n", + "example": "2019-08-08T08:16:24.3620957Z", + "readOnly": true, + "format": "date-time", "type": "string" } }, "type": "object" }, - "TaxonomyInItem": { - "required": ["type", "name", "taxonomy_group", "value"], - "properties": { - "type": { - "enum": ["taxonomy"], - "type": "string" + "AddInto": { + "description": "To add new folders.\n", + "example": { + "op": "addinto", + "value": { + "external_id": "another-folder", + "name": "Another second level folder", + "folders": [] }, - "name": { - "type": "string" + "reference": { + "external_id": "top-folder" }, - "taxonomy_group": { + "after": { + "external_id": "second-folder" + } + }, + "required": ["op", "value"], + "properties": { + "op": { + "description": "Specifies the operation to perform.\n* `addInto` to add new folders\n* `remove` to delete folders\n* `rename` to rename folders\n", + "example": "addInto", + "writeOnly": true, + "enum": ["addInto"], "type": "string" }, + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the existing folder to which the new folders will be added.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] + }, "value": { - "items": { - "required": ["name", "codename"], - "properties": { - "name": { - "type": "string" - }, - "codename": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" + "description": "The folder object you want to add.\n", + "allOf": [{ + "$ref": "#/components/schemas/AssetFolder" + }] + }, + "after": { + "description": "An *optional* [reference](https://docs.kontent.ai/link-to/references) to the existing folder after which you want to add the new folder.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] + }, + "before": { + "description": "An *optional* [reference](https://docs.kontent.ai/link-to/references) to the existing folder before which you want to add the new folder.\n\n**Note**: The `before` and `after` properties are mutually exclusive.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] } }, "type": "object" }, - "Text": { - "required": ["type", "name", "value"], + "Remove": { + "description": "To delete a folder.\n", + "example": { + "op": "remove", + "reference": { + "external_id": "extra-folder" + } + }, + "required": ["op", "reference"], "properties": { - "type": { - "enum": ["text"], - "type": "string" - }, - "name": { - "description": "Display name of the element\n", - "example": "Meta keywords", + "op": { + "description": "Specifies the operation to perform.\n* `addInto` to add new folders\n* `remove` to delete folders\n* `rename` to rename folders\n", + "example": "remove", + "enum": ["remove"], "type": "string" }, - "value": { - "nullable": true, - "type": "string" + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the folder to be deleted.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] } }, "type": "object" }, - "UrlSlugInItem": { - "required": ["type", "name", "value"], + "Rename": { + "description": "To rename a folder.\n", + "example": { + "op": "rename", + "value": "A new name", + "reference": { + "external_id": "second-folder" + } + }, + "required": ["op", "reference", "value"], "properties": { - "type": { - "enum": ["url_slug"], + "op": { + "description": "Specifies the operation to perform.\n* `addInto` to add new folders\n* `remove` to delete folders\n* `rename` to rename folders\n", + "example": "remove", + "enum": ["rename"], "type": "string" }, - "name": { - "type": "string" + "reference": { + "description": "[Reference](https://docs.kontent.ai/link-to/references) to the folder to be renamed.\n", + "allOf": [{ + "$ref": "#/components/schemas/ReferenceWithoutCodename" + }] }, "value": { + "description": "The new name for the folder.\n", + "example": "A new name", + "minLength": 1, + "maxLength": 250, "type": "string" } }, "type": "object" }, - "ContentItem": { - "description": "The content item with metadata and individual elements.\n", - "required": ["system", "elements"], + "Project": { + "description": "The `project` object contains the project ID and display name.\n", + "required": ["id", "name"], "properties": { - "system": { - "description": "System properties of the content item.\n", - "required": ["id", "name", "codename", "language", "type", "sitemap_locations", "last_modified"], - "properties": { - "id": { - "description": "Unique identifier of the content item.\n", - "example": "f4b3fc05-e988-4dae-9ac1-a94aba566474", - "format": "uuid", - "type": "string" - }, - "name": { - "description": "Display name of the content item.\n", - "example": "On Roasts", - "type": "string" - }, - "codename": { - "description": "Codename of the content item. By default, generated from the content item's display `name`.\n", - "example": "on_roasts", - "type": "string" - }, - "language": { - "description": "Codename of the language that the content is in. For details on retrieving content in different languages, see [Getting localized content](https://docs.kontent.ai/link-to/getting_localized_content).\n", - "example": "en-US", - "type": "string" - }, - "type": { - "description": "Codename of the content type.\n", - "example": "article", - "type": "string" - }, - "sitemap_locations": { - "description": "A list of sitemap locations that the content item is in.\n\n\n\n

      Deprecation notice

      \n

      Sitemap has been deprecated since April 2019. The sitemap_locations property is a legacy property.

      \n\n\n", - "items": { - "$ref": "#/components/schemas/String" - }, - "type": "array" - }, - "last_modified": { - "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date/time of last change to user-content of a content item.\n\n**Note**: Moving content items through workflow doesn't affect the `last_modified` value.\n", - "example": "2019-03-27T13:21:11.38Z", - "format": "date-time", - "type": "string" - } - }, - "type": "object" + "id": { + "description": "The ID of the project.\n", + "example": "975bf280-fd91-488c-994c-2f04416e5ee3", + "format": "uuid", + "type": "string" }, - "elements": { - "description": "[Content elements](https://docs.kontent.ai/link-to/content_elements) in the content item.\n\n**Note**: The order of the element objects might not match the content element order in the UI.\n", - "additionalProperties": { - "oneOf": [{ - "$ref": "#/components/schemas/AssetInItem" - }, { - "$ref": "#/components/schemas/CustomElementInItem" - }, { - "$ref": "#/components/schemas/DateTimeInItem" - }, { - "$ref": "#/components/schemas/LinkedItemsInItem" - }, { - "$ref": "#/components/schemas/NumberInItem" - }, { - "$ref": "#/components/schemas/RichTextInItem" - }, { - "$ref": "#/components/schemas/TaxonomyInItem" - }, { - "$ref": "#/components/schemas/Text" - }, { - "$ref": "#/components/schemas/UrlSlugInItem" - }], - "x-additionalPropertiesName": "" - }, - "type": "object" + "name": { + "description": "The display name of the project.\n", + "example": "Sample project", + "type": "string" } }, "type": "object" }, - "Pagination": { - "description": "Information about the current page of results\n", - "required": ["skip", "limit", "count", "next_page"], + "Metadata": { + "description": "Information about the given object.\n", + "required": ["id", "name", "codename"], "properties": { - "skip": { - "description": "The number of objects skipped from the response. Reflects the value specified by the `skip` query parameter.\n", - "example": 10, - "format": "int32", - "default": 0, - "type": "integer" - }, - "limit": { - "description": "The number of objects returned in the response. Reflects the value specified by the `limit` query parameter.\n", - "example": 10, - "format": "int32", - "type": "integer" + "id": { + "description": "The ID of the given object.\n", + "type": "string" }, - "count": { - "description": "The number of retrieved objects.\n\n**Note**: If the `limit` and `skip` query parameters are not specified, the `count}~ property reflects the total number of objects in the project.\n", - "example": 10, - "format": "int32", - "type": "integer" + "name": { + "description": "The display name of the given object.\n", + "type": "string" }, - "next_page": { - "description": "A URL to the next page of results.\n", + "codename": { + "description": "The codename of the given object.\n", "type": "string" } }, "type": "object" }, - "Error": { - "description": "Error response\n", - "required": ["message", "request_id", "error_code", "specific_code"], - "properties": { - "message": { - "description": "An explanation of why the error occurred.\n", - "type": "string" - }, - "request_id": { - "description": "ID of the performed request.\n", - "type": "string" + "ElementIssue": { + "description": "For each issue found in a specific language variant or content type, the `issues` array will contain a content element issue with metadata about the content element and an array of validation messages describing the problem.\n\nA note on terminology in messages: A \"content module\" is a content item referenced in *Linked items* or *Rich text* elements. See [Linked content and components](https://docs.kontent.ai/link-to/linked_content_and_components) for more details.\n", + "example": { + "element": { + "id": "23375e4a-2ed8-42bf-aa3a-dfb32e6a42ec", + "name": "Body copy", + "codename": "content" }, - "error_code": { - "description": "Code of the returned error.\n", - "format": "int32", - "minimum": 100, - "maximum": 500, - "type": "integer" + "messages": ["Element 'Body copy' contains an image 'Screenshot.png' that doesn't match the set limits: maximum width = 1280px."] + }, + "required": ["element", "messages"], + "properties": { + "element": { + "$ref": "#/components/schemas/Metadata" }, - "specific_code": { - "format": "int32", - "type": "integer" + "messages": { + "description": "Validation messages for the content element.\n\nA note on terminology in messages: A \"content module\" is a content item referenced in the *Linked items* or *Rich text* elements. See [Linked content and components](https://docs.kontent.ai/link-to/linked_content_and_components) for more details.\n", + "items": { + "type": "string" + }, + "type": "array" } }, "type": "object" }, - "MultipleChoiceInItem": { - "required": ["type", "name", "value"], - "properties": { - "type": { - "enum": ["multiple_choice"], - "type": "string" + "ProjectReport": { + "description": "A project validity report contains a list of issues found in language variants of all content items. The issues can indicate that either certain content elements reference non-existing objects or contain values that do not meet the limitations set by a content type.\n", + "example": { + "project": { + "id": "975bf280-fd91-488c-994c-2f04416e5ee3", + "name": "Sample Project" }, - "name": { - "type": "string" + "variant_issues": [{ + "item": { + "id": "b2fea94c-73fd-42ec-a22f-f409878de187", + "name": "Origins of Arabica Bourbon", + "codename": "origins_of_arabica_bourbon" + }, + "language": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "English (United States)", + "codename": "en-US" + }, + "issues": [{ + "element": { + "id": "ee7c3687-b469-6c56-3ac6-c8dfdc8b58b5", + "name": "Related articles", + "codename": "related_articles" + }, + "messages": ["Element 'Related articles' contains a content module Colombia Carlos Imbachi of type Coffee that is not allowed in this context."] + }] + }, { + "item": { + "id": "cf106f4e-30a4-42ef-b313-b8ea3fd3e5c5", + "name": "Coffee Beverages Explained", + "codename": "coffee_beverages_explained" + }, + "language": { + "id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8", + "name": "Spanish (Spain)", + "codename": "es-ES" + }, + "issues": [{ + "element": { + "id": "ee7c3687-b469-6c56-3ac6-c8dfdc8b58b5", + "name": "Related articles", + "codename": "related_articles" + }, + "messages": ["Element 'Related articles' is required but has no value", "Element 'Related articles' should have at least 1 content module(s) but has 0 content module(s)."] + }, { + "element": { + "id": "b9dc537c-2518-e4f5-8325-ce4fce26171e", + "name": "Meta description", + "codename": "meta_description" + }, + "messages": ["Element 'Meta description' should have at most 160 characters(s) but has 174 character(s)."] + }] + }], + "type_issues": [{ + "type": { + "id": "929985ac-4aa5-436b-85a2-94c2d4fbbebd", + "name": "Coffee", + "codename": "coffee" + }, + "issues": [{ + "element": { + "id": "1ee64175-fde7-fc1e-5259-511a31c326c3", + "name": "Product status", + "codename": "product_status" + }, + "messages": ["Element 'Product status' contains references to non-existing taxonomy group with ID 79b1c5b6-30bc-d076-a236-d9ec9f1ff01b."] + }] + }] + }, + "required": ["project", "variant_issues", "type_issues"], + "properties": { + "project": { + "$ref": "#/components/schemas/Project" }, - "value": { + "variant_issues": { + "description": "Report of the problems found in the project's content.\n", "items": { - "required": ["name", "codename"], + "description": "The `variant_issues` attribute is an array of issues found in the content of the project. Each variant issue object contains information necessary to identify the language variant (content item and project language metadata) and lists the content elements.\n", + "required": ["item", "language", "issues"], "properties": { - "name": { - "description": "Name of the multiple choice option\n", - "example": "option value", - "type": "string" + "item": { + "$ref": "#/components/schemas/Metadata" + }, + "language": { + "$ref": "#/components/schemas/Metadata" }, - "codename": { - "description": "Codename of the multiple choice option\n", - "example": "option_value", - "type": "string" + "issues": { + "description": "Information about issues found in specific content elements.\n", + "items": { + "$ref": "#/components/schemas/ElementIssue" + }, + "type": "array" } }, "type": "object" }, - "uniqueItems": true, "type": "array" - } - }, - "type": "object" - }, - "ContentType": { - "description": "A content type object.\n", - "required": ["system", "elements"], - "properties": { - "system": { - "description": "System properties of the content type.\n", - "required": ["id", "name", "codename", "last_modified"], - "properties": { - "id": { - "description": "Unique internal identifier of the content type.\n", - "example": "b2c14f2c-6467-460b-a70b-bca17972a33a", - "format": "uuid", - "type": "string" - }, - "name": { - "description": "Display name of the content type.\n", - "example": "About us", - "type": "string" - }, - "codename": { - "description": "Codename of the content type, generated from the content types's `name`.\n", - "example": "about_us", - "type": "string" - }, - "last_modified": { - "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601 \"International standard covering the exchange of date- and time-related data\") formatted date-time of the last content type change.\n", - "example": "2016-10-20T12:03:17.4685693Z", - "format": "date-time", - "type": "string" - } - }, - "type": "object" }, - "elements": { - "description": "A list of [elements](https://docs.kontent.ai/link-to/content_elements) that define the content type.\n\n**Note**: The order of the elements in the API response might not match their order in the UI.\n", - "additionalProperties": { - "oneOf": [{ - "$ref": "#/components/schemas/AssetInItem" - }, { - "$ref": "#/components/schemas/CustomElementInItem" - }, { - "$ref": "#/components/schemas/DateTimeInItem" - }, { - "$ref": "#/components/schemas/LinkedItemsInItem" - }, { - "$ref": "#/components/schemas/MultipleChoiceInItem" - }, { - "$ref": "#/components/schemas/NumberInItem" - }, { - "$ref": "#/components/schemas/RichTextInItem" - }, { - "$ref": "#/components/schemas/TaxonomyInItem" - }, { - "$ref": "#/components/schemas/Text" - }, { - "$ref": "#/components/schemas/UrlSlugInItem" - }], - "x-additionalPropertiesName": "" + "type_issues": { + "description": "Report of the problems found in the project's content types.\n", + "items": { + "description": "The `type_issues` property is an array of issues found in the content types of the project. Each type issue object contains information necessary to identify the content type and lists the content elements with issues.\n", + "required": ["type", "issues"], + "properties": { + "type": { + "$ref": "#/components/schemas/Metadata" + }, + "issues": { + "description": "Information about issues found in specific elements.\n", + "items": { + "$ref": "#/components/schemas/ElementIssue" + }, + "type": "array" + } + }, + "type": "object" }, - "type": "object" + "type": "array" } }, "type": "object" }, - "TaxonomyTerm": { - "required": ["name", "codename", "terms"], + "Webhook": { + "description": "The webhook object contains all information about a given webhook, including its target URL, secret key for authentication, and a collection of triggers.\n", + "required": ["name", "secret", "triggers", "url"], "properties": { + "last_modified": { + "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date/time of the last change to the webhook.\n", + "example": "2019-09-18T09:29:08.4356117Z", + "readOnly": true, + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The webhook's internal ID.\n", + "example": "5df74e27-1213-484e-b9ae-bcbe90bd5990", + "readOnly": true, + "format": "uuid", + "type": "string" + }, "name": { - "description": "Display name of the taxonomy term\n", - "example": "Coffee expert", + "description": "The webhook's display name.\n", + "example": "Example webhook", + "minLength": 1, + "maxLength": 200, "type": "string" }, - "codename": { - "description": "Codename of the taxonomy term\n", - "example": "coffee_expert", + "url": { + "description": "The URL to which the webhook notification will be sent.\n", + "example": "https://example.com/webhook", + "format": "url", + "minLength": 1, + "maxLength": 250, "type": "string" }, - "terms": { - "description": "A list of descendant taxonomy terms.\n", - "type": "array" - } - }, - "type": "object" - }, - "TaxonomyGroup": { - "required": ["system", "terms"], - "properties": { - "system": { - "description": "System properties of the taxonomy group.\n", - "required": ["id", "name", "codename", "last_modified"], + "secret": { + "description": "The webhook's secret key, used to authenticate that the webhook was sent by Kentico Kontent.\n", + "example": "secret_key", + "minLength": 1, + "type": "string" + }, + "triggers": { + "description": "The events that will trigger this webhook being sent. At least one valid trigger is required.\n", "properties": { - "id": { - "description": "Unique internal identifier of the taxonomy group.\n", - "example": "f30c7f72-e9ab-8832-2a57-62944a038809", - "format": "uuid", - "type": "string" - }, - "name": { - "description": "Display name of the taxonomy group.\n", - "example": "Personas", - "type": "string" - }, - "codename": { - "description": "Codename of the taxonomy group.\n", - "example": "personas", - "type": "string" + "delivery_api_content_changes": { + "description": "* For triggers when a [language variant](https://docs.kontent.ai/link-to/language_variants) is published or unpublished:\n * Use `content_item_variant` for the `type`.\n * You can choose `publish` and `unpublish` for `operations`.\n* For triggers on changes to [taxonomy groups](https://docs.kontent.ai/link-to/taxonomy_groups):\n * Use `taxonomy` for the `type`.\n * You can choose `archive`, `restore`, and `upsert` for `operations`.\n", + "example": [{ + "type": "content_item_variant", + "operations": ["publish", "unpublish"] + }, { + "type": "taxonomy", + "operations": ["archive", "restore", "upsert"] + }], + "items": { + "required": ["operations", "type"], + "properties": { + "type": { + "enum": ["content_item_variant", "taxonomy"], + "type": "string" + }, + "operations": { + "items": { + "enum": ["publish", "unpublish", "archive", "restore", "upsert"], + "type": "string" + }, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "uniqueItems": true, + "type": "array" }, - "last_modified": { - "description": "[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601 \"International standard covering the exchange of date- and time-related data\") formatted date-time of the last taxonomy group change.\n", - "example": "2017-08-31T09:41:06.520241Z", - "format": "date-time", - "type": "string" + "workflow_step_changes": { + "items": { + "example": { + "type": "content_item_variant", + "transitions_to": [{ + "id": "b4363ccd-8f21-45fd-a840-5843d7b7f008" + }, { + "id": "88ac5e6e-1c5c-4638-96e1-0d61221ad5bf" + }] + }, + "required": ["transitions_to", "type"], + "properties": { + "type": { + "enum": ["content_item_variant"], + "type": "string" + }, + "transitions_to": { + "description": "A collection of references to the [workflow steps](https://docs.kontent.ai/link-to/workflow_and_publishing) that will trigger the webhook when an item transitions to them. Workflow steps must be referenced by their internal IDs.\n", + "items": { + "$ref": "#/components/schemas/Reference" + }, + "type": "array" + } + }, + "type": "object" + }, + "uniqueItems": true, + "type": "array" } }, "type": "object" - }, - "terms": { - "description": "A list of taxonomy terms.\n", - "items": { - "$ref": "#/components/schemas/TaxonomyTerm" - }, - "uniqueItems": true, - "type": "array" } }, "type": "object" } + }, + "securitySchemes": { + "Bearer": { + "description": "This API uses OAuth 2.0 [bearer token](https://tools.ietf.org/html/rfc6750) (API key) to authorize requests. Requests with an incorrect or missing `Authorization` header will fail with an [error](#section/Errors).\n\nTo get your API key for the API, go to [Kentico Kontent](https://app.kontent.ai/) -> Project settings -> API keys. The API keys provide access to a single Kentico Kontent project. You will need different API keys for each of your projects.\n", + "type": "http", + "scheme": "bearer", + "bearerFormat": "Bearer " + } } - } + }, + "security": [{ + "Bearer": [] + }] } diff --git a/package.json b/package.json index bc8f4512c7..e66bfbc21f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kentico-kontent-docs-redoc", - "version": "3.0.2", + "version": "3.0.3", "description": "ReDoc", "repository": { "type": "git", diff --git a/src/services/models/Operation.ts b/src/services/models/Operation.ts index 88640dc563..bdfbc5c7c6 100644 --- a/src/services/models/Operation.ts +++ b/src/services/models/Operation.ts @@ -154,12 +154,11 @@ export class OperationModel implements IMenuItem { ).map(paramOrRef => new FieldModel(this.parser, paramOrRef, this.pointer, this.options)); if (this.options.sortPropsAlphabetically) { - sortByField(_parameters, 'name'); + return sortByField(_parameters, 'name'); } if (this.options.requiredPropsFirst) { - sortByRequired(_parameters); + return sortByRequired(_parameters); } - return _parameters; } @memoize diff --git a/src/services/models/Schema.ts b/src/services/models/Schema.ts index 6b22871142..7970be03dc 100644 --- a/src/services/models/Schema.ts +++ b/src/services/models/Schema.ts @@ -251,7 +251,7 @@ function buildFields( const props = schema.properties || {}; const additionalProps = schema.additionalProperties; const defaults = schema.default || {}; - const fields = Object.keys(props || []).map(fieldName => { + let fields = Object.keys(props || []).map(fieldName => { let field = props[fieldName]; if (!field) { @@ -280,11 +280,11 @@ function buildFields( }); if (options.sortPropsAlphabetically) { - sortByField(fields, 'name'); + fields = sortByField(fields, 'name'); } if (options.requiredPropsFirst) { // if not sort alphabetically sort in the order from required keyword - sortByRequired(fields, !options.sortPropsAlphabetically ? schema.required : undefined); + fields = sortByRequired(fields, !options.sortPropsAlphabetically ? schema.required : undefined); } if (typeof additionalProps === 'object' || additionalProps === true) { diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index 5999b3eeb2..02dde3a3cc 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -1,6 +1,7 @@ import { dirname } from 'path'; const URLtemplate = require('url-template'); +import { FieldModel } from '../services/models'; import { OpenAPIParser } from '../services/OpenAPIParser'; import { OpenAPIEncoding, @@ -413,25 +414,29 @@ export function humanizeConstraints(schema: OpenAPISchema): string[] { return res; } -export function sortByRequired( - fields: Array<{ required: boolean; name: string }>, - order: string[] = [], -) { - fields.sort((a, b) => { - if (!a.required && b.required) { - return 1; - } else if (a.required && !b.required) { - return -1; - } else if (a.required && b.required) { - return order.indexOf(a.name) - order.indexOf(b.name); +export function sortByRequired(fields: FieldModel[], order: string[] = []) { + const unrequiredFields: FieldModel[] = []; + const orderedFields: FieldModel[] = []; + const unorderedFields: FieldModel[] = []; + + fields.forEach(field => { + if (field.required) { + order.includes(field.name) ? orderedFields.push(field) : unorderedFields.push(field); } else { - return 0; + unrequiredFields.push(field); } }); + + orderedFields.sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name)); + + return [...orderedFields, ...unorderedFields, ...unrequiredFields]; } -export function sortByField(fields: Array<{ [P in T]: string }>, param: T) { - fields.sort((a, b) => { +export function sortByField( + fields: FieldModel[], + param: keyof Pick, +) { + return [...fields].sort((a, b) => { return a[param].localeCompare(b[param]); }); }