Vault

Files API

Completed upload and download operations for your backend.

Upload a file

POST/v1/vault/filesclient secret
{
  "owner_user_id": "u_1001",
  "file_kind": "kyc_document",
  "allowed_content_types": ["image/jpeg", "application/pdf"],
  "max_size_bytes": 10485760,
  "original_filename": "passport.pdf",
  "content_type": "application/pdf",
  "content_base64": "JVBERi0x…"
}
→ 201 { "file_id": "file_…", "status": "active", "size_bytes": 842119 }

DevSewa validates size and content type, derives the tenant, creates the grant and finalises the upload. Your backend never receives the grant or a private vault URL.

Download a file

POST/v1/vault/files/{file_id}/downloadclient secret

Send subject_user_id. DevSewa verifies the file in the derived tenant, consumes the one-time grant and returns the content to your backend. Never relay this response through public browser code without your own authorization check.

Capability boundary

Vault HMAC secrets, grant tokens, private Trusted URLs, storage-area ids and storage configuration stay server-side. Do not log or persist a one-time capability, and do not retry it blindly.