- Opt-in per request. Pass your key ID in the
MLE-KEY-IDheader to opt a request in. Requests without the header keep working as plain JSON, even if your entity has active keys — so you can roll MLE out endpoint by endpoint. - Symmetric. Payloads are sealed with AES-256-GCM using a shared 256-bit secret created in the dashboard. There are no key pairs, JWKs, or JWE envelopes to manage.
- Two-way. When a request opts in, Slash decrypts your request body with the key and encrypts the response body back to you with the same key.
The envelope
An MLE payload is a single-field JSON object:
Most AES-GCM implementations (WebCrypto, Node, Python, Java, Go) already emit
ciphertext || tag as one buffer, so building the envelope is just prepending
your IV and base64url-encoding.
Setup
1. Create an encryption key
In the dashboard, go to Settings → API → Encryption Keys and click Create Encryption Key. You get back two values:- Key ID (
tok_...) — the identifier you pass in theMLE-KEY-IDheader. Visible in the dashboard at any time. - Secret — a base64url-encoded 256-bit AES key.
2. Encrypt your request body
Decode the secret, then seal the JSON body into the envelope:3. Send the request with MLE-KEY-ID
Send the envelope as the request body and pass your key ID in the
MLE-KEY-ID header. Everything else about the request — URL, method, query
parameters, authentication — stays exactly the same.
4. Decrypt the response
Responses to opted-in requests are served as plainapplication/json
containing the same single-field envelope. Decrypt it with the same key:
Complete example
Node.js
Card reveals through vault.slash.com
MLE works on card reveals throughvault.slash.com exactly like on api.slash.com: pass MLE-KEY-ID, get the
same encrypted envelope back, decrypt with the same key.
Key management
- Multiple active keys can exist at once, so rotation is zero-downtime: create a new key, move your integration over, then revoke the old one.
- Revoke keys from the same dashboard page. Requests referencing a revoked
key are rejected with
400. - Key IDs are not secret — only the secret is. Treat the secret like an API key: keep it server-side, never ship it to a browser or mobile client.