Skip to main content
Message Level Encryption (MLE) encrypts the JSON body of an API request and response with a key that only you and Slash hold, adding a second layer of protection on top of TLS. Even if a request or response is logged or intercepted anywhere in between, the payload stays opaque. MLE is:
  • Opt-in per request. Pass your key ID in the MLE-KEY-ID header 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 the MLE-KEY-ID header. Visible in the dashboard at any time.
  • Secret — a base64url-encoded 256-bit AES key.
The secret is shown exactly once, at creation time. Store it in your secret manager immediately — if you lose it, revoke the key and create a new one.

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.
GET requests have no body to encrypt — just pass the header and the response comes back encrypted.

4. Decrypt the response

Responses to opted-in requests are served as plain application/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 through vault.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.

Errors

MLE failures use the standard error envelope and fail closed — an opted-in request is never silently processed or answered in plaintext.