Skip to navigation

Add items to an item collection

Adds one or more items to the specified item collection. This operation is idempotent: the platform skips the items already in the collection. The response lists the result for each identifier of an item in the results array. Every identifier must reference an existing item in the knowledge store. If one does not, the platform rejects the whole request with a 404 error and adds none of the items.

Authentication

x-api-keystring

Your API key.

Note

You can find your API key on the API Keys page.

Path parameters

knowledge_store_idstringRequired
The unique identifier of the knowledge store.
collection_idstringRequired
The unique identifier of the knowledge store item collection.

Request

This endpoint expects an object.
item_idslist of stringsRequired
The unique identifiers of the items to add to the collection. Include up to 500 identifiers per request. An item collection can contain up to 5,000 items.

Response

The items have been successfully added to the collection.
resultslist of objects
An array with one entry for each identifier of an item in the request, in request order.
_idstringOptional
The unique identifier of the item collection.
knowledge_store_idstringOptional
The unique identifier of the knowledge store this collection belongs to.
namestringOptional
The name of the item collection.
descriptionstringOptional
The description of the item collection.
metadatamap from strings to strings or integers or doubles or booleans or lists of stringsOptional

Custom metadata for the item collection. Keys are strings; each value is a string, a number, a boolean, or an array of strings.

member_countintegerOptionalRead-only
The number of items in the collection.
created_atstringOptionalformat: "date-time"
The date and time when the item collection was created, in the RFC 3339 format.
updated_atstringOptionalformat: "date-time"
The date and time when the item collection was last updated, in the RFC 3339 format.

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error