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.

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

Base URL
https://api.knoxapi.com

Create an ephemeral key

POST/v1/ephemeral_keys

Creates a short-lived API key for a given resource.

Body parameters

  • customerstring

    The ID of the Customer you'd like to modify using the resulting ephemeral key.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • issuing_cardstring

    The ID of the Issuing Card you'd like to access using the resulting ephemeral key.

  • noncestring

    A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information.

  • verification_sessionstring

    The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key

Returns

The ephemeral_key object.

POST /v1/ephemeral_keys
curl -X POST https://api.knoxapi.com/v1/ephemeral_keys \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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 strings

    Specifies which fields in the response should be expanded.

Returns

The ephemeral_key object.

DELETE /v1/ephemeral_keys/{key}
curl -X DELETE https://api.knoxapi.com/v1/ephemeral_keys/ephkey_1Pgc6sB7WZ01zgkWtBC5cOXH \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "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.