K-OTP

Get OTP issue status

GET /v1/status

GET https://api.k-otp.dev/v1/status

Overview

Returns verification state, delivery state, and the computed overallStatus for one issue owned by the authenticated app. overallStatus equals verificationStatus unless it is issued; while issued it is derived from deliveryStatus (delivered -> delivered, failed -> delivery_failed, queued/sent -> in_progress, unknown -> pending_lookup).

Immediately after POST /issue the issue row may still be persisting asynchronously; for up to 60 seconds such an issue is reported as pending_lookup instead of 404. The phone number is never returned.

Requires an sk_ secret key; pk_ public keys are rejected with 403.

Authentication

Accepted keysRequired scopeAlso accepted
sk_otp:statusotp:read, *

Parameters

NameInTypeRequiredDescription
issueIdquerystringyesissueId returned by POST /v1/issue.

Response (200)

Current status of the issue.

FieldTypeRequiredDescription
issueIdstringyes
messageIdstringyesIdentifier of the outbound message used for delivery tracking.
purposestringyes
templateIdstringyes
verificationStatus"expired" | "issued" | "max_attempts" | "replaced" | "verified"yes
deliveryStatus"delivered" | "failed" | "queued" | "sent" | "unknown"yes
overallStatus"delivered" | "delivery_failed" | "expired" | "in_progress" | "max_attempts" | "pending_lookup" | "replaced" | "verified"yesverificationStatus unless it is issued; otherwise derived from deliveryStatus for user-facing display.
providerOutcomeAmbiguousbooleantrue when the provider outcome of the send is unknown (for example a provider timeout). Such sends are never retried automatically.
providerOutcomeCodestringProvider result code, when available.
expiresAtstringyesRFC 3339 timestamp.
verifiedAtstringRFC 3339 timestamp, present once verified.
attemptsUsednumberyes
maxAttemptsnumberyes
attemptsRemainingnumberyes
createdAtstringyesRFC 3339 timestamp.
updatedAtstringyesRFC 3339 timestamp.

Error responses

Every error uses the { defined, code, status, message, data? } envelope. See Errors.

StatuscodeDescription
400BAD_REQUESTissueId is missing or blank.
401UNAUTHORIZEDthe Authorization: Bearer credential is missing, malformed, inactive, or rejected by introspection.
403FORBIDDENthe credential lacks otp:status (or an accepted alias), or a pk_ public key was used. Public keys are limited to issue/verify.
404NOT_FOUNDno issue with this issueId exists for the authenticated app (issues of other apps are indistinguishable from missing ones).
409CONFLICTthe request conflicts with the current state of the resource.
500INTERNAL_SERVER_ERRORunexpected server failure. Undefined errors (defined: false) use the same envelope.
503SERVICE_UNAVAILABLEcredential introspection or a downstream dependency is temporarily unavailable. Retry with backoff.

Example request

curl "https://api.k-otp.dev/v1/status?issueId=0192f3c4-8b7a-7c3e-9a51-2f4d6e8b1a90" \
  -H "Authorization: Bearer $KOTP_SECRET_KEY"

On this page