> For the complete documentation index, see [llms.txt](https://docs.idlayr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idlayr.com/get-started/quickstart.md).

# Quickstart

A complete Secure SNA verification — from credentials to a verified phone number. Plan around 30 minutes the first time. The same shape applies to Discovery and Reverse SMS; the differences are on each product page.

Two ways to drive the verification step are shown below: using the iOS SDK, or pasting the verification URL into a mobile browser. The browser path is useful for a first manual test before integrating the SDK.

## Prerequisites

For both paths:

* An IDlayr project (created by your IDlayr administrator via the Enterprise Portal).
* The project's OAuth2 credentials (`client_id`, `client_secret`).
* A backend or a shell to run cURL.

For Option A — iOS SDK:

* iOS development environment (Xcode 15+, iOS 13+ device on cellular).
* The Cloudsmith entitlement token for the iOS SDK (shared by IDlayr during onboarding).

For Option B — mobile browser:

* A mobile device with cellular data. Wi-Fi must be turned off during the test.

## 1. Mint an access token

Your backend exchanges the project credentials for a short-lived access token.

```bash
curl -X POST https://{data_residency}.api.idlayr.com/oauth2/token \
  -u "{client_id}:{client_secret}" \
  -d "grant_type=client_credentials" \
  -d "scope=secure_sna"
```

Response:

```json
{
  "access_token": "...",
  "token_type": "bearer",
  "expires_in": 3600,
  "scope": "secure_sna"
}
```

`{data_residency}` is `eu` or `us`. See [Data residency](/get-started/concepts/data-residency.md).

## 2. Create a Secure SNA check

Your backend calls IDlayr with the phone number to verify. If you're using Option B (browser), include a `redirect_url` you can inspect afterwards.

```bash
curl -X POST https://{data_residency}.api.idlayr.com/v1/number-verification/secure-sna-checks \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+447700900000",
    "redirect_url": "https://example.com/check"
  }'
```

The response includes:

* `check_id` — used to complete the check in step 4.
* `url` — the device-facing verification URL to drive in step 3.

## 3. Drive the verification

Pick one of the two options.

### Option A — using the iOS SDK

Install `IDlayrKit` (see [iOS SDK](/get-started/sdks/ios.md)). Pass the verification URL to the SDK; the SDK pins the request to cellular, follows the redirect chain (plain HTTP — no `Authorization` header needed on the device side), and returns the result. The OAuth2 access token never leaves your backend.

```swift
import IDlayrKit

let sdk = IDlayrSDK()
sdk.openWithDataCellular(
    url: URL(string: verificationURL)!,
    debug: false
) { response in
    // response.response_body contains the verification code.
    // Send it back to your backend to complete the check.
}
```

### Option B — pasting the URL into a mobile browser

A no-code path useful for the first manual test.

1. **Disable Wi-Fi on your test phone.** The verification fails if the request runs over Wi-Fi.
2. Open the `url` returned in step 2 in the phone's browser.
3. The browser follows the redirect chain and lands on the `redirect_url` you supplied in step 2.
4. Read the verification code from the query string in the address bar, e.g. `https://example.com/check?code=abc123…`.

## 4. Complete the check

Your backend redeems the code from step 3 with a POST for the check:

```bash
curl -X POST https://{data_residency}.api.idlayr.com/v1/number-verification/secure-sna-checks/{check_id}/code \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"code" : "{code}"}'
```

The response includes the `match` boolean — `true` if the device's network-attached number matched the claimed number, `false` if it didn't.

## What's next

* Test the flow in sandbox before production. See [Project modes](/get-started/concepts/project-modes.md) and the Secure SNA "Testing in sandbox" page.
* For backend-only products (SIM Swap, Eligibility), see [Your first IDlayr API call](/guides/your-first-api-call.md) — a simpler walkthrough that doesn't need a device.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.idlayr.com/get-started/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
