# Document Collections

Manage your custom document collections in a Vector Dababase.

## Get all collections

> Retrieve all stored document collections

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionsList":{"type":"object","properties":{"id":{"type":"string","description":"Unique Collection Identifier","readOnly":true},"type":{"type":"string","description":"Entity type","readOnly":true,"enum":["collection"]},"href":{"type":"string","description":"Resource URL"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Collection"},"description":"The list of available collections."}},"required":["id","type","href","items"]},"Collection":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/CollectionProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionProperties":{"type":"object","description":"Collection properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}},"documentsCount":{"type":"integer","description":"The number of documents in the collection."},"totalTokens":{"type":"integer","description":"The total size of all documents in the collection, in tokens."},"embedding":{"$ref":"#/components/schemas/Embedding"},"engine":{"$ref":"#/components/schemas/Engine"},"chunking":{"$ref":"#/components/schemas/Chunking"}}},"Embedding":{"type":"object","description":"Indicates information about the embedding model used by this collection","properties":{"model":{"type":"string","description":"Name of the model to use."}}},"Engine":{"type":"object","description":"Additional information about the database engine that user wants to use.","properties":{"db_type":{"type":"string","enum":["chromadb","pgvector"],"default":"chromadb","description":"Type of database to use. Defaults to chromadb."}}},"Chunking":{"type":"object","description":"Indicating if there should be a chunking strategy and if enabled,\nspecify parameters needed for the chosen strategy.\n","properties":{"enabled":{"type":"boolean","description":"Flag to indicate whether chunking is enabled.","default":false},"strategy":{"$ref":"#/components/schemas/Strategy"}}},"Strategy":{"type":"object","description":"Strategy object which will vary based on the type of strategy selected. \nIf enabled, the default strategy is \"fixed_size\" with the default values.\n* `fixed_size` It splits the text into chunk_size tokens\n","properties":{"name":{"type":"string","default":"fixed_size","description":"The name of the chunking strategy."},"config":{"type":"object","description":"Configuring chunk_size and chunk_overlap for the selected chunking strategy.","properties":{"chunk_size":{"type":"integer","description":"Size of each chunk when the strategy is \"fixed_size\".","minimum":128,"default":128},"chunk_overlap":{"type":"integer","description":"Overlap between consecutive chunks when the strategy is \"fixed_size\".","minimum":50,"default":50}}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections":{"get":{"operationId":"collectionsGet","summary":"Get all collections","description":"Retrieve all stored document collections","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":100},"required":false,"description":"The maximum number of collections to return - defaults to 100"},{"name":"offset","in":"query","schema":{"type":"integer","default":0},"required":false,"description":"The offset to start from - defaults to 0"}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionsList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Create a new collection

> Create a new, empty document collection for storing documents

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionCreate":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"allOf":[{"$ref":"#/components/schemas/CollectionPropertiesCreate"},{"type":"object"}]},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionPropertiesCreate":{"type":"object","description":"Collection properties.","properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}},"embedding":{"$ref":"#/components/schemas/Embedding"},"engine":{"$ref":"#/components/schemas/Engine"},"chunking":{"$ref":"#/components/schemas/Chunking"}},"required":["name"]},"Embedding":{"type":"object","description":"Indicates information about the embedding model used by this collection","properties":{"model":{"type":"string","description":"Name of the model to use."}}},"Engine":{"type":"object","description":"Additional information about the database engine that user wants to use.","properties":{"db_type":{"type":"string","enum":["chromadb","pgvector"],"default":"chromadb","description":"Type of database to use. Defaults to chromadb."}}},"Chunking":{"type":"object","description":"Indicating if there should be a chunking strategy and if enabled,\nspecify parameters needed for the chosen strategy.\n","properties":{"enabled":{"type":"boolean","description":"Flag to indicate whether chunking is enabled.","default":false},"strategy":{"$ref":"#/components/schemas/Strategy"}}},"Strategy":{"type":"object","description":"Strategy object which will vary based on the type of strategy selected. \nIf enabled, the default strategy is \"fixed_size\" with the default values.\n* `fixed_size` It splits the text into chunk_size tokens\n","properties":{"name":{"type":"string","default":"fixed_size","description":"The name of the chunking strategy."},"config":{"type":"object","description":"Configuring chunk_size and chunk_overlap for the selected chunking strategy.","properties":{"chunk_size":{"type":"integer","description":"Size of each chunk when the strategy is \"fixed_size\".","minimum":128,"default":128},"chunk_overlap":{"type":"integer","description":"Overlap between consecutive chunks when the strategy is \"fixed_size\".","minimum":50,"default":50}}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Collection":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/CollectionProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionProperties":{"type":"object","description":"Collection properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}},"documentsCount":{"type":"integer","description":"The number of documents in the collection."},"totalTokens":{"type":"integer","description":"The total size of all documents in the collection, in tokens."},"embedding":{"$ref":"#/components/schemas/Embedding"},"engine":{"$ref":"#/components/schemas/Engine"},"chunking":{"$ref":"#/components/schemas/Chunking"}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections":{"post":{"operationId":"collectionsPost","summary":"Create a new collection","description":"Create a new, empty document collection for storing documents","requestBody":{"description":"Collection input","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionCreate"}}}},"tags":["Document Collections"],"responses":{"201":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Get collection

> Returns the properties and metadata for the document collection

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"Collection":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/CollectionProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionProperties":{"type":"object","description":"Collection properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}},"documentsCount":{"type":"integer","description":"The number of documents in the collection."},"totalTokens":{"type":"integer","description":"The total size of all documents in the collection, in tokens."},"embedding":{"$ref":"#/components/schemas/Embedding"},"engine":{"$ref":"#/components/schemas/Engine"},"chunking":{"$ref":"#/components/schemas/Chunking"}}},"Embedding":{"type":"object","description":"Indicates information about the embedding model used by this collection","properties":{"model":{"type":"string","description":"Name of the model to use."}}},"Engine":{"type":"object","description":"Additional information about the database engine that user wants to use.","properties":{"db_type":{"type":"string","enum":["chromadb","pgvector"],"default":"chromadb","description":"Type of database to use. Defaults to chromadb."}}},"Chunking":{"type":"object","description":"Indicating if there should be a chunking strategy and if enabled,\nspecify parameters needed for the chosen strategy.\n","properties":{"enabled":{"type":"boolean","description":"Flag to indicate whether chunking is enabled.","default":false},"strategy":{"$ref":"#/components/schemas/Strategy"}}},"Strategy":{"type":"object","description":"Strategy object which will vary based on the type of strategy selected. \nIf enabled, the default strategy is \"fixed_size\" with the default values.\n* `fixed_size` It splits the text into chunk_size tokens\n","properties":{"name":{"type":"string","default":"fixed_size","description":"The name of the chunking strategy."},"config":{"type":"object","description":"Configuring chunk_size and chunk_overlap for the selected chunking strategy.","properties":{"chunk_size":{"type":"integer","description":"Size of each chunk when the strategy is \"fixed_size\".","minimum":128,"default":128},"chunk_overlap":{"type":"integer","description":"Overlap between consecutive chunks when the strategy is \"fixed_size\".","minimum":50,"default":50}}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}":{"get":{"operationId":"collectionsFindById","summary":"Get collection","description":"Returns the properties and metadata for the document collection","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Update an existing collection

> Update collection details and metadata. No modification is done on the documents.

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionUpdate":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/CollectionPropertiesUpdate"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionPropertiesUpdate":{"type":"object","description":"Collection properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Collection":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the documents collection."},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"type":{"type":"string","enum":["collection"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/CollectionProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"CollectionProperties":{"type":"object","description":"Collection properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the collection. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the collection, max 1024 chars."},"labels":{"type":"object","description":"The labels set for the collection.","additionalProperties":{"description":"The label value, max 256 chars."}},"documentsCount":{"type":"integer","description":"The number of documents in the collection."},"totalTokens":{"type":"integer","description":"The total size of all documents in the collection, in tokens."},"embedding":{"$ref":"#/components/schemas/Embedding"},"engine":{"$ref":"#/components/schemas/Engine"},"chunking":{"$ref":"#/components/schemas/Chunking"}}},"Embedding":{"type":"object","description":"Indicates information about the embedding model used by this collection","properties":{"model":{"type":"string","description":"Name of the model to use."}}},"Engine":{"type":"object","description":"Additional information about the database engine that user wants to use.","properties":{"db_type":{"type":"string","enum":["chromadb","pgvector"],"default":"chromadb","description":"Type of database to use. Defaults to chromadb."}}},"Chunking":{"type":"object","description":"Indicating if there should be a chunking strategy and if enabled,\nspecify parameters needed for the chosen strategy.\n","properties":{"enabled":{"type":"boolean","description":"Flag to indicate whether chunking is enabled.","default":false},"strategy":{"$ref":"#/components/schemas/Strategy"}}},"Strategy":{"type":"object","description":"Strategy object which will vary based on the type of strategy selected. \nIf enabled, the default strategy is \"fixed_size\" with the default values.\n* `fixed_size` It splits the text into chunk_size tokens\n","properties":{"name":{"type":"string","default":"fixed_size","description":"The name of the chunking strategy."},"config":{"type":"object","description":"Configuring chunk_size and chunk_overlap for the selected chunking strategy.","properties":{"chunk_size":{"type":"integer","description":"Size of each chunk when the strategy is \"fixed_size\".","minimum":128,"default":128},"chunk_overlap":{"type":"integer","description":"Overlap between consecutive chunks when the strategy is \"fixed_size\".","minimum":50,"default":50}}}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}":{"put":{"operationId":"collectionsPut","summary":"Update an existing collection","description":"Update collection details and metadata. No modification is done on the documents.","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."}],"requestBody":{"description":"Collection input","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionUpdate"}}}},"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Delete a collection and its documents

> Delete a collection and all documents stored in it

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}}},"paths":{"/collections/{collectionId}":{"delete":{"operationId":"collectionsDelete","summary":"Delete a collection and its documents","description":"Delete a collection and all documents stored in it","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."}],"tags":["Document Collections"],"responses":{"204":{"description":"Successful operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Get the list of documents stored in the collection

> Get the list of documents stored in the collection

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionDocumentsList":{"type":"object","properties":{"id":{"type":"string","description":"Unique Collection Identifier","readOnly":true},"type":{"type":"string","description":"Entity type","enum":["collection"],"readOnly":true},"href":{"type":"string","description":"Resource URL","readOnly":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"description":"The list of all documents in a collection"}}},"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/documents":{"get":{"operationId":"collectionsDocumentsGet","summary":"Get the list of documents stored in the collection","description":"Get the list of documents stored in the collection","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"name":"limit","in":"query","schema":{"type":"integer","default":100},"required":false,"description":"The maximum number of documents to return - defaults to 100"},{"name":"offset","in":"query","schema":{"type":"integer","default":0},"required":false,"description":"The offset to start from - defaults to 0"}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionDocumentsList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Add documents to the collection

> Add documents to the collection.<br>

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionDocumentsListCreate":{"type":"object","properties":{"id":{"type":"string","description":"Unique Collection Identifier","readOnly":true},"type":{"type":"string","description":"Entity type","enum":["collection"],"readOnly":true},"href":{"type":"string","description":"Resource URL","readOnly":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/DocumentCreate"},"description":"The list of all documents in a collection"}},"required":["type","items"]},"DocumentCreate":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"allOf":[{"$ref":"#/components/schemas/DocumentPropertiesCreate"},{"type":"object"}]},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentPropertiesCreate":{"type":"object","description":"Document properties.","properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}},"required":["name","contentType","content"]},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"CollectionDocumentsList":{"type":"object","properties":{"id":{"type":"string","description":"Unique Collection Identifier","readOnly":true},"type":{"type":"string","description":"Entity type","enum":["collection"],"readOnly":true},"href":{"type":"string","description":"Resource URL","readOnly":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"description":"The list of all documents in a collection"}}},"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/documents":{"put":{"operationId":"collectionsDocumentsPut","summary":"Add documents to the collection","description":"Add documents to the collection.\n","requestBody":{"description":"Document input","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionDocumentsListCreate"}}}},"parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionDocumentsList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Prune all documents in a collection

