Developers

Two ways to integrate. Your client encrypts with a password, and the server stores only the ciphertext. It never accepts a password, plaintext, or decryption key.

API Your program encrypts, then calls /api/v1 with the envelope.

MCP An agent calls tools. The hosted server accepts envelopes only. The local server encrypts on the machine running it.

Rules

  • Encrypt with Argon2id (m_kib 65536, t 3, p 1) and AES-256-GCM, then POST only the envelope.
  • The short code in /{sid} authorizes retrieve. No Authorization header is required for that call.
  • Receipt and manage tokens are returned once. Put them in URL fragments, and send them later as Authorization: Ccret-receipt … or Authorization: Ccret-manage ….
  • Anyone with the share link can fetch the ciphertext and may consume a retrieval. Only the password, sent separately, decrypts it.
  • The REST API does not generate passwords.

Addresses

Calls are same-origin, under /api/v1. Share links use the host that served the page.

  • Share: /{sid}
  • Receipt: /r/{sid}#kind=receipt&c=…
  • Manage: /m/{sid}#kind=manage&c=…

Create

POST /api/v1/secrets returns HTTP 200 with sid, expires_at, and capabilities.receipt / capabilities.manage. Optional fields are expires (1h, 24h, 48h, 7d, 30d, 365d) or expires_in_seconds, retrieval_mode (one_time, limited, unlimited), and retrieval_limit when limited. A paid price also requires Authorization: Ccret-wallet, Idempotency-Key, policy_version, and max_credits from POST /api/v1/pricing/quote. Wallet tokens are not accepted inside hosted MCP tool arguments; send them on the HTTP request, or use the REST API. Local MCP reads CCRET_WALLET_CREDENTIAL or a mode-0600 file.

The body must not include plaintext, password, passphrase, content, secret, or fragment_key. An envelope without Argon2id is rejected as password_envelope_required.

POST /api/v1/secrets
Content-Type: application/json

{
  "envelope": {
    "v": 1,
    "alg": { "content": "AES-256-GCM", "wrap": "AES-256-GCM", "kdf": "Argon2id" },
    "kdf_params": { "m_kib": 65536, "t": 3, "p": 1 },
    "salt_b64": "…",
    "wrap_nonce_b64": "…",
    "wrapped_cek_b64": "…",
    "content_nonce_b64": "…",
    "ciphertext_b64": "…"
  },
  "expires": "24h",
  "retrieval_mode": "one_time"
}

Retrieve

POST /api/v1/secrets/{sid}/retrieve needs no Authorization header. Idempotency-Key is optional. Success is { envelope }. GET on this path is HTTP 405 and does not release ciphertext.

POST /api/v1/secrets/{sid}/retrieve
Idempotency-Key: optional-client-key

Status

GET /api/v1/secrets/{sid}/status requires the receipt capability. The body includes status, expires_at, retrieval_mode, remaining, and delivery_error.

GET /api/v1/secrets/{sid}/status
Authorization: Ccret-receipt {receipt}

Revoke

POST /api/v1/secrets/{sid}/revoke requires the manage capability. The body is { sid, status }.

POST /api/v1/secrets/{sid}/revoke
Authorization: Ccret-manage {manage}

Errors

  • 401 — receipt or manage capability missing or wrong.
  • 404 — no secret for that short code.
  • 409 — retrieve already completed, or a conflicting update.
  • 410 — retrieval allowance used up, or the secret is expired or revoked.
  • 413 — envelope too large.
  • 502 — ciphertext could not be delivered.

Hosted MCP

POST /mcp speaks JSON-RPC 2.0. Methods are initialize, tools/list, and tools/call. The server identifies itself as ccret-mcp and speaks protocol 2024-11-05.

Tools accept an envelope, a short code, or a capability token. A call that includes password, plaintext, or passphrase is rejected.

  • ccret_quote — price from size_bytes and expires_in_seconds.
  • ccret_packages — list credit packages.
  • ccret_create — upload an envelope. Optional expires_in_seconds, retrieval_mode, retrieval_limit, policy_version, and max_credits. Do not put a wallet credential in the arguments.
  • ccret_retrieve — claim an envelope by sid. Optional idempotency_key.
  • ccret_status — receipt status. Requires sid and receipt.
  • ccret_revoke — revoke. Requires sid and manage.
POST /mcp
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ccret_create",
    "arguments": { "envelope": { "v": 1 } }
  }
}

Local MCP

node packages/mcp-local/src/stdio.mjs speaks the same JSON-RPC methods over stdin, one message per line. Encryption happens on that machine. The password is not sent to ccret.cc.

  • ccret_encrypt_password — encrypt locally. Arguments are password and plaintext.
  • ccret_decrypt_password — decrypt locally. Arguments are password and envelope.
  • ccret_generate_passphrase — generate a passphrase locally. Optional words, default 6.
  • ccret_upload — POST an envelope to base_url + /api/v1/secrets. The body is ciphertext only.

When the Rust ccret-vector binary is built, local encrypt and decrypt use it. Otherwise they use the TypeScript SDK on the same machine.