Skip to Content
We are live but in Staging 🎉
API ReferenceStorageService API

StorageService API

Package: dodil.k3.storage.v1

StorageService owns bucket control-plane and object metadata/admin operations.

What It Is For

  • Provision and manage K3 buckets.
  • Control bucket access policy and CORS.
  • List object metadata, inspect single objects, delete objects, and issue object URLs.
  • Provide an AWS S3-compatible storage surface for bucket/object workflows.

AWS S3 Compatibility

StorageService is designed for AWS S3-compatible behavior for core storage operations.

Compatibility highlights:

  1. Bucket/object model follows standard S3 semantics.
  2. Policy actions use S3-style action names (for example s3:GetObject).
  3. Object APIs support familiar patterns: prefix listing, key-based object access, and temporary URL generation.

Practical notes:

  1. K3 keeps compatibility at the storage surface while adding K3-specific domain APIs (source, pipeline, ingest, vector, table).
  2. Route shapes are K3 service routes (not raw S3 REST endpoint parity), so treat K3 API docs as canonical for request paths.

Endpoint Map

Buckets

gRPC methodHTTP route
CreateBucketPOST /admin/buckets
ListBucketsGET /admin/buckets
GetBucketGET /admin/buckets/:name
UpdateBucketPATCH /admin/buckets/:name
DeleteBucketDELETE /admin/buckets/:name

Bucket Policy

gRPC methodHTTP route
SetBucketPolicyPUT /admin/buckets/:name/policy
GetBucketPolicyGET /admin/buckets/:name/policy
DeleteBucketPolicyDELETE /admin/buckets/:name/policy

Bucket CORS

gRPC methodHTTP route
PutBucketCorsPUT /admin/buckets/:name/cors
GetBucketCorsGET /admin/buckets/:name/cors
DeleteBucketCorsDELETE /admin/buckets/:name/cors

Objects

gRPC methodHTTP route
ListObjectsGET /:bucket/objects
GetObjectInfoGET /:bucket/objects/:key/info
DeleteObjectDELETE /:bucket/objects/:key
GetObjectUrlGET /:bucket/objects/:key/url

Key Arguments

Create/Update bucket

FieldTypeRequiredPurpose
namestringyes (create)Bucket identifier, unique per tenant
descriptionstringnoHuman-readable bucket summary
storage_quota_bytesint64noQuota limit, 0 means unlimited
access_modeenumnoPRIVATE, PUBLIC, or CUSTOM

List buckets

FieldTypeRequiredPurpose
pagination.page_sizeint32noCursor page size
pagination.page_tokenstringnoCursor for next page
searchstringnoCase-insensitive name/description match

List objects

FieldTypeRequiredPurpose
bucketstringyesTarget bucket
prefixstringnoPrefix filter (docs/, 2026/05/)
delimiterstringnoFolder-like grouping, usually /
max_keysint32noMax objects to return
continuation_tokenstringnoCursor token for next page

Bucket policy statement

FieldTypeRequiredPurpose
sidstringnoStatement ID label
effectenumyesALLOW or DENY
principal.awsstring[]yesPrincipals or *
actionsstring[]yesS3-style action list
resourcesstring[]yesResource patterns

Get object URL

FieldTypeRequiredPurpose
path :bucketstringyesTarget bucket
path :keystringyesObject key (URL-encoded)
expires_in_secondsint64noURL TTL, defaults to 3600

Examples

Create a bucket

curl -sS -X POST "https://k3.dev.dodil.io/admin/buckets" \ -H "Authorization: Bearer $K3_TOKEN" \ -H "x-organization-id: $K3_ORG" \ -H "Content-Type: application/json" \ -d '{ "name": "kb-prod", "description": "Production knowledge base", "access_mode": "BUCKET_ACCESS_MODE_PRIVATE", "storage_quota_bytes": 0 }'

Set bucket policy

curl -sS -X PUT "https://k3.dev.dodil.io/admin/buckets/kb-prod/policy" \ -H "Authorization: Bearer $K3_TOKEN" \ -H "x-organization-id: $K3_ORG" \ -H "Content-Type: application/json" \ -d '{ "policy": { "version": "2024-01-01", "statements": [ { "sid": "allow-read", "effect": "POLICY_EFFECT_ALLOW", "principal": {"aws": ["*"]}, "actions": ["s3:GetObject"], "resources": ["arn:aws:s3:::kb-prod/public/*"] } ] } }'

List objects by prefix

curl -sS "https://k3.dev.dodil.io/kb-prod/objects?prefix=docs/&max_keys=100" \ -H "Authorization: Bearer $K3_TOKEN" \ -H "x-organization-id: $K3_ORG"

Get a temporary object URL

curl -sS "https://k3.dev.dodil.io/kb-prod/objects/docs%2Fcontract.pdf/url?expires_in_seconds=900" \ -H "Authorization: Bearer $K3_TOKEN" \ -H "x-organization-id: $K3_ORG"

Common Use Cases

  1. Create tenant or environment buckets (dev, stage, prod).
  2. Apply explicit policy/CORS before exposing browser downloads.
  3. Build housekeeping jobs using object metadata and delete operations.
  4. Generate short-lived URLs for controlled sharing.

Next: SourceService