using RestSharp;
var options = new RestClientOptions("https://api.otpbay.com/v1/verifications/{sid}/check");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"code\": \"482913\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.
using RestSharp;
var options = new RestClientOptions("https://api.otpbay.com/v1/verifications/{sid}/check");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"code\": \"482913\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
Your project API key, sent as Authorization: Bearer otp_live_.... Create keys on the API Keys page of the dashboard.
Path Parameters
sid
string
required
The verification sid returned by Start a verification.
Pattern: ^VE[a-fA-F0-9]{24}$
Example:
"VE6650c3a1b2c3d4e5f6a7b8c9"
Body
application/json
code
string
required
The code your user entered, 4–8 digits.
Pattern: ^\d{4,8}$
Example:
"482913"
Response
The code was checked. Read valid to see whether it matched.
valid
boolean
required
true when the code matched and the verification is now approved.
sid
string
required
Unique verification ID.
Pattern: ^VE[a-f0-9]{24}$
Example:
"VE6650c3a1b2c3d4e5f6a7b8c9"
status
enum<string>
required
pending until the user enters the right code (approved), the code expires (expired), or the code can't be sent or too many wrong codes are entered (failed).
Available options:
pending,
approved,
expired,
failed
to
string
required
Destination phone number in international format. OTPBay normalizes it to E.164, so +1 (415) 555-2671 becomes +14155552671.
Example:
"+14155552671"
channel
enum<string>
required
Channel the code was last sent on.
Available options:
telegram,
sms
fallback_reason
enum<string> | null
required
Why the code was re-sent by SMS, or null if it wasn't.
Available options:
telegram_failed,
timeout,
null
attempts
object[]
required
Every send of the code, oldest first.
Hide child attributes
attempts.channel
enum<string>
required
Channel this attempt was sent on.
Available options:
telegram,
sms
attempts.sid
string
required
sid of the underlying message: TG… for Telegram, SM… for SMS.
Example:
"TG6650c3a1b2c3d4e5f6a7b8d0"
attempts.status
string
required
Delivery status of the message. Telegram: sending, sent, delivered, read, expired, revoked, failed. SMS: queued, processing, sent, failed, enqueue_failed.
Example:
"sent"
attempts.cost
string
required
Amount in US dollars as a decimal string.
Pattern: ^\d+\.\d{2}$
Example:
"0.02"
attempts.date_created
string<date-time>
required
checks_left
integer
required
Wrong codes the user can still enter before the verification fails.
Example:
5
fee
string
required
Amount in US dollars as a decimal string.
Pattern: ^\d+\.\d{2}$
Example:
"0.02"
cost
string
required
Verify fee plus what the channel sends currently cost. Refunded sends count as 0.00.
Pattern: ^\d+\.\d{2}$
Example:
"0.04"
date_created
string<date-time>
required
expires_at
string<date-time>
required
When the code stops being accepted.
approved_at
string<date-time> | null
required
When the right code was entered.
metadata
object
required
Your own key-value data, returned in responses and webhooks. At most 32 keys of 1–64 characters. Values are strings (up to 512 characters), numbers or booleans.
Hide child attributes
metadata.{key}
stringnumberboolean
Maximum string length: 512
Example:
{ "user_id": "usr_1042" }
last_error
string
Why the verification failed. Only present when status is failed.
Example:
"Too many wrong codes."
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"OTPBay","description":"One API for OTP verification over Telegram and SMS, with automatic SMS fallback and pay-as-you-go pricing.","colors":{"primary":"#2563EB","light":"#60A5FA","dark":"#1D4ED8"},"logo":{"light":"https://mintcdn.com/otplabs/8X-9M4_TQPcbQN7P/logo/light.svg?fit=max\u0026auto=format\u0026n=8X-9M4_TQPcbQN7P\u0026q=85\u0026s=6b4b1e93ed9af2e6c96dc1b134c943b4","dark":"https://mintcdn.com/otplabs/8X-9M4_TQPcbQN7P/logo/dark.svg?fit=max\u0026auto=format\u0026n=8X-9M4_TQPcbQN7P\u0026q=85\u0026s=5485971997fc4eec1bf90a275f2ee143","href":"https://otpbay.com"},"favicon":"https://mintcdn.com/otplabs/8X-9M4_TQPcbQN7P/favicon.svg?fit=max\u0026auto=format\u0026n=8X-9M4_TQPcbQN7P\u0026q=85\u0026s=af1cf27822fe713b72449abc797087c5","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"all","languages":["bash","javascript","python","php","go","java","ruby","csharp"],"prefill":true}},"navbar":{"links":[{"href":"mailto:hello@otpbay.com","label":"Support"}],"primary":{"type":"button","label":"Get an API key","href":"https://app.otpbay.com/login"}},"footer":{"links":[{"header":"OTPBay","items":[{"label":"Website","href":"https://otpbay.com"},{"label":"Dashboard","href":"https://app.otpbay.com"},{"label":"Contact","href":"mailto:hello@otpbay.com"}]}]},"seo":{"metatags":{"og:site_name":"OTPBay Docs"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.otpbay.com"},{"anchor":"Pricing","icon":"tag","href":"https://otpbay.com/#pricing"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"otplabs","hasAudioNarration":false,"actualSubdomain":"otplabs","customDomains":["docs.otpbay.com"],"gitSource":{"type":"github","owner":"sarkarkurdish","repo":"otpbay-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ab8101293ea6a921de40041","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"API reference","count":11},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Concepts","count":4},{"language":"default","tag":"Telegram","count":3},{"language":"default","tag":"Verify","count":3},{"language":"default","tag":"Get started","count":3},{"language":"default","tag":"Channels","count":3},{"language":"default","tag":"SMS","count":2},{"language":"default","tag":"Overview","count":1},{"language":"default","tag":"Project","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/verify/check","slug":"/api-reference/verify/check","pageMetadata":{"openapi":"api-reference/openapi.yaml POST /verifications/{sid}/check","title":"Check a code","description":"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of `checks_left`; the last wrong code fails the verification. A wrong code still returns `200` with `valid: false`.","href":"/api-reference/verify/check"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of \", _jsx(_components.code, {\n children: \"checks_left\"\n }), \"; the last wrong code fails the verification. A wrong code still returns \", _jsx(_components.code, {\n children: \"200\"\n }), \" with \", _jsx(_components.code, {\n children: \"valid: false\"\n }), \".\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"openapi":"api-reference/openapi.yaml POST /verifications/{sid}/check","title":"Check a code","description":"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of `checks_left`; the last wrong code fails the verification. A wrong code still returns `200` with `valid: false`.","href":"/api-reference/verify/check"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Verify"],"operationId":"checkVerification","summary":"Check a code","description":"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of `checks_left`; the last wrong code fails the verification. A wrong code still returns `200` with `valid: false`.","x-mint":{"metadata":{"sidebarTitle":"Check a code"}},"parameters":["c5b9726d-e589-4a76-bf81-776811c7c87b"],"requestBody":"dc432bf9-a8a9-4d90-91bc-55b427bac152","responses":{"200":"e5944681-9b7b-4a5d-ad56-702f0270bc53","400":"2d8d576d-d1ef-42d3-acce-f547c35ea2ec","401":"cf16ca2e-ab82-4b19-b106-e97beafbb6ca","403":"747e3d09-162e-451d-a435-bd103dc01409","404":"1b64644c-c549-4d97-b3ae-39751d5ce3a1","409":"3e741965-211f-46f9-b667-be1c009521a1","422":"7a684d28-8c6a-49a7-b945-58027f1b9fee"},"method":"post","type":"path","servers":["6a6cc5c3-f7c4-48ab-ae40-5879a8018beb"],"security":["0b32bf04-d99a-4109-87b5-0462865dad0d"],"path":"/verifications/{sid}/check","baseUrlOptions":["https://api.otpbay.com/v1"],"title":"Check a code","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","php","go","java","ruby","csharp"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.code":"482913"}]},"dependencies":{"parameters":{"c5b9726d-e589-4a76-bf81-776811c7c87b":{"name":"sid","in":"path","required":true,"description":"The verification `sid` returned by Start a verification.","schema":{"type":"string","pattern":"^VE[a-fA-F0-9]{24}$","example":"VE6650c3a1b2c3d4e5f6a7b8c9","isRequired":true,"description":"The verification `sid` returned by Start a verification.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"additionalProperties":false,"properties":{"code":{"type":"string","pattern":"^\\d{4,8}$","description":"The code your user entered, 4–8 digits.","example":"482913","isRequired":true,"uniqueKey":"code","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"code":"482913"},"examples":{"Example":{"title":"Example","value":{"code":"482913"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"e5944681-9b7b-4a5d-ad56-702f0270bc53":{"description":"The code was checked. Read `valid` to see whether it matched.","content":{"application/json":{"schema":{"type":"object","required":["sid","status","to","channel","fallback_reason","attempts","checks_left","fee","cost","date_created","expires_at","approved_at","metadata","valid"],"properties":{"valid":{"type":"boolean","description":"`true` when the code matched and the verification is now `approved`.","isRequired":true,"uniqueKey":"valid","typeLabel":"boolean"},"sid":{"type":"string","pattern":"^VE[a-f0-9]{24}$","description":"Unique verification ID.","example":"VE6650c3a1b2c3d4e5f6a7b8c9","isRequired":true,"uniqueKey":"sid","typeLabel":"string"},"status":{"type":"string","enum":["pending","approved","expired","failed"],"description":"`pending` until the user enters the right code (`approved`), the code expires (`expired`), or the code can't be sent or too many wrong codes are entered (`failed`).","isRequired":true,"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"to":{"type":"string","description":"Destination phone number in international format. OTPBay normalizes it to E.164, so `+1 (415) 555-2671` becomes `+14155552671`.","example":"+14155552671","isRequired":true,"uniqueKey":"to","typeLabel":"string"},"channel":{"type":"string","enum":["telegram","sms"],"description":"Channel the code was last sent on.","isRequired":true,"uniqueKey":"channel","typeLabel":"enum\u003cstring>"},"fallback_reason":{"oneOf":[{"type":"string","enum":["telegram_failed","timeout",null],"description":"Why the code was re-sent by SMS, or `null` if it wasn't.","isRequired":true,"uniqueKey":"fallback_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["telegram_failed","timeout",null],"description":"Why the code was re-sent by SMS, or `null` if it wasn't.","isRequired":true,"uniqueKey":"fallback_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"fallback_reason","typeLabel":"enum\u003cstring> | null"},"attempts":{"type":"array","description":"Every send of the code, oldest first.","items":{"type":"object","description":"One send of the code.","required":["channel","sid","status","cost","date_created"],"properties":{"channel":{"type":"string","enum":["telegram","sms"],"description":"Channel this attempt was sent on.","isRequired":true,"uniqueKey":"attempts.items.[INDEX].channel","typeLabel":"enum\u003cstring>"},"sid":{"type":"string","description":"`sid` of the underlying message: `TG…` for Telegram, `SM…` for SMS.","example":"TG6650c3a1b2c3d4e5f6a7b8d0","isRequired":true,"uniqueKey":"attempts.items.[INDEX].sid","typeLabel":"string"},"status":{"type":"string","description":"Delivery status of the message. Telegram: `sending`, `sent`, `delivered`, `read`, `expired`, `revoked`, `failed`. SMS: `queued`, `processing`, `sent`, `failed`, `enqueue_failed`.","example":"sent","isRequired":true,"uniqueKey":"attempts.items.[INDEX].status","typeLabel":"string"},"cost":{"type":"string","pattern":"^\\d+\\.\\d{2}$","description":"Amount in US dollars as a decimal string.","example":"0.02","isRequired":true,"uniqueKey":"attempts.items.[INDEX].cost","typeLabel":"string"},"date_created":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"attempts.items.[INDEX].date_created","typeLabel":"string\u003cdate-time>"}},"uniqueKey":"attempts.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"attempts","typeLabel":"object[]"},"checks_left":{"type":"integer","description":"Wrong codes the user can still enter before the verification fails.","example":5,"isRequired":true,"uniqueKey":"checks_left","typeLabel":"integer"},"fee":{"type":"string","pattern":"^\\d+\\.\\d{2}$","description":"Amount in US dollars as a decimal string.","example":"0.02","isRequired":true,"uniqueKey":"fee","typeLabel":"string"},"cost":{"type":"string","description":"Verify fee plus what the channel sends currently cost. Refunded sends count as `0.00`.","pattern":"^\\d+\\.\\d{2}$","example":"0.04","isRequired":true,"uniqueKey":"cost","typeLabel":"string"},"date_created":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"date_created","typeLabel":"string\u003cdate-time>"},"expires_at":{"type":"string","format":"date-time","description":"When the code stops being accepted.","isRequired":true,"uniqueKey":"expires_at","typeLabel":"string\u003cdate-time>"},"approved_at":{"oneOf":[{"type":"string","format":"date-time","description":"When the right code was entered.","isRequired":true,"uniqueKey":"approved_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","format":"date-time","description":"When the right code was entered.","isRequired":true,"uniqueKey":"approved_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"approved_at","typeLabel":"string\u003cdate-time> | null"},"metadata":{"type":"object","description":"Your own key-value data, returned in responses and webhooks. At most 32 keys of 1–64 characters. Values are strings (up to 512 characters), numbers or booleans.","maxProperties":32,"additionalProperties":{"oneOf":[{"type":"string","maxLength":512,"uniqueKey":"metadata.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","uniqueKey":"metadata.additionalProperties.oneOf.1","typeLabel":"number"},{"type":"boolean","uniqueKey":"metadata.additionalProperties.oneOf.2","typeLabel":"boolean"}],"uniqueKey":"metadata.additionalProperties","typeLabel":"string | number | boolean"},"example":{"user_id":"usr_1042"},"isRequired":true,"uniqueKey":"metadata","typeLabel":"object"},"last_error":{"type":"string","description":"Why the verification failed. Only present when `status` is `failed`.","example":"Too many wrong codes.","uniqueKey":"last_error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"valid":{"title":"valid","summary":"Correct code","value":{"valid":true,"sid":"VE6650c3a1b2c3d4e5f6a7b8c9","status":"approved","to":"+14155552671","channel":"telegram","fallback_reason":null,"attempts":[{"channel":"telegram","sid":"TG6650c3a1b2c3d4e5f6a7b8d0","status":"read","cost":"0.02","date_created":"2026-09-26T10:15:02.114Z"}],"checks_left":4,"fee":"0.02","cost":"0.04","date_created":"2026-09-26T10:15:01.873Z","expires_at":"2026-09-26T10:25:01.873Z","approved_at":"2026-09-26T10:15:40.518Z","metadata":{"user_id":"usr_1042"}}},"invalid":{"title":"invalid","summary":"Wrong code","value":{"valid":false,"sid":"VE6650c3a1b2c3d4e5f6a7b8c9","status":"pending","to":"+14155552671","channel":"telegram","fallback_reason":null,"attempts":[{"channel":"telegram","sid":"TG6650c3a1b2c3d4e5f6a7b8d0","status":"read","cost":"0.02","date_created":"2026-09-26T10:15:02.114Z"}],"checks_left":4,"fee":"0.02","cost":"0.04","date_created":"2026-09-26T10:15:01.873Z","expires_at":"2026-09-26T10:25:01.873Z","approved_at":null,"metadata":{"user_id":"usr_1042"}}}},"exampleType":"examples"}},"exampleType":"examples"},"2d8d576d-d1ef-42d3-acce-f547c35ea2ec":{"description":"`INVALID_MESSAGE_SID` — the `sid` doesn't have the right prefix and 24 hex characters.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"INVALID_MESSAGE_SID","message":"`sid` must match VExxxxxxxxxxxxxxxxxxxxxxxx (ObjectId hex)."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"INVALID_MESSAGE_SID","message":"`sid` must match VExxxxxxxxxxxxxxxxxxxxxxxx (ObjectId hex)."}}}},"exampleType":"examples"}},"exampleType":"examples"},"cf16ca2e-ab82-4b19-b106-e97beafbb6ca":{"description":"`MISSING_API_KEY` or `INVALID_API_KEY`.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"INVALID_API_KEY","message":"Invalid API key."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"INVALID_API_KEY","message":"Invalid API key."}}}},"exampleType":"examples"}},"exampleType":"examples"},"747e3d09-162e-451d-a435-bd103dc01409":{"description":"`IP_NOT_ALLOWED` — the project's IP allowlist is on and your address isn't in it.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"IP_NOT_ALLOWED","message":"This IP address is not allowed for this project."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"IP_NOT_ALLOWED","message":"This IP address is not allowed for this project."}}}},"exampleType":"examples"}},"exampleType":"examples"},"1b64644c-c549-4d97-b3ae-39751d5ce3a1":{"description":"`VERIFICATION_NOT_FOUND` — no verification with this `sid` in your project.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"VERIFICATION_NOT_FOUND","message":"Verification was not found for this account."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"VERIFICATION_NOT_FOUND","message":"Verification was not found for this account."}}}},"exampleType":"examples"}},"exampleType":"examples"},"3e741965-211f-46f9-b667-be1c009521a1":{"description":"`VERIFICATION_NOT_PENDING` — the verification is already `approved`, `expired` or `failed`. Start a new one.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"VERIFICATION_NOT_PENDING","message":"This verification is expired; start a new one."}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"VERIFICATION_NOT_PENDING","message":"This verification is expired; start a new one."}}}},"exampleType":"examples"}},"exampleType":"examples"},"7a684d28-8c6a-49a7-b945-58027f1b9fee":{"description":"`INVALID_REQUEST_BODY` — a field is missing or invalid. `message` names each field.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable, machine-readable error code. Branch on this, not on `message`.","example":"INSUFFICIENT_BALANCE","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"Human-readable explanation. The wording can change.","example":"Insufficient balance for this verification.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"INVALID_REQUEST_BODY","message":"code: Code must be 4–8 digits"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"INVALID_REQUEST_BODY","message":"code: Code must be 4–8 digits"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"0b32bf04-d99a-4109-87b5-0462865dad0d":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your project API key, sent as `Authorization: Bearer otp_live_...`. Create keys on the **API Keys** page of the dashboard.","scopes":[]}}},"servers":{"6a6cc5c3-f7c4-48ab-ae40-5879a8018beb":{"url":"https://api.otpbay.com/v1","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Your project API key, sent as `Authorization: Bearer otp_live_...`. Create keys on the **API Keys** page of the dashboard.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Your project API key, sent as `Authorization: Bearer otp_live_...`. Create keys on the **API Keys** page of the dashboard.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"otplabs","siteName":"OTPBay","title":"Check a code - OTPBay","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-26T18:33:58.233Z","originalFileLocation":"api-reference/verify/check.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OTPBay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Check a code - OTPBay\">\u003cmeta data-mint-head property=\"og:description\" content=\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OTPBay Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.otpbay.com/api-reference/verify/check\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://otplabs.mintlify.site/_mintlify/api/og/v2?division=Verify\u0026amp;title=Check+a+code\u0026amp;description=Checks+the+code+your+user+entered.+A+correct+code+approves+the+verification.+Each+wrong+code+uses+one+of+%60checks_left%60%3B+the+last+wrong+code+fails+the+verificati\u0026amp;theme=e356ee5661d14dccab2560c7\u0026amp;signature=40b3ab5e364301856cbf212dde0e78588dca10d9b56daf9ec987961b1fa71b2a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Check a code - OTPBay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://otplabs.mintlify.site/_mintlify/api/og/v2?division=Verify\u0026amp;title=Check+a+code\u0026amp;description=Checks+the+code+your+user+entered.+A+correct+code+approves+the+verification.+Each+wrong+code+uses+one+of+%60checks_left%60%3B+the+last+wrong+code+fails+the+verificati\u0026amp;theme=e356ee5661d14dccab2560c7\u0026amp;signature=40b3ab5e364301856cbf212dde0e78588dca10d9b56daf9ec987961b1fa71b2a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/otplabs/m_RD1oW66WwT2cnl/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OTPBay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.otpbay.com/api-reference/verify/check\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/verify/check.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.otpbay.com/#organization\",\"name\":\"OTPBay\",\"url\":\"https://docs.otpbay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/otplabs/8X-9M4_TQPcbQN7P/logo/light.svg?fit=max\u0026auto=format\u0026n=8X-9M4_TQPcbQN7P\u0026q=85\u0026s=6b4b1e93ed9af2e6c96dc1b134c943b4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.otpbay.com#website\",\"name\":\"OTPBay\",\"url\":\"https://docs.otpbay.com\",\"publisher\":{\"@id\":\"https://docs.otpbay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.otpbay.com/api-reference/verify/check#webpage\",\"url\":\"https://docs.otpbay.com/api-reference/verify/check\",\"name\":\"Check a code\",\"description\":\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.\",\"dateModified\":\"2026-09-26T18:33:58.233Z\",\"isPartOf\":{\"@id\":\"https://docs.otpbay.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.otpbay.com/api-reference/verify/check#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.otpbay.com/api-reference/verify/check#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Verify\",\"item\":\"https://docs.otpbay.com/api-reference/verify/start\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Check a code\",\"item\":\"https://docs.otpbay.com/api-reference/verify/check\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.otpbay.com/api-reference/verify/check#apireference\",\"headline\":\"Check a code\",\"name\":\"Check a code\",\"description\":\"Checks the code your user entered. A correct code approves the verification. Each wrong code uses one of checks_left; the last wrong code fails the verification. A wrong code still returns 200 with valid: false.\",\"url\":\"https://docs.otpbay.com/api-reference/verify/check\",\"mainEntityOfPage\":{\"@id\":\"https://docs.otpbay.com/api-reference/verify/check#webpage\"},\"dateModified\":\"2026-09-26T18:33:58.233Z\",\"publisher\":{\"@id\":\"https://docs.otpbay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.otpbay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OTPBay\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"OTPBay\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/verify/check.md","siteName":"OTPBay","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"gauge","href":"https://app.otpbay.com"},{"anchor":"Pricing","icon":"tag","href":"https://otpbay.com/#pricing"}]},"tabs":[{"tab":"Guides","icon":"book-open","pages":[{"title":"Guides","href":""}]},{"tab":"API reference","icon":"square-terminal","groups":[{"group":"Overview","pages":[{"title":"API reference","sidebarTitle":"Introduction","href":"/api-reference/introduction"}]},{"group":"Verify","pages":[{"openapi":"api-reference/openapi.yaml POST /verifications","title":"Start a verification","href":"/api-reference/verify/start"},{"openapi":"api-reference/openapi.yaml GET /verifications/{sid}","title":"Get a verification","description":"Returns the verification with every send attempt. Reading a verification also moves it forward: it falls back to SMS when due and marks it `expired` once `expires_at` passes.","href":"/api-reference/verify/get"},{"openapi":"api-reference/openapi.yaml POST /verifications/{sid}/check","title":"Check a code","href":"/api-reference/verify/check"}]},{"group":"SMS","pages":[{"openapi":"api-reference/openapi.yaml POST /messages/sms","title":"Send an SMS","description":"Queues one SMS for delivery. The price is quoted from the destination network and the number of segments, and your balance is charged when the message is handed to the carrier. The response returns right away with status `queued`; follow the message with [Get an SMS](/api-reference/sms/get) or a `callback` URL.","href":"/api-reference/sms/send"},{"openapi":"api-reference/openapi.yaml GET /messages/sms/{sid}","title":"Get an SMS","href":"/api-reference/sms/get"}]},{"group":"Telegram","pages":[{"openapi":"api-reference/openapi.yaml POST /messages/telegram","title":"Send a Telegram code","href":"/api-reference/telegram/send"},{"openapi":"api-reference/openapi.yaml GET /messages/telegram/{sid}","title":"Get a Telegram code","href":"/api-reference/telegram/get"},{"openapi":"api-reference/openapi.yaml POST /messages/telegram/{sid}/verify","title":"Verify a Telegram code","href":"/api-reference/telegram/verify"}]},{"group":"Project","pages":[{"openapi":"api-reference/openapi.yaml GET /project","title":"Get project","href":"/api-reference/project/get"}]},{"group":"Webhooks","pages":[{"openapi":"api-reference/openapi.yaml webhook statusUpdate","title":"Status webhook","href":"/api-reference/webhooks/status"}]}]}]},"basePath":"","title":"Check a code - OTPBay","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-_HcdDqS2.js","snippetPresets-CXnm-WO6.js","utils-Dg59J__o.js","style-to-object-BY3JEAdk.js","utils-D8TRpdk7.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-B6QaxWc5.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DeMZ-lcM.js","_Uint8Array-BjA2mcVW.js","isObject-FP1Yky1u.js","ApiExamples-cjPyMv63.js","usePlaygroundInputsStore-D7BWoaw4.js","shallow-Z1ceDNSG.js","isEqual-BObTuQrO.js","CodeSnippets-D1UZ1AE-.js","CodeSnippet-B373COAT.js","getApiPlaygroundDisplay-CfL-UuDS.js","Page-DuqezyvM.js","DynamicMarkdown-5yMTCLas.js","SectionHeading-BxT1HYfP.js","icon-DYJTTD3g.js","MethodPill-4AyycJeu.js","getPastedJson-Bp3WV6cN.js","Check2Icon-PhZu6Gry.js","axios-CsQoIw0U.js","Markdown-Dy9a8hT8.js","AssistantPageLink-87tSPwGm.js","dist-CXMB3QQU.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}