Skip to content

Buckets

Show:

A bucket is Schift’s public knowledge-storage surface. Use buckets to upload documents, check indexing readiness, search answer-ready context with citations, and manage the documents that belong to a knowledge base.

Note: All bucket endpoints require an Authorization: Bearer <SCHIFT_API_KEY> header. Endpoints that create, modify, or delete buckets or documents require the buckets:manage scope. Read and search endpoints accept any valid API key subject to organization limits.

The public product API is v2. New integrations should use the /v2/buckets/* routes documented below.

The older /v1/buckets/* routes are a deprecated compatibility surface for existing clients. They continue to work, but v1 search endpoints return Deprecation and Link successor-version headers pointing to the v2 equivalents. Public buckets are read-only on both versions.

FieldTypeDescription
idstringUnique bucket identifier.
namestringHuman-readable bucket name.
descriptionstringOptional description.
dimensionintegerEmbedding dimension configured for the bucket.
modelstringEmbedding model used for the bucket.
backendstringVector backend, for example engine.
file_countintegerNumber of uploaded documents.
vector_countintegerNumber of indexed vectors.
active_job_countintegerNumber of in-progress jobs for this bucket.
created_atstringISO 8601 creation timestamp.
default_privacy_levelintegerDefault privacy level for bucket content.
max_privacy_levelintegerMaximum privacy level allowed.
external_max_privacy_levelintegerMaximum privacy level exposed externally.
enforce_access_policybooleanWhether access policies are enforced.
scope_by_departmentbooleanWhether access is scoped by department metadata.

Create a new bucket. Schift auto-configures the embedding model, dimension, and backend.

FieldTypeRequiredDefaultDescription
namestringYesBucket name. Must not start with __schift_.
descriptionstringNo""Optional description.
metadataobjectNonullFree-form user metadata.
default_privacy_levelintegerNo3Default privacy level.
max_privacy_levelintegerNo10Maximum privacy level.
external_max_privacy_levelintegerNo1External privacy ceiling.
enforce_access_policybooleanNotrueEnable access-policy enforcement.
scope_by_departmentbooleanNofalseScope access by department.
{
"name": "product-docs",
"description": "Product support knowledge"
}
{
"id": "bucket_01J8X1234567890ABCDEF",
"name": "product-docs",
"description": "Product support knowledge",
"dimension": 1024,
"model": "text-embedding-3-large",
"backend": "engine",
"file_count": 0,
"vector_count": 0,
"active_job_count": 0,
"created_at": "2026-06-19T05:00:00Z",
"default_privacy_level": 3,
"max_privacy_level": 10,
"external_max_privacy_level": 1,
"enforce_access_policy": false,
"scope_by_department": false
}
StatusCause
400Invalid request body.
403Bucket name uses the reserved __schift_ namespace.
409A bucket with this name already exists.

List buckets for the authenticated organization.

[
{
"id": "bucket_01J8X1234567890ABCDEF",
"name": "product-docs",
"description": "Product support knowledge",
"dimension": 1024,
"model": "text-embedding-3-large",
"backend": "engine",
"file_count": 12,
"vector_count": 128,
"active_job_count": 0,
"created_at": "2026-06-19T05:00:00Z",
"default_privacy_level": 3,
"max_privacy_level": 10,
"external_max_privacy_level": 1,
"enforce_access_policy": false,
"scope_by_department": false
}
]

Retrieve a single bucket by ID.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.

Same shape as the POST /v2/buckets response.

StatusCause
404Bucket not found or not accessible.

Modify mutable bucket fields. Currently supports renaming, updating the description, and updating metadata including privacy policy fields.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.

All fields are optional.

FieldTypeDescription
namestringNew bucket name.
descriptionstringNew description.
metadataobjectFree-form metadata merged into existing metadata.
default_privacy_levelintegerDefault privacy level.
max_privacy_levelintegerMaximum privacy level.
external_max_privacy_levelintegerExternal privacy ceiling.
enforce_access_policybooleanEnable access-policy enforcement.
scope_by_departmentbooleanScope access by department.
{
"description": "Updated product support knowledge"
}

Same shape as the POST /v2/buckets response.

StatusCause
403Public buckets are read-only.
404Bucket not found.
409The new bucket name is already taken.

Queue a bucket for deletion. Deletion is performed asynchronously and returns a job ID.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
{
"bucket_id": "bucket_01J8X1234567890ABCDEF",
"job_id": "job_01J8Y1234567890ABCDEF",
"status": "queued",
"delete_requested_at": "2026-06-19T05:05:00Z"
}
StatusCause
403Public buckets are read-only.
404Bucket not found.

List the child collections inside a bucket.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
[
{
"id": "col_01J8X1234567890ABCDEF",
"bucket_id": "bucket_01J8X1234567890ABCDEF",
"name": "migration-guides",
"description": "",
"dimension": 1024,
"model": "text-embedding-3-large",
"backend": "engine",
"file_count": 4,
"vector_count": 42,
"active_job_count": 0
}
]
StatusCause
404Bucket not found.

Check whether a bucket is ready to answer questions. This endpoint returns a consumer-facing readiness summary without running a search.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
{
"status": "ready",
"operational_status": "ready",
"bucket_id": "product-docs",
"indexed_count": 128,
"document_count": 12,
"pending_job_count": 0,
"failed_job_count": 0,
"last_indexed_at": "2026-06-19T04:55:00Z",
"backfill_required": false
}
StatusCause
404Bucket not found.

Run the managed knowledge-search pipeline and return answer-ready context with citations. Callers do not need to choose embedding routes, vector modes, or rerank machinery.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
FieldTypeRequiredDefaultDescription
querystringYesQuestion to ask against the bucket.
top_kintegerNo8Maximum cited passages to return. Range 1100.
context_budgetintegerNo2000Approximate maximum context size in tokens. Range 10032000.
filtersobjectNonullMetadata filters. See Filters.
options.rerank.enabledbooleanNotrueImprove citation ordering before context assembly.
options.rerank.top_kintegerNonullCandidate passages to rerank. Range 11000.
options.instructions.taskstringNonullSearch instruction preset such as retrieval_query.
{
"query": "How do I migrate embedding models?",
"top_k": 8,
"context_budget": 4000,
"filters": {"product": "schift"},
"options": {
"rerank": {"enabled": true, "top_k": 20},
"instructions": {"task": "retrieval_query"}
}
}
{
"status": "ready",
"operational_status": "ready",
"bucket_id": "product-docs",
"query": "How do I migrate embedding models?",
"context": "[1] Migration guide excerpt...",
"citations": [
{
"index": 1,
"document_id": "doc_042",
"source_id": "doc_042",
"title": "Migration Guide",
"source_url": null,
"page": null,
"section": null
}
],
"warnings": []
}
StatusCause
400Invalid filter or request body.
402Search quota exceeded.
403Search quota unavailable or plan restriction.
404Bucket not found.

POST /v2/buckets/{bucket_id}/collections/{collection_id}/search

Section titled “POST /v2/buckets/{bucket_id}/collections/{collection_id}/search”

Search a single collection within a bucket using the raw v2 search contract. This is useful when you want results from a specific child collection rather than the whole bucket.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
collection_idstringYesCollection identifier.
FieldTypeRequiredDefaultDescription
querystringYes*""Text query. Either query or queryVector is required.
queryVectornumber[]Yes*nullRaw embedding vector.
topKintegerNo10Maximum results. Range 11000.
modelstringNonullEmbedding model override.
filterobjectNonullMetadata filter.
accessModestringNoautoOne of auto, internal, external. raw is internal-only.
modestringNohybridvector or hybrid.
rerankbooleanNofalseEnable reranking.
rerankTopKintegerNonullCandidate count for reranking.
minScorenumberNonullMinimum result score. Range 01.
debugbooleanNofalseInclude debug timing and scores.
{
"bucket_id": "product-docs",
"query": "migration",
"search_id": "search_01J8X1234567890ABCDEF",
"results": [
{
"id": "chunk_042",
"score": 0.923,
"text": "Migration guide excerpt...",
"metadata": {"document_id": "doc_042"},
"citation": null
}
],
"degraded": false,
"warnings": []
}
StatusCause
400Missing query or queryVector, or invalid temporal parameters.
403raw retrieval mode is internal-only.
404Bucket or collection not found.

Upload one or more files into a bucket. Uploaded files are extracted, chunked, embedded, and indexed asynchronously. This endpoint accepts multipart/form-data.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
FieldTypeRequiredDefaultDescription
filesfileYesOne or more files. PDFs, Markdown, text, Office documents, and images are supported.
ocr_strategystringNoautoOCR strategy for image-based documents.
chunk_sizeintegerNo512Target chunk size. Range 648192.
chunk_overlapintegerNo50Chunk overlap. Range 0512.
metadatastringNonullJSON-stringified object attached to every uploaded file.
collection_idstringNonullTarget child collection. Defaults to the bucket.
Terminal window
curl -X POST ${API_BASE_URL}/v2/buckets/product-docs/documents \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-F "ocr_strategy=auto" \
-F "chunk_size=512" \
-F 'metadata={"source":"support","product":"schift"}'
{
"jobs": [
{
"job_id": "job_01J8X1234567890ABCDEF",
"document_id": "doc_01J8X1234567890ABCDEF",
"file_name": "manual.pdf",
"file_type": "pdf",
"status": "queued",
"estimated_cost": 0.05
}
],
"total_estimated_cost": 0.05
}
StatusCause
400Unsupported file type or invalid form data.
403API key lacks the buckets:manage scope.
404Bucket not found.
413File or request exceeds upload limits.

List documents in a bucket.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
ParameterTypeRequiredDefaultDescription
statusstringNoFilter by document status.
limitintegerNo50Maximum results. Range 1500.
[
{
"id": "doc_01J8X1234567890ABCDEF",
"bucket_id": "product-docs",
"collection_id": null,
"file_name": "manual.pdf",
"file_type": "pdf",
"status": "ready",
"metadata": {"source": "support", "product": "schift"},
"source_metadata": {},
"latest_job_id": "job_01J8X1234567890ABCDEF",
"latest_successful_job_id": "job_01J8X1234567890ABCDEF",
"last_error_summary": null,
"created_at": "2026-06-19T04:00:00Z",
"updated_at": "2026-06-19T04:05:00Z"
}
]
StatusCause
404Bucket not found.

GET /v2/buckets/{bucket_id}/documents/{document_id}

Section titled “GET /v2/buckets/{bucket_id}/documents/{document_id}”

Retrieve a single document by ID.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
document_idstringYesDocument identifier.

Same shape as a single item in the GET /v2/buckets/{bucket_id}/documents response.

StatusCause
404Bucket or document not found.

PATCH /v2/buckets/{bucket_id}/documents/{document_id}

Section titled “PATCH /v2/buckets/{bucket_id}/documents/{document_id}”

Update a document’s metadata. Changes that affect search visibility trigger a reindex by default.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
document_idstringYesDocument identifier.
FieldTypeRequiredDefaultDescription
metadataobjectNo{}Metadata to merge.
public_accessiblebooleanNonullWhether the document is publicly accessible.
privacy_levelintegerNonullPrivacy level. Range 110.
classificationstringNonullOne of internal, public, restricted, confidential.
review_statusstringNonullOne of pending, approved, rejected.
reindexbooleanNotrueQueue reindexing after the update.

Same shape as the GET /v2/buckets/{bucket_id}/documents/{document_id} response.

StatusCause
400Invalid metadata.
404Bucket or document not found.

DELETE /v2/buckets/{bucket_id}/documents/{document_id}

Section titled “DELETE /v2/buckets/{bucket_id}/documents/{document_id}”

Queue a document for hard deletion. Deletion is performed asynchronously and returns a job ID.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
document_idstringYesDocument identifier.
{
"bucket_id": "product-docs",
"document_id": "doc_01J8X1234567890ABCDEF",
"job_id": "job_01J8Y1234567890ABCDEF",
"status": "queued",
"delete_requested_at": "2026-06-19T05:10:00Z"
}
StatusCause
404Bucket or document not found.

List metadata keys that appear across documents in a bucket, together with their most common values.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
ParameterTypeRequiredDefaultDescription
limitintegerNo500Maximum documents scanned for keys. Range 12000.
values_per_keyintegerNo20Maximum values returned per key. Range 0100.
{
"bucket_id": "product-docs",
"keys": [
{
"key": "product",
"document_count": 12,
"values": [
{"value": "schift", "count": 10},
{"value": "docs", "count": 2}
]
}
]
}
StatusCause
404Bucket not found.

GET /v2/buckets/{bucket_id}/metadata-keys/{key}/values

Section titled “GET /v2/buckets/{bucket_id}/metadata-keys/{key}/values”

List the values observed for a specific metadata key.

ParameterTypeRequiredDescription
bucket_idstringYesBucket identifier.
keystringYesMetadata key.
ParameterTypeRequiredDefaultDescription
limitintegerNo100Maximum distinct values. Range 11000.
document_limitintegerNo2000Maximum documents scanned. Range 110000.
{
"bucket_id": "product-docs",
"key": "product",
"values": [
{"value": "schift", "count": 10},
{"value": "docs", "count": 2}
]
}
StatusCause
404Bucket not found or metadata key not found.

Deprecated. Creates a new bucket. Use POST /v2/buckets instead.

Deprecated. Lists buckets for the authenticated organization. Use GET /v2/buckets instead.

Deprecated. Retrieves a single bucket by ID. Use GET /v2/buckets/{bucket_id} instead.

Deprecated. Updates mutable bucket fields. Use PATCH /v2/buckets/{bucket_id} instead.

Deprecated. Queues a bucket for deletion. Use DELETE /v2/buckets/{bucket_id} instead.

Deprecated. Lists the child collections inside a bucket. Use GET /v2/buckets/{bucket_id}/collections instead.

Deprecated. Uploads files into a bucket. Use POST /v2/buckets/{bucket_id}/documents instead.

Deprecated. Runs a raw bucket search that returns scored result items. Use POST /v2/buckets/{bucket_id}/collections/{collection_id}/search for the raw v2 search contract, or POST /v2/buckets/{bucket_id}/search for managed knowledge search with citations.