Doc Store/collections
Returns a list of all document collections with their IDs and names. Collections are returned in no particular order. Use this to discover available collections before querying documents.
The list of collections has been successfully retrieved.
GET /sfp/api/doc-store/collections HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
The list of collections has been successfully retrieved.
No content
Creates a new document collection with the specified name. Collections are logical groupings of related documents. Returns a unique collection ID. Fails if a collection with the same name already exists.
The collection has been successfully created.
The collection already exists.
POST /sfp/api/doc-store/collections HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"name": "text"
}
No content
Retrieves a collection by name along with all documents it contains. This can be expensive for large collections. Consider using the query endpoint with pagination for better performance on large datasets. Use store=changelog to retrieve from the dedicated changelog table.
Target store for the collection. Defaults to "doc" for backward compatibility.
The collection and its documents have been successfully retrieved.
The collection was not found.
GET /sfp/api/doc-store/collections/{collectionName} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Permanently deletes an entire collection and all its documents. This destructive operation: - Removes the collection and ALL documents within it - Cannot be undone - all data is permanently lost - Frees up the collection name for reuse
Use with extreme caution. Consider backing up important data before deletion. This endpoint requires elevated privileges.
The collection has been successfully deleted.
The collection was not found.
DELETE /sfp/api/doc-store/collections/{collectionName} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
DEPRECATED: This endpoint has issues with nested collection names (e.g., 'org/repo/collection'). Please use the cross-collection query endpoint at POST /doc-store/collections/query with pathPattern instead.
Executes advanced queries against documents in a specific collection. Features include:
- Complex filtering with multiple operators (eq, ne, gt, lt, gte, lte, in, nin, regex)
- Nested field queries using dot notation (e.g., 'user.email')
- Sorting by multiple fields with ascending/descending order
- Pagination support with limit and offset
- Field projection to return only specific fields
This is the recommended way to retrieve documents when you need specific filtering or working with large collections.
Maximum number of results to return
10
Number of results to skip
0
Query executed successfully.
POST /sfp/api/doc-store/collections/{collectionName}/query HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 104
{
"pathPattern": "<your-collection-name>",
"filters": [
{
"field": "status",
"operator": "eq",
"value": "active"
}
]
}
Query executed successfully.
[
{
"collection": "text",
"key": "text",
"value": {},
"version": 1
}
]
Executes queries across multiple collections using path patterns. This powerful endpoint allows: - Querying single collections by exact path (e.g., 'org/repo/builds-v2') - Wildcard patterns to match multiple collections (e.g., 'repo_*/metadata') - Cross-collection queries for impact analysis and health checks - All standard query features (filtering, sorting, pagination) - Properly handles nested collection names with slashes - Use store=changelog to query the dedicated changelog table
**This is the recommended endpoint for all collection queries**, as it correctly handles nested collection paths.
Common use cases:
- Query specific collections with nested names (e.g., 'flxbl-io/sf-core/builds-v2')
- Find all metadata across repositories
- Search for specific configurations across environments
- Aggregate data from multiple sources
Target store for the query. Defaults to "doc" for backward compatibility.
Maximum number of results to return
10
Number of results to skip
0
Collection path pattern to match
repo-id/packages/core_crm
Include sub-collections in search
false
Query executed successfully.
POST /sfp/api/doc-store/collections/query HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 104
{
"pathPattern": "<your-collection-name>",
"filters": [
{
"field": "status",
"operator": "eq",
"value": "active"
}
]
}
Query executed successfully.
[
{
"collection": "text",
"key": "text",
"value": {},
"version": 1
}
]
Retrieves a single document by its key from the specified collection. Returns: - The document value as stored - The current version number for optimistic concurrency control - Use store=changelog to retrieve from the dedicated changelog table
Use this endpoint when you know the exact document key. For searching or filtering, use the query endpoints instead.
Target store for the document. Defaults to "doc" for backward compatibility.
The document has been successfully retrieved.
The collection or document was not found.
GET /sfp/api/doc-store/collections/{collectionName}/docs/{key} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Creates a new document or updates an existing one in the specified collection. Implements optimistic concurrency control: - For new documents: Do not provide a version number - For updates: Must provide the current version number to prevent concurrent modification conflicts - Version numbers are automatically incremented on successful updates - Use store=changelog to store in the dedicated changelog table (optimized for write-heavy operations)
The document value can be any valid JSON structure. Collections are created automatically if they don't exist. Returns the document with its new version number.
Target store for the document. Defaults to "doc" for backward compatibility.
Required for updates, must not be provided for new documents
The document has been successfully created or updated in the collection.
The collection was not found.
Version conflict or invalid version usage.
POST /sfp/api/doc-store/collections/{collectionName}/docs/{key} HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"value": {},
"version": 1
}
No content
Permanently deletes a specific document from a collection. This operation: - Removes the document immediately and permanently - Cannot be undone - ensure you have backups if needed - Does not affect other documents in the collection - Use store=changelog to delete from the dedicated changelog table
Requires owner or application role for security. The collection itself remains even if it becomes empty.
Target store for the document. Defaults to "doc" for backward compatibility.
The document has been successfully deleted.
The collection or document was not found.
DELETE /sfp/api/doc-store/collections/{collectionName}/docs/{key} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Retrieves only the version number of a document without its content. This lightweight endpoint is useful for: - Checking if a document has been modified before fetching - Verifying version before updates to prevent conflicts - Monitoring document changes - Use store=changelog to check version in the dedicated changelog table
Returns only the version number, making it efficient for version checks.
Target store for the document. Defaults to "doc" for backward compatibility.
The document version has been successfully retrieved.
The collection or document was not found.
GET /sfp/api/doc-store/collections/{collectionName}/docs/{key}/version HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Retrieves a list of all document keys and versions in a collection without their content. This endpoint: - Returns only keys and version numbers, not document values - Useful for discovering available documents - Efficient for large collections as it doesn't transfer document content
For retrieving actual document content, use the query endpoint or get individual documents by key.
The list of documents has been successfully retrieved.
The collection was not found.
GET /sfp/api/doc-store/collections/{collectionName}/docs HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Was this helpful?