Developer guide
Everything you need beside the API reference: authentication, errors, rate limits, signed webhooks and Login with WorkPair.
Quickstart
- Create a verifier workspace at /verifier. Your API key (
wpk_…) is shown once: store it in your secrets manager. - Ask about a person. Nothing is revealed until they approve:
curl https://www.workpair.io/v1/verification-requests \
-H "Authorization: Bearer $WORKPAIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject":"did:key:z6Mk…","purpose":"employment_screening","claims":[{"type":"employment"}]}'- To hear when the person answers, register a webhook endpoint (
POST /v1/webhook-endpoints) and pass its id asendpointIdon the request. Or pollGET /v1/verification-requests/{id}. - Every answer carries a registry-signed proof (a JWS). Verify it offline against
https://www.workpair.io/.well-known/jwks.json.
Authentication
- API keys (issuers and verifiers):
Authorization: Bearer wpk_…. Create, list and revoke keys with/v1/verifier/api-keysor/v1/issuers/{issuerId}/api-keys. Rotate by creating a new key, deploying it, then revoking the old one. - Signer sessions: people who sign for an organization use their own WorkPair session (
Authorization: Bearer wps_…or the session cookie) and name the organization withx-wp-tenant: <issuerId>. Changes need the person’s device key on that device. - Keys and sessions are secrets: never put them in URLs, front-end code or logs.
Errors
Every error has the same shape. Quote the request id to support; it’s also in the x-request-id response header.
HTTP/1.1 400 Bad Request
x-request-id: 3f6c…
{ "error": { "code": "invalid_request", "message": "request validation failed",
"details": [{ "path": "/claims/0/type", "message": "Invalid enum value" }],
"requestId": "3f6c…" } }Branch on code, not on message. 4xx errors are yours to fix and are not worth retrying (except 409 conflicts you resolve and 429); 5xx and network errors are safe to retry with backoff. Login with WorkPair’s token endpoint follows OAuth instead: {"error": "invalid_grant", "error_description": "…"}.
Rate limits
Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds until the window resets). Over the limit you get 429 with Retry-After: wait that long before retrying. Limits are per API key (or per person, or per network address when unauthenticated); sign-in and other sensitive endpoints have tighter limits.
Retries and idempotency
Network failures happen. Reads are always safe to retry. Requests that create or charge accept an Idempotency-Key header (8 to 200 letters, digits and _ . : -): issuing a credential, publishing a new version, bulk issuing, verification requests, proof-of-human checks, wallet top-ups, claims and direct issuance between organizations, and attestation requests. Send a fresh key (a UUID works) with each new request and the same key when you retry it: for 24 hours the first response is returned again, so nothing is issued, charged or sent twice. Reusing a key with a different request is refused with 422 idempotency_key_reused; while the first request is still running, a retry gets 409 request_in_progress. A request that failed releases its key, so it can be retried with the same one. If the request was completed but its response was lost (the server stopped before storing it), a retry gets 409 request_completed_response_lost: don’t send it again with a new key; look up the result instead (for example, list your credentials or requests). If the server stopped before doing any of the work, a retry with the same key after five minutes runs it.
Testing your integration
WorkPair doesn’t offer a separate sandbox or test-mode API keys (API Terms 10.1). Every key works against production, and every charge made with it is real (API Terms 10.2). The development helpers (a mock identity provider, mock payments, a mailbox for sign-in codes) exist only in development builds of the registry that you run yourself, and are never available in production. Build against a local registry (npm run dev, with WP_ENV=development), then switch the base URL and key when you go live.
Webhooks
Register an endpoint with POST /v1/webhook-endpoints (HTTPS only). Optional events limit it to certain types: exact names or a prefix such as verification_request.*. Manage endpoints with GET/PUT/DELETE /v1/webhook-endpoints/{id}, send a test with POST /v1/webhook-endpoints/{id}/ping, and resend a delivery with POST /v1/webhook-deliveries/{id}/redeliver. The full event catalog, with payloads, is in the reference’s Webhooks section (and GET /v1/webhook-event-types).
Each delivery is a JSON POST:
POST /your/endpoint
content-type: application/json
workpair-event-id: req_123:verification_request.approved
workpair-signature: t=1767225600,kid=webhook-abc123,sig=Q2xhdWRl…
{ "id": "req_123:verification_request.approved", "type": "verification_request.approved",
"createdAt": "2026-01-01T00:00:00.000Z", "data": { … } }- Verify every delivery. The signature is Ed25519 over
<t>.<raw body>, by the key named inkidfrom our JWKS. Reject anything more than 300 seconds from your clock. - De-duplicate on
id(equal to theworkpair-event-idheader). Retries and redeliveries reuse it. - Answer 2xx within 10 seconds, then process asynchronously. Anything else is retried with backoff: 12 attempts over about 6 days. An endpoint that fails 5 times in a row is paused for 15 minutes so it can’t slow down other deliveries.
- Keys rotate by kid. Cache the JWKS, and refetch it once when you see an unknown
kid. A new signing key is published before it is used, and a retired key stays in the JWKS long enough to cover every retry.
Node.js:
import { createPublicKey, verify } from 'node:crypto';
const jwks = await (await fetch('https://www.workpair.io/.well-known/jwks.json')).json();
/** raw: the request body exactly as received (don't re-serialize JSON). */
export function verifyWorkPair(raw: string, header: string, toleranceSec = 300): boolean {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=', 2)));
const t = Number(parts.t);
if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const jwk = jwks.keys.find((k: any) => k.kid === parts.kid && k.kty === 'OKP');
if (!jwk) return false; // unknown kid: refetch the JWKS once, then reject
return verify(null, Buffer.from(`${t}.${raw}`), createPublicKey({ key: jwk, format: 'jwk' }), Buffer.from(parts.sig, 'base64url'));
}Python (with the cryptography package):
import base64, json, time, urllib.request
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
JWKS = json.load(urllib.request.urlopen("https://www.workpair.io/.well-known/jwks.json"))
def _b64u(s: str) -> bytes:
return base64.urlsafe_b64decode(s + "=" * (-len(s) % 4))
def verify_workpair(raw: bytes, header: str, tolerance_sec: int = 300) -> bool:
parts = dict(p.split("=", 1) for p in header.split(","))
t = int(parts["t"])
if abs(time.time() - t) > tolerance_sec:
return False
jwk = next((k for k in JWKS["keys"] if k["kid"] == parts["kid"] and k["kty"] == "OKP"), None)
if jwk is None:
return False # unknown kid: refetch the JWKS once, then reject
try:
Ed25519PublicKey.from_public_bytes(_b64u(jwk["x"])).verify(_b64u(parts["sig"]), f"{t}.".encode() + raw)
return True
except Exception:
return FalseLogin with WorkPair
A standard OpenID Connect provider: discovery at https://www.workpair.io/.well-known/openid-configuration, authorization code flow with PKCE (S256) only. It tells you the person is a verified, unique human; their legal name only if they choose to share it for that login (scope wp_identity).
- Register a client with your verifier API key:
POST /v1/oidc/clientswithnameandredirectUris. The client secret is returned once. - Send the browser to
/oidc/authorize?response_type=code&client_id=…&redirect_uri=…&scope=openid&state=…&nonce=…&code_challenge=…&code_challenge_method=S256. The person signs in and approves on WorkPair. - We redirect back with
code, yourstateandiss(RFC 9207: check it equals the issuer). Exchange the code at/oidc/tokenwithclient_secret_basicorclient_secret_postand yourcode_verifier.
- ID token algorithm: RS256 by default (supported by every OIDC library); ES256 or EdDSA if you choose
idTokenSignedResponseAlg. Keys are in the JWKS.auth_timeis when the person approved the login. - Subjects are pairwise:
subis stable for your sector (your redirect URIs’ host) and different for every other relying party. Redirect URIs on several hosts need asectorIdentifierUri: an HTTPS URL you control that returns a JSON array listing all of them. - Manage clients with
GET/PUT/DELETE /v1/oidc/clients/{clientId}.POST /v1/oidc/clients/{clientId}/rotate-secretissues a new secret; the previous one keeps working for 24 hours while you deploy. - Sessions and assurance: the ID token carries
sid(your session at WorkPair for this person) andacr(urn:workpair:acr:aal2when the person approved with their device key or passkey). SetrequireAal2: trueon the client and every sign-in must be approved that way: never automatically, never from an email-code sign-in. - Back-channel logout (OpenID Connect Back-Channel Logout 1.0): register
backchannelLogoutUri(https). When the person signs out of your application from WorkPair, signs out of WorkPair and every app, locks or deletes their WorkPair ID, we POSTlogout_token=<JWT>(form-encoded) there. The token is signed like your ID tokens (headertyp: logout+jwt) and carriesiss,aud(your client_id),iat,exp(2 minutes),jti,sub,sid(when the login carried one) andeventswithhttp://schemas.openid.net/event/backchannel-logout; never anonce. Answer 200; failures are retried with the samejti. - RP-initiated logout: register
postLogoutRedirectUris, then send the browser to/oidc/logout?id_token_hint=…&post_logout_redirect_uri=…&state=…(theend_session_endpoint). WorkPair offers to sign the person out of WorkPair and every app, and links back to your URI.
Signed identity proofs at login
Ask for a proof the person approves on the WorkPair screen and you keep: a W3C Verifiable Credential (VC 2.0) signed by WorkPair Registry with an eddsa-jcs-2022 Data Integrity proof. Logging in is always free for the person; someone new verifies their identity free from the login screen, and you pay for it.
- Push the request (RFC 9126):
POST /oidc/parwithclient_secret_basicand the usual authorize parameters as a form, plusscope=openid wp_proofand an optionalwp_proof_request(JSON):{ "disclose": ["legal_name"], "include": ["identity_verified"], "credentials": [{ "categories": ["cdl", "hazmat_endorsement", "cargo_insurance"], "disclose": ["type", "issuer", "class", "endorsements", "valid_until", "status"], "min": 1 }] }You get201 {"request_uri": "urn:ietf:params:oauth:request_uri:…", "expires_in": 600}: single-use, bound to your client, 10 minutes. The pushed parameters are sealed at rest. Attribute checks such as a date of birth aren’t supported (predicatesis refused). Up to 120 pushes a minute per client. - Send the browser to
/oidc/authorize?client_id=…&request_uri=…. The person sees exactly what you ask for and approves or declines; they choose which matching credentials to share (at leastmin, or none). - The token response adds
wp_proof(type: ["VerifiableCredential","WorkPairIdentityProof"],issuerthe registry DID,credentialSubject.id=urn:workpair:pairwise:+ the ID token’ssub, only the granted fields:legal_name,identity_verified,identity_verified_at) andwp_proof_hash(lowercase hex SHA-256 of JCS(wp_proof)). Shared credentials come aswp_credential_proofs: [{wp_proof, wp_proof_hash}], andwp_subscription_idwhen they are monitored.
- Verify offline: the proof’s
verificationMethodis<registry DID>#<kid>; the key is in/.well-known/jwks.json(and the DID document). The SDKs’verifyWorkPairProof/verify_workpair_proofdo this. - Status: each proof has a
BitstringStatusListEntry; the list credential is public, signed and cacheable (ETag, 5 minutes). Anyone can check a proof athttps://www.workpair.io/verify/<proof_hash>orGET /v1/proofs/<proof_hash>/status, which show its status, dates and your name, never the person. - Revocation: a proof is revoked when the person’s identity verification is withdrawn, when they withdraw consent for your application, when they delete their WorkPair ID, or (credential proofs) when the issuer revokes or updates the credential. Register a webhook endpoint (
POST /v1/webhook-endpoints) to receivecredential.revokedwith the proof hash, and monitoring updates (credential.revoked,credential.expired,credential.updated) for shared credentials. - One fee (you pay; the person never does):
identity.proof_login, $0.25 per approved verification, charged when the proof is issued. Shared credentials and their monitoring are included; declined, cancelled or expired sign-ins cost nothing, and a newcomer’s first identity check costs you nothing. See fees. - Require pushed requests for your client with
requirePushedAuthorizationRequests: true; plain authorize is then refused forwp_proof.
App Review test accounts
So Apple and Google reviewers can try Continue with WorkPair in your app, WorkPair staff can create an App Review identity for your client: a synthetic test account (name ending in (Test), address appreview+…@workpair.io) that signs in on the WorkPair screen with a staff-issued passcode instead of an email code, only for the clients staff allowed, only inside your Login with WorkPair authorization. It is never identity-verified and opens nothing else in WorkPair.
- ID token and userinfo:
wp_review: true,wp_assurance: "review"andwp_verified_human: false.subis pairwise as usual. With scopeemail,emailis the reserved review address andemail_verifiedisfalse. - Proof:
wp_proof.credentialSubjectcarriesreview: true,assurance: "review"andidentity_verified: false(noidentity_verified_at); the proof status endpoint addsreview: true. No ID check happened: never treat it as IAL2. - AAL2 exception: for a review identity on a client staff allowed for it, the passcode counts as approval with the device key or passkey, so a client with
requireAal2: truecan still be reviewed, andacrisurn:workpair:acr:aal2. It never applies to a real person, to any other client, or outside the consent screen. - What to do: checks such as
wp_verified_human === true && wp_assurance === "IAL2"refuse review accounts, which is safe. To let reviewers in, acceptwp_review: trueexplicitly and run that account as a test account: no real money, no real bookings, nothing sent to real people.
Email, WorkPair ID and the person’s organization
- Scope
email: the ID token and userinfo carryemail(the address the person signs in to WorkPair with, confirmed by a code sent to it) andemail_verified: true, only when the person ticks “share my email address” on the consent screen. - Scope
wp_id: the ID token and userinfo carrywp_id, the person’s public 13-character WorkPair ID, only when they tick “share my WorkPair ID”. Use it to let people add each other;sub(pairwise) stays the user key. - Organization: add
organizationtowp_proof_request(pushed requests only):"organization": { "roles": ["owner", "admin"], // non-empty subset of owner, admin, member "org_id": null, // or a 15-character organization WorkPair ID: only that one may be chosen "require_verified": true } // the organization must be business-verified (Stripe)The person picks one organization where they hold an accepted role. Roles: workspaceowner→owner,admin→admin, every other active membership role →member. If none qualifies you geterror=access_denied&error_description=no_matching_organization. - The proof’s
credentialSubject.organizationand the ID token’swp_orgare{"id", "legal_name", "domain" | null, "role", "verified", "verified_at" | null, "status", "verification", "profile", "updated_at"}.verified: the organization passed Stripe business verification (tax ID verified, legal name matched) and it still holds (exactly whenverificationisverified).domainis set only when WorkPair verified it (DNS and a mailbox). The signed proof is authoritative for the moment it was signed. status:active;suspended(WorkPair staff suspended the organization; its membership proofs are revoked);closed(every WorkPair workspace of the organization is closed).verification:verified;pending(never verified; Stripe has the details and is reviewing them or asking for more);needs_reverification(it was verified, then a later check — the owners’ own refresh or WorkPair’s daily recheck of the Stripe account that verified it — found Stripe asking for information again (requirements currently due, past due, pending verification or in error) or no longer verifying it, or the legal name or representative no longer matching; it stays so until a check passes again);unverified(never verified, nothing pending).profile:{"country": "US" | null, "region": "US-DE" | "Delaware" | null, "sector": {"code","label"} | null, "legal_form": {"code","label"} | null, "size": {"code","label"} | null, "website"?: "https://…"}— only what the organization’s owners and admins set on WorkPair (country is ISO 3166-1 alpha-2; region an ISO 3166-2 code or a name;websiteonly for a domain WorkPair verified). Never a tax ID or anything held only by Stripe.updated_at: when status, verification or profile last changed. Show all of it read-only: the organization edits it on WorkPair.- Keep it current:
GET /v1/oidc/organizations/{orgId}(discovery:wp_organization_endpoint) with your client credentials (client_secret_basic, as at the token endpoint) returns the same object withoutrole, as it stands now. It answers only while your client holds at least one live (unrevoked, unexpired) proof naming that organization; otherwise404(whether or not it exists). Rate-limited per client (429withRetry-After). - When the membership ends (removed, left, role changed, organization suspended) the proof is revoked and you receive
organization.membership_revoked{clientId, sub, orgId, reason}(pluscredential.revokedfor the proof). When an organization’s business verification or status changes you receiveorganization.status_changed{orgId, verified, status, verification}; when its profile changes,organization.profile_changed{orgId, changed: ["country" | "region" | "sector" | "legal_form" | "size" | "website"], updated_at}. Both go to every workspace holding a live proof about the organization, signed and retried like every webhook. - Any business can get an organization on WorkPair, free: a verified person creates a business account at /business, verifies it with Stripe and invites its people. No extra fee for you either: it rides on
identity.proof_login.
App sign-in and devices
For WorkPair’s own iPhone and Android apps (and anyone building a person-side client). Each device holds its own key: Ed25519, a P-256 key in the phone’s secure hardware, or a passkey. Any active key signs for the person; removing a device revokes only its key. Signatures are multibase (raw Ed25519, or P-256 compact r‖s or DER), or a passkey assertion carried as wa1.<base64url JSON {a, c, s}> whose WebAuthn challenge is base64url(SHA-256(message)).
- Sign up from an app:
POST /v1/auth/challenges(purposesignup), thenPOST /v1/personswith the device’s public key (Ed25519 or P-256 multikey), its signature over the challenge, the emailed code, the signed legal acceptance,device: {platform, label}andapp: true. The response’sappholds an access token (15 minutes) and a refresh token (60 days). - Sign in from a device that holds a key:
POST /v1/auth/app-sessionswith the challenge, code, the key’s did:key aswpIdand its signature: AAL2. - A new device: the same call with the code alone gives an AAL1 session (it can read and pay, not sign). Send
newKey: {publicKeyMultibase, signature}(the new key’s signature overworkpair:add-device:<did>) and the response includesdeviceLink.code. Show it; the person enters it on a device that can sign, which approves withPOST /v1/me/devices/link-requests/approve(signature overapprovalMessage). The waiting session becomes AAL2. - Passkeys:
POST /v1/auth/passkey/options, thenPOST /v1/auth/passkey/sessionswith the assertion (app: truefor tokens). Add one withPOST /v1/me/passkeys/optionsandPOST /v1/me/passkeys. - Refresh:
POST /v1/auth/refreshwith the refresh token returns a new pair. Each refresh token works once; using one twice ends that whole sign-in (a copied token is useless).DELETE /v1/auth/app-sessionssigns the app out. - Devices:
GET /v1/me/deviceslists them with their keys;DELETE /v1/me/devices/{id}removes one (its key stops signing, its sessions end). - Person DID:
/people/{workpairId}/did.jsonlists a person’s device keys (no personal data), so signatures in credential evidence can be checked offline. New credentials name their subject by this DID.
Versioning
/v1is stable. We add things without notice: new endpoints, new optional fields, new response fields, new webhook event types and new error codes. Ignore fields you don’t know and handle unknown event types gracefully.- Breaking changes only ship under a new version prefix.
- Anything we plan to remove is announced at least 6 months ahead: responses from it carry
DeprecationandSunsetheaders, and workspace contacts are emailed.