A challenge is one verification attempt. Scute sends a code, a link or a push, and the person proves they received it. You create challenges from your server and read the result by polling or from a webhook.
Two ways to create a challenge#
| Surface | Path | Credential | Use it when |
|---|---|---|---|
| App challenges | /v1/auth/:app_id/challenges | App key or M2M token | The person is a user of one of your apps. |
| Workspace challenges | /v1/workspaces/:workspace_id/challenges | Workspace key + M2M token | A Master or MSP workspace verifies a person in one of its client apps. Delivery, templates and custom domain come from the workspace's verification app, the verify page shows the MSP's brand. |
Both return the same challenge object. See App challenges and Workspace challenges.
Credentials#
| Label | Headers |
|---|---|
| App key | Authorization: Bearer scapp_.... A workspace key of the app's workspace, or of a workspace above it, is also accepted. |
| App key or M2M token | The app key as above, or X-Authorization: Bearer scm2m_... with an M2M token of an app in the same workspace or a workspace above it. |
| Workspace key + M2M token | Authorization: Bearer scworks_... and X-Authorization: Bearer scm2m_.... The M2M token must belong to an app in the workspace the key identifies. A member user JWT is accepted in X-Authorization in place of the M2M token. |
| API key + M2M token | An app key or workspace key in Authorization and an M2M token in X-Authorization. |
An M2M token needs its read scope for GET calls and its write scope for every other method. A token without the scope gets 403 with error_code insufficient_scope. See Authentication.
Lifecycle#
A challenge starts as pending and ends in one of these states:
| status | Meaning |
|---|---|
| pending | Sent, not answered yet. |
| verified | The person completed it. Stored as completed; the challenge object reports it as verified. |
| failed | Too many wrong answers, or the method could not complete. |
| expired | Not answered before expires_at. |
| cancelled | Cancelled by your server, or replaced by a resend. |
| denied | Rejected. A denial is recorded as the person's decision, unlike a cancel. |
Purposes and methods#
purpose says why you are verifying. method says how.
| Field | Values |
|---|---|
| purpose | authenticate, mfa, step_up, verify_contact, verify_identity, custom, change_identifier |
| method | email_otp, sms_otp, magic_link, totp, backup_code, webauthn, push, entra_push, duo |
authenticate and mfa challenges end in a session for the person. The other purposes only record that the person passed.
Results#
- Poll GET /v1/auth/:app_id/challenges/:token or GET /v1/workspaces/:workspace_id/challenges/:id.
- Pass callback_url when you create the challenge. Scute calls it when the challenge is completed or denied.
- Subscribe to challenge events with a webhook.
- For hosted verify pages, Scute redirects the person to your redirect URL with a short-lived scute_token. See Token validation.