API reference
Ephemeral Keys
Ephemeral keys give the SDKs (like Stripe's mobile SDKs and Issuing Elements) temporary, scoped access to a specific resource, such as a Customer, Issuing Card, or Identity VerificationSession, without exposing your secret API key. Related guides: Using Issuing Elements.
https://api.knoxapi.comCreate an ephemeral key
POST/v1/ephemeral_keys
Creates a short-lived API key for a given resource.
Body parameters
customerstringThe ID of the Customer you'd like to modify using the resulting ephemeral key.
expandarray of stringsSpecifies which fields in the response should be expanded.
issuing_cardstringThe ID of the Issuing Card you'd like to access using the resulting ephemeral key.
noncestringA single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information.
verification_sessionstringThe ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key
Returns
The ephemeral_key object.
curl -X POST https://api.knoxapi.com/v1/ephemeral_keys \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('POST', '/v1/ephemeral_keys');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("post", "/v1/ephemeral_keys")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:post, '/v1/ephemeral_keys'){
"created": 1234567890,
"expires": 1234567890,
"id": "ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH",
"livemode": false,
"object": "ephemeral_key"
}Immediately invalidate an ephemeral key
DELETE/v1/ephemeral_keys/{key}
Invalidates a short-lived API key for a given resource.
Path parameters
keystringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The ephemeral_key object.
curl -X DELETE https://api.knoxapi.com/v1/ephemeral_keys/ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('DELETE', '/v1/ephemeral_keys/ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("delete", "/v1/ephemeral_keys/ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:delete, '/v1/ephemeral_keys/ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH'){
"created": 1234567890,
"expires": 1234567890,
"id": "ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH",
"livemode": false,
"object": "ephemeral_key"
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.