> Delete all documents from a collection, thus pruning it

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}}},"paths":{"/collections/{collectionId}/documents":{"delete":{"operationId":"collectionsDocumentsDelete","summary":"Prune all documents in a collection","description":"Delete all documents from a collection, thus pruning it","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Get document details

> Retreieve document's details.

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/documents/{documentId}":{"get":{"operationId":"collectionsDocumentsFindById","summary":"Get document details","description":"Retreieve document's details.","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"name":"documentId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the document."}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Update a document

> Replaces the existing document identified by documentId with the contents of the request payload

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/documents/{documentId}":{"put":{"operationId":"collectionsDocumentUpdate","summary":"Update a document","description":"Replaces the existing document identified by documentId with the contents of the request payload","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"name":"documentId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the document."}],"tags":["Document Collections"],"requestBody":{"description":"Document input","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Delete a document

> Remove a document from the collection

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}}},"paths":{"/collections/{collectionId}/documents/{documentId}":{"delete":{"operationId":"collectionsDocumentDelete","summary":"Delete a document","description":"Remove a document from the collection","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"name":"documentId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the document."}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Get document chunks details

> Retrieve existing chunks for the document with documentId.

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"CollectionDocumentsList":{"type":"object","properties":{"id":{"type":"string","description":"Unique Collection Identifier","readOnly":true},"type":{"type":"string","description":"Entity type","enum":["collection"],"readOnly":true},"href":{"type":"string","description":"Resource URL","readOnly":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"},"description":"The list of all documents in a collection"}}},"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/documents/{documentId}/chunks":{"get":{"operationId":"collectionsDocumentsChunksGet","summary":"Get document chunks details","description":"Retrieve existing chunks for the document with documentId.","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"name":"documentId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the document."},{"name":"limit","in":"query","schema":{"type":"integer","default":100,"minimum":1,"maximum":10000},"required":false,"description":"The maximum number of documents to return - defaults to 100"},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0,"maximum":1000000},"required":false,"description":"The offset to start from - defaults to 0"}],"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionDocumentsList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```

## Query a collection / search for related content

> Query a collection / search for related content.\
> This endpoint is used to return relevant documents from a collection.<br>

```json
{"openapi":"3.0.3","info":{"title":"IONOS Cloud - AI Model Hub API","version":"1.0.0"},"tags":[{"name":"Document Collections","description":"Manage your custom document collections in a Vector Dababase."}],"servers":[{"url":"https://inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"QueryRequest":{"type":"object","properties":{"query":{"type":"string","description":"The string used to query the vector database.","minLength":1},"limit":{"type":"integer","default":10,"description":"The maximum number of matches to return."}},"required":["query"]},"QueryResult":{"type":"object","properties":{"type":{"type":"string","enum":["result"],"readOnly":true,"description":"Type of object"},"properties":{"$ref":"#/components/schemas/QueryResultProperties"},"metadata":{"$ref":"#/components/schemas/MetadataQueryResult"}},"required":["type","metadata","properties"]},"QueryResultProperties":{"type":"object","description":"Query result properties.","properties":{"matches":{"type":"array","items":{"type":"object","properties":{"score":{"type":"number","description":"The match score. Lower values indicate better matches.\n"},"document":{"$ref":"#/components/schemas/Document"}}}}},"required":["matches"]},"Document":{"type":"object","properties":{"id":{"type":"string","readOnly":true,"description":"The unique identifier of the document."},"type":{"type":"string","readOnly":true,"description":"Type of object","enum":["document"]},"href":{"type":"string","readOnly":true,"description":"Resource URL"},"properties":{"$ref":"#/components/schemas/DocumentProperties"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["properties"]},"DocumentProperties":{"type":"object","description":"Document properties.","minProperties":1,"properties":{"name":{"type":"string","description":"The name set for the document. should have a length between 3 and 256 characters,\nshould start and ends with an alphanumeric character, can only contain alphanumeric\ncharacters or hyphens, should not contain two consecutive periods and should not\nbe a valid IPv4 address.\n","minLength":3,"maxLength":256},"description":{"type":"string","description":"The description set for the document, max 1024 chars."},"contentType":{"type":"string","readOnly":false,"description":"The type of document, content-type values accepted.","enum":["text/plain"]},"content":{"type":"string","description":"The content of the document, base64 encoded. The maximum length of undecoded content is 65535 characters."},"labels":{"type":"object","description":"The labels set for the document.","additionalProperties":{"oneOf":[{"type":"string","maxLength":256,"description":"The label value, max 256 chars."},{"type":"boolean"},{"type":"number"}]}}}},"Metadata":{"type":"object","description":"Metadata of the resource.","readOnly":true,"properties":{"lastModifiedDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of the last change formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."},"createdDate":{"type":"string","readOnly":true,"format":"date-time","description":"The date of creation of the zone formatted as yyyy-MM-dd'T'HH:mm:ss.SSS'Z'."}}},"MetadataQueryResult":{"allOf":[{"$ref":"#/components/schemas/Metadata"},{"type":"object","readOnly":true,"properties":{"duration":{"type":"number","format":"float","readOnly":true,"description":"The time it took for the model to generate the output (in ms)."},"inputTokens":{"type":"number","description":"The length in tokens of the input sent to the embedding model"}}}]},"Error":{"type":"object","additionalProperties":false,"properties":{"httpStatus":{"type":"integer","description":"HTTP status code of the operation as specified by [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-6).\n"},"messages":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string","description":"Internal error code.\n"},"message":{"type":"string","description":"Human readable explanation of the issue.\n"}}}}}}},"responses":{"BadRequest":{"description":"### Bad Request\nThe request send to the API was malformed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"### Unauthorized\nThe request is missing authorization information or the authorization information provided are expired.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"### Forbidden\nThe user issuing the request does not have the needed permissions.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"### Not Found\nThe resource that was requested could not be found.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"### Internal Server Error\nAn internal error occurred. We apologize for the inconvenience!\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/collections/{collectionId}/query":{"post":{"operationId":"collectionsQueryPost","summary":"Query a collection / search for related content","description":"Query a collection / search for related content.\nThis endpoint is used to return relevant documents from a collection.\n","parameters":[{"name":"collectionId","in":"path","schema":{"type":"string"},"required":true,"description":"The ID of the collection."},{"in":"query","name":"labels","schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"An array of values for the dynamic label."}},"style":"deepObject","explode":true,"description":"A map of dynamic label keys to their array of string values. Example: /collections/{collectionId}/query?labels[category][0]=cat1&labels[category][1]=cat2&labels[status][0]=active\n"}],"requestBody":{"description":"Query string and parameters.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}}},"tags":["Document Collections"],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}}}
```
