---
title: "Check a verification code"
method: POST
path: "/v1/verify/{id}/check"
tags: ["Verify"]
---

# Check a verification code

`POST /v1/verify/{id}/check`

## Request

- Base URL: `https://api.honkio.ca`
- URL: `https://api.honkio.ca/v1/verify/{id}/check`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Submit the OTP code the end-user received. Max 5 attempts. Accepts 4, 6, or 8 digit codes depending on how the verification was started.

Requires `verify:w`.

## Path parameters

- `id` string, required

## Request body

- object
  - `code` string, required: 4 to 8 digit OTP code

## Response `200`

Code accepted: the verification is now verified.

- object: A phone-number verification (SMS OTP). status is lowercase, unlike message statuses.
  - `id` string, required
  - `phone_number` string, required
  - `from_number` string, required
  - `status` 'pending' | 'verified' | 'expired' | 'max_attempts', required
  - `attempts` integer, required
  - `code_length` integer, required
  - `app_name` string, nullable, required
  - `mode` 'LIVE' | 'TEST', required: TEST verifications are simulated: no SMS is sent, nothing is billed, and the code is always 000000 padded to code_length.
  - `cost_cents` integer, required: Cost in cents CAD. On a TEST verification this is 0: nothing was charged.
  - `expires_at` string, date-time, required
  - `verified_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `attempts_remaining` integer, required: Always 0 on success.

## Other responses

- `401`: Missing, invalid, revoked or expired API key.
- `402`: The account has no balance, or a LIVE key was used before the first top-up.
- `403`: The API key lacks the permission this operation requires, or the account is suspended or closed.
- `404`: VERIFICATION_NOT_FOUND. A test key finds TEST verifications only.
- `409`: VERIFICATION_ALREADY_VERIFIED.
- `410`: VERIFICATION_EXPIRED: start a new verification.
- `422`: VALIDATION_ERROR (not 4 to 8 digits) or VERIFICATION_INVALID_CODE, which carries attempts_remaining.
- `429`: VERIFICATION_MAX_ATTEMPTS: five wrong codes; start a new verification. Also RATE_LIMITED at 100 requests per second.
- `500`: INTERNAL_ERROR: unexpected server error.

---

[API](https://skmtc.dev/honkio/apis/honkio-api.md) · [All operations](https://skmtc.dev/honkio/apis/honkio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/honkio/apis/honkio-api/revisions/ce4ed3fe9691?raw)
