# Fetch content with advanced filtering, pagination, and version grouping Retrieves a list of content items with comprehensive filtering capabilities and optional version grouping. Top-level Field Filtering: - contentId, categoryId, fileName, fileFormat, createdAt, updatedAt Metadata Field Filtering: - Filter on any metadata query using nested structure: metadata: { "keyName": value } Advanced Operators: - eq, ne - Equality/inequality - gt, gte, lt, lte - Comparison (dates/numbers) - between - Range filtering: [min, max] - in, nin - Array membership - contains, startsWith, endsWith - String operations - exists - Field presence check Version Grouping: - groupByVersion: When true, groups content by version strings and returns only the most recent item per version - Version strings are calculated from category name + metadata values where uniqueIndexElement is true - Format: "category_name_value1_value2" (lowercase, underscore-separated) - Returns relatedVersions array containing objects with id, filename, and created_at for other content items sharing the same version - When false or omitted, relatedVersions is null and all content is returned - Special case: When filtering by contentId AND groupByVersion is true, returns the specified content item with all its related versions attached Logging Control: - disabledLogging: When true, disables query logging for this request (both console logs and database query logs) - When false or omitted, normal logging behavior is maintained - Useful for high-frequency operations or when logging is not desired Features: - Cursor-based pagination with pageSize and cursor - Field selection with fields parameter - Mixed filtering (combine top-level and metadata filters) - Version grouping for content deduplication - Optional logging control for performance optimization - Backward compatible with empty filters Example Request (with version grouping and disabled logging): json { "query": "annual report", "groupByVersion": true, "disabledLogging": false, "filters": { "fileFormat": { "in": ["application/pdf"] }, "createdAt": { "gte": "2025-01-01T00:00:00Z" }, "metadata": { "Status": { "ne": "Archived" }, "Business Type": { "in": ["Restaurant", "Retail"] } } } } Example Response (with version grouping): json { "contentItems": [ { "contentId": "123e4567-e89b-12d3-a456-426614174000", "categoryId": "456e7890-e89b-12d3-a456-426614174001", "fileName": "license_v2.pdf", "createdAt": "2025-01-15T10:30:00Z", "relatedVersions": [ { "id": "789e0123-e89b-12d3-a456-426614174002", "filename": "license_v1.pdf", "created_at": "2025-01-14T09:15:00Z" } ] } ] } Endpoint: POST /content/{dataspaceId}/fetch Version: 1.0.0 Security: bearerAuth ## Path parameters: - `dataspaceId` (string, required) Short dataspace ID with sds- prefix Example: "sds-abc12345" ## Query parameters: - `cursor` (string) Cursor for pagination Example: "123e4567-e89b-12d3-a456-426614174000" - `pageSize` (integer, required) Number of items per page Example: 20 - `fields` (string) Comma-separated list of fields to include Example: "contentId,categoryId,fileName" ## Request fields (application/json): - `query` (string) Text query for full-text search across content metadata (filename, metadata query/values, categories, etc.) - does not search the actual content body Example: "annual report 2024" - `groupByVersion` (boolean) Group content by version (category name + unique index metadata values) - `filters` (object) - `filters.contentId` (any) Filter by content ID - `filters.categoryId` (any) Filter by category ID - `filters.fileName` (any) Filter by file name - `filters.fileFormat` (any) Filter by file format/MIME type - `filters.createdAt` (any) Filter by creation date - `filters.updatedAt` (any) Filter by last update date - `filters.metadata` (object) Filter by metadata fields - key-value pairs where values can use advanced operators ## Response 200 fields (application/json): - `contentItems` (array, required) - `contentItems.contentId` (string, required) Example: "123e4567-e89b-12d3-a456-426614174000" - `contentItems.categoryId` (string,null) Example: "123e4567-e89b-12d3-a456-426614174001" - `contentItems.dataspaceId` (string) Short dataspace ID with sds- prefix Example: "sds-abc12345" - `contentItems.metadata` (object) Optional metadata for the content item Example: {"category":"research","priority":1} - `contentItems.inferenceTaskExecutions` (object) Optional record of inference task executions that modified this content Example: {"categoryId":"789e0123-e89b-12d3-a456-426614174002"} - `contentItems.fileFormat` (string) Example: "application/pdf" - `contentItems.fileName` (string) Example: "document.pdf" - `contentItems.createdAt` (string) Example: "2024-01-15T10:30:00Z" - `contentItems.updatedAt` (string,null) Example: "2024-01-15T14:30:00Z" - `contentItems.relatedVersions` (array,null) Related content versions that share the same version string (null when groupByVersion is false) Example: [{"id":"456e7890-e89b-12d3-a456-426614174001","filename":"document_v1.pdf","created_at":"2024-01-15T10:30:00Z"},{"id":"789e0123-e89b-12d3-a456-426614174002","filename":"document_v2.pdf","created_at":"2024-01-16T14:20:00Z"}] - `contentItems.relatedVersions.id` (string, required) Content ID of the related version Example: "456e7890-e89b-12d3-a456-426614174001" - `contentItems.relatedVersions.filename` (string, required) Filename of the related version Example: "document_v2.pdf" - `contentItems.relatedVersions.created_at` (string, required) Creation date of the related version Example: "2024-01-15T10:30:00Z" - `nextCursor` (string) Example: "123e4567-e89b-12d3-a456-426614174001" - `totalItems` (integer, required) Example: 42 ## Response 400 fields ## Response 401 fields ## Response 404 fields