Content management operations. Handle file uploads, processing, metadata extraction, and content retrieval with advanced filtering capabilities.
- Update content
Sync Workspace API (1.0.0)
Workspace-specific services for content management, project organization, and file processing.
The Workspace APIs allow access to the resources contained within Workspaces and Dataspaces. Although Workspaces and Dataspaces are distinct, Dataspaces have no compute of their own, so operations on Dataspace resources must always be performed through a chosen workspace. Workspaces are bundled, fully-managed computational services used to: - Upload, process, and manage content files - Search and retrieve content with advanced filtering - Query content using AI with library citations and web search integration - Run AI workflows on the content - Organize content into projects according to business workflows - Generate file derivatives (images, thumbnails) and extract metadata - Handle content indexing with automated categorization
When files are uploaded, they undergo asynchronous processing which may include: - Virus scanning and security validation - File format conversion and derivative generation (TIFF, JPEG thumbnails) - Automated metadata extraction using AI - Content categorization and indexing according to dataspace ontology Processing status can be tracked using the Workflow Execution API.
- Content: Individual files with metadata, organized by categories defined in the dataspace ontology - Projects: Business workflow containers that group disparate content items according to business rules (e.g., application packets, case files)
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content/{contentId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content/{contentId}
- Development serverhttps://docs.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content/{contentId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content/{contentId}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content/{contentId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content/{contentId}
- Development serverhttps://docs.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content/{contentId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content/{contentId}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content
- Development serverhttps://docs.syncdocs.ai/api/projects/{dataspaceId}/{projectId}/content
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/projects/{dataspaceId}/{projectId}/content' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "contentIds": [ "497f6eca-6276-4993-bfeb-53cbbbba6f08" ] }
Request
Upload files using multipart/form-data to directly upload files. Comprehensive Validation System: The content creation endpoint performs multiple layers of validation to ensure data integrity: 1. Schema Validation: - categoryId: Must be a valid UUID - metadata: Must be a valid JSON object (if provided) - fileFormat: Required string specifying the file's MIME type - fileName: Optional string for the file name 2. Business Logic Validation: - Category Existence: Validates that the specified categoryId exists in the dataspace's ontology - Metadata Query Binding: Ensures all provided metadata queries are bound to the specified category - Data Type Validation: Verifies that metadata values match the expected data types (STRING, SHORT_STRING, NUMBER, BOOLEAN, DATE) 3. Required Metadata Validation: - Default Behavior: validateRequiredMetadata defaults to true when not specified - When enabled (default): Enforces that all required metadata queries and unique index elements are provided - When disabled (validateRequiredMetadata=false): Allows content creation without required metadata queries 4. File Upload Validation: - File must be provided in the multipart form data - File format fallback: Uses detected MIME type if fileFormat not specified - File name fallback: Uses original filename if fileName not specified Query Parameters: - validateRequiredMetadata: Optional boolean (defaults to true) - Set to "false" to skip required metadata validation - Set to "true" or omit to enforce required metadata validation Error Scenarios: - 400 Bad Request: Invalid schema, category not found, unbound metadata queries, type mismatches, missing required metadata - 401 Unauthorized: Invalid or missing authentication - 404 Not Found: Dataspace not found
Optional metadata for the content item
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345?validateRequiredMetadata=string' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: multipart/form-data' \
-F categoryId=123e4567-e89b-12d3-a456-426614174001 \
-F 'metadata[author]=John Doe' \
-F 'metadata[category]=research' \
-F fileFormat=application/pdf \
-F fileName=document.pdf{ "contentId": "123e4567-e89b-12d3-a456-426614174000", "categoryId": "123e4567-e89b-12d3-a456-426614174001", "dataspaceId": "123e4567-e89b-12d3-a456-426614174002", "fileFormat": "application/pdf", "metadata": { "category": "documents", "priority": 1 }, "inferenceTaskExecutions": { "categoryId": "789e0123-e89b-12d3-a456-426614174002" }, "vectorStoreFileId": "file-abc123xyz789", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T14:30:00Z" }
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/{contentId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/123e4567-e89b-12d3-a456-426614174000 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "contentId": "123e4567-e89b-12d3-a456-426614174000", "categoryId": "123e4567-e89b-12d3-a456-426614174001", "dataspaceId": "123e4567-e89b-12d3-a456-426614174002", "fileFormat": "application/pdf", "metadata": { "category": "documents", "priority": 1 }, "inferenceTaskExecutions": { "categoryId": "789e0123-e89b-12d3-a456-426614174002" }, "vectorStoreFileId": "file-abc123xyz789", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T14:30:00Z" }
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/{contentId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/123e4567-e89b-12d3-a456-426614174000 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"categoryId": "123e4567-e89b-12d3-a456-426614174001",
"metadata": {
"status": "updated",
"version": 2
},
"inferenceTaskExecutions": {
"categoryId": "789e0123-e89b-12d3-a456-426614174002"
}
}'{ "contentId": "123e4567-e89b-12d3-a456-426614174000", "categoryId": "123e4567-e89b-12d3-a456-426614174001", "dataspaceId": "123e4567-e89b-12d3-a456-426614174002", "fileFormat": "application/pdf", "metadata": { "category": "documents", "priority": 1 }, "inferenceTaskExecutions": { "categoryId": "789e0123-e89b-12d3-a456-426614174002" }, "vectorStoreFileId": "file-abc123xyz789", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T14:30:00Z" }
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/{contentId}
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/{contentId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/123e4567-e89b-12d3-a456-426614174000 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/{contentId}/download
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/{contentId}/download
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/{contentId}/download
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/123e4567-e89b-12d3-a456-426614174000/download \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Request
Returns the total count of content items in a dataspace with optional filtering. Filtering Options: - categoryId: Filter by specific category UUID - fileFormat: Filter by file format/MIME type - dateFrom: Filter by creation date from (ISO 8601 format) - dateTo: Filter by creation date to (ISO 8601 format) Features: - Efficient counting using SQL COUNT queries - Multiple filter combinations supported - Date range filtering for temporal analysis - Category-specific content counting - File format filtering for content type analysis Example Usage: - Count all content: GET /content/sds-12345678/count - Count by category: GET /content/sds-12345678/count?categoryId=123e4567-e89b-12d3-a456-426614174001 - Count PDFs: GET /content/sds-12345678/count?fileFormat=application/pdf - Count recent content: GET /content/sds-12345678/count?dateFrom=2024-01-01T00:00:00Z - Combined filters: GET /content/sds-12345678/count?categoryId=123e4567-e89b-12d3-a456-426614174001&fileFormat=application/pdf Performance: - Optimized for large datasets using database indexes - Returns exact counts without loading content items into memory - Suitable for dashboard statistics and analytics
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/count
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/count
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/count
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/count?categoryId=123e4567-e89b-12d3-a456-426614174001&fileFormat=application%2Fpdf&dateFrom=2024-01-01T00%3A00%3A00Z&dateTo=2024-12-31T23%3A59%3A59Z' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "count": 42 }
Request
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" } ] } ] }
Text query for full-text search across content metadata (filename, metadata query/values, categories, etc.) - does not search the actual content body
Group content by version (category name + unique index metadata values)
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/fetch
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/fetch
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/fetch
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/fetch?cursor=123e4567-e89b-12d3-a456-426614174000&pageSize=20&fields=contentId%2CcategoryId%2CfileName' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"query": "annual report 2024",
"groupByVersion": false,
"filters": {
"contentId": "example-value",
"categoryId": "example-value",
"fileName": "example-value",
"fileFormat": "example-value",
"createdAt": "example-value",
"updatedAt": "example-value",
"metadata": {
"property1": "example-value",
"property2": "example-value"
}
}
}'Content items fetched successfully
Short dataspace ID with sds- prefix
Optional metadata for the content item
Optional record of inference task executions that modified this content
Related content versions that share the same version string (null when groupByVersion is false)
{ "contentItems": [ { … } ], "nextCursor": "123e4567-e89b-12d3-a456-426614174001", "totalItems": 42 }
Request
Triggers workflow execution for a specific content item and returns the complete workflow execution object. The system automatically selects the first available agent for the user's account. Workflow Ingestion Process: 1. Validates that the content item exists 2. Validates that the specified workflow exists 3. Automatically selects the first available agent for the user's account 4. Creates a workflow execution record 5. Executes all tasks in the workflow sequentially in the background using the selected agent 6. Returns the complete workflow execution object immediately Response Object: The endpoint returns a complete workflow execution object containing: - id: Unique identifier for this workflow execution - workflowId: ID of the workflow being executed - contentId: ID of the content being processed - dataspaceId: ID of the dataspace - status: Current status ('started', 'completed', or 'failed') - startedAt: Timestamp when execution began - completedAt: Timestamp when execution finished (null if still running) - errorMessage: Error details if execution failed (null if successful) Features: - Asynchronous workflow execution - Comprehensive validation before execution - Automatic agent selection for the user's account - Detailed logging and error handling - Database tracking of workflow and task executions - Complete workflow execution object response Example Usage: POST /api/content/sds-12345678/550e8400-e29b-41d4-a716-446655440000/ingest?workflowId=8a0667a8-a35e-4b0a-8a95-07b4fd5ac7de The workflow will execute in the background, and you can monitor its progress using the returned workflow execution object.
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/{contentId}/ingest
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/{contentId}/ingest
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/{contentId}/ingest
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/123e4567-e89b-12d3-a456-426614174000/ingest?workflowId=123e4567-e89b-12d3-a456-426614174002' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'{ "id": "123e4567-e89b-12d3-a456-426614174000", "workflowId": "987fcdeb-51a2-43d1-9c4e-5f6e7d8c9a0b", "primaryScopeObjectId": "456e7890-e89b-12d3-a456-426614174001", "primaryScopeDataspaceId": "sds-abc12345", "status": "completed", "startedAt": "2025-01-15T10:30:00Z", "completedAt": "2025-01-15T10:35:00Z", "errorMessage": "Workflow execution failed at step 3" }
Request
Performs intelligent queries on content using OpenAI's assistant with vector store access. Query Process: 1. Agent Selection: Uses the specified agent's instructions as the system prompt, or defaults to research assistant instructions 2. Content Filtering: Uses the provided filters to select relevant content items from the dataspace 3. Vector Store Access: Retrieves the dataspace's vector store containing document embeddings 4. AI Assistant Creation: Creates a temporary OpenAI assistant with access to the vector store 5. Query Execution: Processes the user's query against the filtered content using the AI assistant 6. Citation Parsing: Extracts file IDs from the AI response citations 7. Content Retrieval: Fetches full content objects for all cited documents Agent System: - Optional Agent ID: Provide an agentId to use custom agent instructions as the system prompt - Default Behavior: Without an agent ID, uses built-in research assistant instructions - Agent Instructions: The agent's instructions field becomes the system prompt for the AI assistant - Research Agent: Look for an agent named "Research Assistant Agent" for the default research experience Request Body: - filters: Advanced filtering options to select specific content (uses unified ContentFiltersSchema) - query: The question or query to ask about the filtered content - agentId: (Optional) UUID of the agent whose instructions to use as system prompt Response Fields: - query: The original user query - response: AI assistant's response with citations in simplified format - analyzedDocumentCount: Number of documents that were analyzed and available for querying - citedContent: Array of full content objects that were actually cited in the AI response Citation Format: The AI response includes citations in simplified format: 【0】, 【1】, etc., where numbers reference the citedContent array indices. Performance Notes: - Creates and destroys a temporary OpenAI assistant for each query - Processes up to 9999 content items for analysis - Response time depends on query complexity and document count - Agent lookup adds minimal overhead when agent ID is provided
The question or query to ask about the filtered content
Optional agent ID to use for the query. If provided, the agent's instructions will be used as the system prompt.
- Mock serverhttps://docs.syncdocs.ai/_mock/api/workspace-openapi/content/{dataspaceId}/query
- Production - Workspace Serviceshttps://your-workspace.syncdocs.ai/api/content/{dataspaceId}/query
- Development serverhttps://docs.syncdocs.ai/api/content/{dataspaceId}/query
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.syncdocs.ai/_mock/api/workspace-openapi/content/sds-abc12345/query \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"query": "What are the main themes discussed in these documents?",
"agentId": "01234567-89ab-cdef-0123-456789abcdef",
"context": {
"contentFilters": {
"contentId": "example-value",
"categoryId": "example-value",
"fileName": "example-value",
"fileFormat": "example-value",
"createdAt": "example-value",
"updatedAt": "example-value",
"metadata": {
"property1": "example-value",
"property2": "example-value"
}
},
"libraries": [
"01234567-89ab-cdef-0123-456789abcdef"
],
"includeWebSearchResults": false
}
}'Successfully queried content using AI assistant
The original query that was asked
The AI assistant's response to the query
Number of documents that were analyzed and available for querying
Array of content items that were cited in the AI response, including citation numbers
Unique identifier for the content item
Short dataspace ID with sds- prefix
ISO timestamp when the content was created
ISO timestamp when the content was last updated
UUID of the category this content belongs to
Optional metadata for the content item
Record of inference task executions that modified this content, mapping inference type to task execution ID
Version identifier based on category and unique metadata
Public URL to access the file
Detailed information about task executions
Related content items with the same version string
Array of web search results that were included in the AI response
Title of the web search result
URL of the web search result
Snippet/preview text from the web search result
Array of library pages that were cited in the AI response
Unique identifier for the source file
ID of the library this page belongs to
URL of the original web page
{ "query": "What are the main themes discussed in these documents?", "response": "Based on the documents in your collection, the main themes include...", "analyzedDocumentCount": 15, "citedContent": [], "webSearchResults": [], "citedLibraryPages": [] }