Skip to content

Get started

Keys and test mode

Which key to use where, how to send it, and what test mode accepts. A key belongs to one workspace and names no region: every workspace calls the same host.

Updated

Ask about this pageRead this page as Markdown

Send a key

Send the key as a bearer token on https://api.kontiga.com. Never put a secret key in a browser, an app or a URL.

Header
Authorization: Bearer kt_live_...

Key kinds

Credentials
KindPrefixHeld byMay call
Secretkt_live_Your serverEvery server route of its workspace, except managing keys.
Restrictedkt_live_A server or a deviceThe routes of its scopes, such as documents:write, with an expiry, a daily spend cap and labels.
Provisioningkt_live_Your provisioning serverOnly creating, listing, changing and revoking restricted keys.
Testkt_test_A developerAs a secret key, in test mode.
Publishablekt_pub_Code in a page or an appOnly starting an end customer’s session, from the exact origins you list.
Session tokennoneOne end customer’s browser or appThe one request or verification it was issued for.

Test mode

  • A test key, or the console’s test switch, makes test objects. They never bill and never touch the free start.
  • Test mode takes Kontiga’s sample documents, sample identities and sample people only. Any other file is refused with 422 test_mode_sample_only, which lists where the samples are.
  • The sample documents: sample-payslip-altered.pdf, a payslip whose net pay was changed after it was issued; sample-bank-statement-altered.pdf, a bank statement with a salary credit added after it was issued; sample-invoice-altered.pdf, an invoice whose total and payment account were changed after it was issued.
  • A sample is sent like any file: upload it (POST /v1/uploads, then PUT its bytes to the address given), then check it with POST /v1/documents and its upload_id. Check your first document has every step.
  • Every result is computed by the real checks, never stored or made up.
  • Test and live never mix: not in lists, exports or insights. Test events go only to webhook endpoints registered for test.
  • A test request is delivered only to the email addresses of the workspace’s members.

Errors

Key errors
StatusCodeWhat to do
401unauthorizedSend a valid key in Authorization: Bearer.
401key_expiredThe key passed its expiry. Create or roll a key.
403forbiddenThe key’s scopes, or your role, do not allow the call.
429rate_limitedWait the seconds in Retry-After, then retry with the same Idempotency-Key.