> ## Documentation Index
> Fetch the complete documentation index at: https://developer.eka.care/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create a sandbox ABHA from these docs in about ten minutes, without writing code.

Create a sandbox ABHA from these docs in about ten minutes, without writing code. Every step runs from the **Try it** playground on its API page.

## In short

* Get an access token once, then paste it into the **Bearer** field of each playground.
* Six calls: log in, send the Aadhaar number, verify the OTP, pick an address, check it is free, create the ABHA.
* You end with a 14-digit ABHA number, an ABHA address and Eka's patient id, `eka.oid`.
* There is no encryption step. You send the Aadhaar number as plain text and Eka handles ABDM's encryption for you.
* This page walks one case: the patient has no ABHA, and the mobile you send is the one linked to their Aadhaar.

## Create your first ABHA here

Enter your sandbox credentials and a test Aadhaar below; each step calls the sandbox from this page and shows the request and response.

<ol aria-label="Steps to create an ABHA" />

Sandbox: [https://api.dev.eka.care](https://api.dev.eka.care)
Start again

Prefer to call each API yourself? The same calls, step by step:

## Before you start

* **Sandbox credentials.** Create an Eka account, then create an API client in the [Eka Developer Console](https://console.eka.care) under **Manage API Credentials**. Copy the `client_id` and `client_secret`. See [Sandbox credentials](https://developer.eka.care/docs/hie-cm/testing.md#sandbox-credentials).&#x20;
* **The sandbox server.** Calls go to `https://api.dev.eka.care`. If a playground offers a server choice, pick **Stage/Sandbox**.
* **A sandbox Aadhaar number, and the phone registered to it.** The OTP goes to that phone.&#x20;

## 1. Get an access token

This logs your client in and returns the token every later call sends.

Open [Connect Login](https://developer.eka.care/api-sdk/auth/client-login.md) and press **Try it**. Paste this body and send it.

```json theme={null}
{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}
```

Copy `access_token` from the response. On each page below, paste it into the playground's **Authorization** Bearer field. `expires_in` is the token's lifetime in seconds. If a call returns `401`, run this step again.

> **Prefer curl?**
>
> ```bash theme={null}
> curl -X POST "https://api.dev.eka.care/connect-auth/v1/account/login" \
>   -H "Content-Type: application/json" \
>   -d '{"client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET"}'
> ```

## 2. Send the Aadhaar number

ABDM sends an OTP to the mobile linked to this Aadhaar.

Open [Generate OTP](https://developer.eka.care/api-sdk/hie-cm/enrollment/aadhaar/initiate-registration.md) and press **Try it**.

```json theme={null}
{
  "aadhaar_number": "YOUR_AADHAAR"
}
```

Copy `txn_id`. `hint` shows the masked number the OTP went to.

> **Prefer curl?**
>
> ```bash theme={null}
> curl -X POST "https://api.dev.eka.care/abdm/na/v1/registration/aadhaar/init" \
>   -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{"aadhaar_number": "YOUR_AADHAAR"}'
> ```

## 3. Verify the Aadhaar OTP

This proves the patient's identity against Aadhaar and sets the mobile the ABHA will use.

Open [Verify OTP](https://developer.eka.care/api-sdk/hie-cm/enrollment/aadhaar/verify-otp.md) and press **Try it**. Use the Aadhaar-linked mobile for `mobile`.

```json theme={null}
{
  "txn_id": "TXN_ID_FROM_STEP_2",
  "otp": "YOUR_OTP",
  "mobile": "YOUR_MOBILE"
}
```

Copy the new `txn_id`. Check that `skip_state` is `abha_create` and `abha_profiles` is empty. Any other result is a branch covered on the [workflow page](https://developer.eka.care/docs/hie-cm/workflows/create-abha-aadhaar-otp.md).

> **Prefer curl?**
>
> ```bash theme={null}
> curl -X POST "https://api.dev.eka.care/abdm/na/v1/registration/aadhaar/verify" \
>   -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{"txn_id": "TXN_ID_FROM_STEP_2", "otp": "YOUR_OTP", "mobile": "YOUR_MOBILE"}'
> ```

## 4. Get suggested ABHA addresses

Eka returns addresses that are free to take. This call has no body.

Open [Suggest ABHA Address](https://developer.eka.care/api-sdk/hie-cm/commons/suggest-abha-address.md) and press **Try it**. Set the `transactionId` query parameter to `TXN_ID_FROM_STEP_3`.

Copy one entry from `suggestions`. You can type your own address instead.

> **Prefer curl?**
>
> ```bash theme={null}
> curl "https://api.dev.eka.care/abdm/na/v1/registration/suggest?transactionId=TXN_ID_FROM_STEP_3" \
>   -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
> ```

## 5. Check the address is free

This confirms nobody holds the address before you create it.

Open [Does ABHA Address Exist](https://developer.eka.care/api-sdk/hie-cm/commons/does-health-id-exist.md) and press **Try it**.

```json theme={null}
{
  "abha_address": "YOUR_ABHA_ADDRESS"
}
```

`exists` should be `false`. If it is `true`, pick another address and check again.

> **Prefer curl?**
>
> ```bash theme={null}
> curl -X POST "https://api.dev.eka.care/abdm/na/v1/registration/phr/check" \
>   -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{"abha_address": "YOUR_ABHA_ADDRESS"}'
> ```

## 6. Create the ABHA

This registers the ABHA with ABDM. It creates a real sandbox account, so send it once.

Open [Create](https://developer.eka.care/api-sdk/hie-cm/enrollment/aadhaar/create-abha.md) and press **Try it**. Send the `txn_id` from step 3.

```json theme={null}
{
  "txn_id": "TXN_ID_FROM_STEP_3",
  "abha_address": "YOUR_ABHA_ADDRESS"
}
```

Copy `profile.abha_number`, `profile.abha_address` and `eka.oid`. Later calls for this patient send `eka.oid` in the `X-Pt-Id` header.

> **Prefer curl?**
>
> ```bash theme={null}
> curl -X POST "https://api.dev.eka.care/abdm/na/v1/registration/aadhaar/create-phr" \
>   -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{"txn_id": "TXN_ID_FROM_STEP_3", "abha_address": "YOUR_ABHA_ADDRESS"}'
> ```

## How this fits your product

These calls are the identity step of [Register a walk-in patient and link the visit](https://developer.eka.care/docs/hie-cm/journeys/hip-register-patient-and-link-visit.md), the registration desk journey for a HIP. They cover [Milestone 1](https://developer.eka.care/docs/hie-cm/flows/m1). Linking the visit to the new ABHA is [Milestone 2](https://developer.eka.care/docs/hie-cm/flows/m2).

## If a call fails

Start with [By symptom](https://developer.eka.care/docs/hie-cm/errors.md#by-symptom) on the errors page. It covers OTPs that never arrive, lockouts and `401` responses. For each failure in this flow, the [workflow's failure table](https://developer.eka.care/docs/hie-cm/workflows/create-abha-aadhaar-otp.md#when-it-fails) says what to do. Which code each call returns is not yet confirmed, so log the code you actually receive.

## Next

* [Create an ABHA with Aadhaar OTP](https://developer.eka.care/docs/hie-cm/workflows/create-abha-aadhaar-otp.md): the other branches, resend, the `abha.created` webhook and the state to persist.
* [Link a care context as a HIP](https://developer.eka.care/docs/hie-cm/workflows/link-care-context-hip.md): link the patient's visit to the new ABHA.
* [Testing](https://developer.eka.care/docs/hie-cm/testing.md): the happy path for every journey before you go live.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.