Help centre

OAuth2 clients and API keys

When to use a static key and when to register an OAuth application, with client credentials, authorization code and PKCE.

There are two ways to authenticate with the API. A static API key is simplest. An OAuth2 application gives you short-lived access tokens, and it is where you register the origins allowed to frame embedded signing.

API keys

A static secret (sk_live_… or sk_test_…) that acts as the user who created it. Right for wiring SignSpry into your own systems. Create one under API & webhooks → Keys & webhooks, choosing its scopes, expiry and optional IP allowlist. See API keys.

OAuth2 applications

Under API & webhooks → OAuth applications, fill in:

  • Application name and Mode (Live or Test; a test application's tokens work in the sandbox).
  • Redirect URIs, one per line or comma-separated. They must be https:// (or http://localhost while developing) and are matched exactly.
  • Allowed origins (for embedding), if you will use embedded signing.

Click + Register application. You get a client_id (cid_…) and a client_secret (cs_…). The secret is shown once. Revoke stops the application and all its tokens immediately.

A token acts as the SignSpry user who registered the application, with that user's access. Token endpoint: https://signspry.com/oauth/token. Authorize endpoint: https://signspry.com/oauth/authorize.

Client credentials

For server-to-server calls:

curl -X POST https://signspry.com/oauth/token \
  -d grant_type=client_credentials \
  -d client_id=cid_... \
  -d client_secret=...

You can also send the id and secret as HTTP Basic credentials. The reply is {"access_token": "at_…", "token_type": "Bearer", "expires_in": 3600, "scope": "…"}. Use the token exactly like an API key: Authorization: Bearer at_….

Authorization code

Send the browser to:

/oauth/authorize?client_id=cid_...&redirect_uri=...&response_type=code&scope=envelopes:write&state=...

The signed-in user approves, and you receive a code (and your state) on your redirect URI. Exchange it within ten minutes; each code works once:

curl -X POST https://signspry.com/oauth/token \
  -d grant_type=authorization_code \
  -d code=... -d client_id=cid_... -d client_secret=... \
  -d redirect_uri=...

PKCE is supported: send a code_challenge (the base64url SHA-256 of your verifier) on the authorize call and the code_verifier on the exchange, and the secret is then not required.

Tokens and limits

Access tokens last one hour. There is no refresh token; request a new one. Calls from an application's tokens share a limit of 120 requests a minute for that application.

Scopes

Pass scope as a space-separated list. Unknown scopes are dropped, and leaving it out grants all four.

ScopeGrants
envelopes:readList and read envelopes, audit trails, sealed documents
envelopes:writeCreate, send, remind, void, signing and embed links
templates:readRead templates
account:readRead plan and usage
Redirect URIs must be registered exactly. A request with any other redirect_uri is refused, and the user is never redirected there.
Was this useful?