Run the KYC stale-session expiry sweep for an organization
Runs the stale-session expiry sweep for the caller’s organization. The service also runs this job on its own schedule across every organization; this endpoint is the operator-triggered form, narrowed to one tenant. The sweep reconciles applications that have sat in ID_VERIFICATION_PENDING past the provider submission window: a job the provider reports as final is completed, and one the provider no longer knows about is moved to EXPIRED — nothing is expired without asking the provider first. Authenticated with an internal user’s backend bearer token and authorized against backend RBAC (accounts.write at ORG scope for the caller’s own organization, or PLATFORM). The organization is resolved from the token; passing organization_id is rejected. The run is held to the same interval as the scheduled one — there is no force bypass — and each organization has its own lease and due-window, so a manual run neither blocks nor is blocked by the global schedule.
Authorization
Cowdi_Sales_KYC_backendBearerAuth Cowdi backend-compatible RS256 JWT. sub may be the global user id or a Firebase auth id; Firebase auth-id subjects and missing organization claims are resolved through the backend user/access endpoints. Validated against the configured JWKS (lib/backend-auth.ts).
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/internal/kyc/applications/expirations"{ "job": "KYC_STALE_SESSION_EXPIRY", "organization_id": "string", "started_at": "2026-06-04T10:20:00.000Z", "finished_at": "2026-06-04T10:20:00.000Z", "result": { "scanned": 12, "expired": 3, "completed": 1, "still_pending": 8, "failed": 0 }}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}{ "code": "INVALID_PARAMS", "description": "user_id must be a UUID", "identifier": "string", "invalid_params": [ { "path": "user_id", "reason": "must be a UUID", "sub_code": "string" } ]}Report the provider job id for an in-flight SDK verification PATCH
Records the provider’s own job identifier for a `provider_sdk` verification — the value the SDK received in its submission response. Call once, immediately after the SDK reports a successful submission. On this channel the SDK submits directly to the provider, so that response never reaches the server, and Smile ID’s V3 recovery endpoints (status lookup and webhook replay) accept only *their* job id — there is no way to resolve it from our own reference. Reporting it is what makes an SDK-submitted job recoverable when its result webhook is lost; without it the only outcome is expiry. Write-once: re-reporting the same id succeeds unchanged, a different id is a 409. Only valid while the verification is still ID_VERIFICATION_PENDING.
Submit a captured selfie + ID for verification (deprecated) POST
Deprecated — use POST /applications/{id}/verification with `channel: "server_upload"`. Kept as a thin alias over the same engine. Server-side capture-then-submit: the browser captures a liveness selfie (with its liveness frames) and the ID document (front + optional back) with Smile ID’s smart-camera-web component and POSTs the base64 images here. They are submitted server-side to Smile ID Enhanced Document Verification (job_type 11) — keeping the government database cross-check while also capturing the back of the ID, which the hosted widget cannot. Include `liveness_images` to run Smile ID’s active-liveness / anti-spoofing check (a lone selfie only gets the passive check). The result arrives asynchronously via the provider callback, so the application is left ID_VERIFICATION_PENDING.