Doc Store/collections

List all collections

get

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.

Authorizations
Responses
200

The list of collections has been successfully retrieved.

get
GET /sfp/api/doc-store/collections HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

The list of collections has been successfully retrieved.

No content

Create a new collection

post

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.

Authorizations
Body
namestringOptional
Responses
200

The collection has been successfully created.

post
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

Get a specific collection including all documents

get

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.

Authorizations
Path parameters
collectionNamestringRequired
Query parameters
storestring · enumOptional

Target store for the collection. Defaults to "doc" for backward compatibility.

Possible values:
Responses
200

The collection and its documents have been successfully retrieved.

get
GET /sfp/api/doc-store/collections/{collectionName} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Delete an entire collection

delete

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.
Authorizations
Path parameters
collectionNamestringRequired
Responses
204

The collection has been successfully deleted.

delete
DELETE /sfp/api/doc-store/collections/{collectionName} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Deprecated

Query documents in a collection (DEPRECATED)

post

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.
Authorizations
Path parameters
collectionNamestringRequired
Body
limitnumberOptional

Maximum number of results to return

Example: 10
offsetnumberOptional

Number of results to skip

Example: 0
Responses
200

Query executed successfully.

application/json
post
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"
    }
  ]
}
200

Query executed successfully.

[
  {
    "collection": "text",
    "key": "text",
    "value": {},
    "version": 1
  }
]

Query documents across collections (RECOMMENDED)

post

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
Authorizations
Query parameters
storestring · enumOptional

Target store for the query. Defaults to "doc" for backward compatibility.

Possible values:
Body
limitnumberOptional

Maximum number of results to return

Example: 10
offsetnumberOptional

Number of results to skip

Example: 0
pathPatternstringOptional

Collection path pattern to match

Example: repo-id/packages/core_crm
recursivebooleanOptional

Include sub-collections in search

Default: false
Responses
200

Query executed successfully.

application/json
post
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"
    }
  ]
}
200

Query executed successfully.

[
  {
    "collection": "text",
    "key": "text",
    "value": {},
    "version": 1
  }
]

Get a specific document from a collection

get

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.
Authorizations
Path parameters
keystringRequired
collectionNamestringRequired
Query parameters
storestring · enumOptional

Target store for the document. Defaults to "doc" for backward compatibility.

Possible values:
Responses
200

The document has been successfully retrieved.

get
GET /sfp/api/doc-store/collections/{collectionName}/docs/{key} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Create or update a document in a collection

post

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.
Authorizations
Path parameters
keystringRequired
collectionNamestringRequired
Query parameters
storestring · enumOptional

Target store for the document. Defaults to "doc" for backward compatibility.

Possible values:
Body
valueobjectRequired
versionnumberOptional

Required for updates, must not be provided for new documents

Responses
201

The document has been successfully created or updated in the collection.

post
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

Delete a document from a collection

delete

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.
Authorizations
Path parameters
keystringRequired
collectionNamestringRequired
Query parameters
storestring · enumOptional

Target store for the document. Defaults to "doc" for backward compatibility.

Possible values:
Responses
204

The document has been successfully deleted.

delete
DELETE /sfp/api/doc-store/collections/{collectionName}/docs/{key} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Get the version of a specific document from a collection

get

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.
Authorizations
Path parameters
keystringRequired
collectionNamestringRequired
Query parameters
storestring · enumOptional

Target store for the document. Defaults to "doc" for backward compatibility.

Possible values:
Responses
200

The document version has been successfully retrieved.

get
GET /sfp/api/doc-store/collections/{collectionName}/docs/{key}/version HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

List all documents in a collection

get

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.
Authorizations
Path parameters
collectionNamestringRequired
Responses
200

The list of documents has been successfully retrieved.

get
GET /sfp/api/doc-store/collections/{collectionName}/docs HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Was this helpful?