Skip to main content
PymtHouse issues long-lived opaque API keys prefixed pmth_*. These complement short-lived JWTs: instead of repeating a device login or a full OAuth flow, your integration exchanges a stored API key for a short-lived JWT on demand. Two types of API keys exist:

Per-user API keys

Issue long-lived API keys to specific end-users. These are suitable for CLI tools and service accounts where the user authenticates once and stores the key.

Create a key

The full pmth_* secret is returned once only at creation time. Store it securely.
Response:

List keys

Returns key IDs and creation timestamps. The pmth_* value is never returned after creation.

Revoke a key

Revocation is immediate. Any exchange request using the revoked key returns 401.

App-level API keys

App-level keys are tied to a subscription and suitable for app-wide machine access without a specific user context.
Auth: provider dashboard session. Returns the same pmth_ak_… format.

Exchange API key → short-lived JWT

Exchange a pmth_* API key for a short-lived user JWT using Bearer auth:
Optional request body:
Response: OIDC token bundle.
SDK:

Exchange API key → signer session

Skip the separate signer session exchange by using the SDK helper, which calls the API key token endpoint and then performs the RFC 8693 exchange in one step:

Validate an API key (subscription-backed)

To validate a Bearer pmth_* key and check the associated plan and capabilities, use the internal validation endpoint. This is used by integrations that need to gate access before processing a request:
Returns { valid: true, planId: "...", capabilities: [...] } on success.

Security guidance

  • Store API keys in a secret manager, not in source code or environment files committed to version control.
  • The pmth_* secret is returned once at creation. If lost, revoke the key and create a new one.
  • Prefer short-lived JWTs (5-minute TTL) on the signing hot path; exchange the stored API key on demand rather than using it directly as a Bearer token for signing.
  • Revoke keys immediately when a user is deactivated or an integration is disconnected.
  • Use per-user keys (not the M2M client secret pmth_cs_…) for end-user-facing integrations so revocation is scoped to one user.