Retrieve your accountGET /v1/me
Confirm that an API key works and see the account it belongs to. Useful as a health check when you deploy or rotate keys.
Account
Retrieve your account
Confirms a key works and shows the account it belongs to. Useful as a health check when you deploy.
Response
- client.idintegerrequiredYour account id.
- client.namestringrequiredYour business name.
- client.statusstringrequiredWhere your account stands.
Values: trial | pending_review | live | suspended
- key.namestringrequiredThe name you gave this key.
- key.last_fourstringrequiredThe last four characters of the key.
curl https://api-diotp.diorbit.com/v1/me \
-H "Authorization: Bearer $DIOTP_API_KEY"const res = await fetch("https://api-diotp.diorbit.com/v1/me", { headers: { Authorization: `Bearer ${process.env.DIOTP_API_KEY}` }, }); const me = await res.json();
me = requests.get(
"https://api-diotp.diorbit.com/v1/me",
headers={"Authorization": f"Bearer {os.environ['DIOTP_API_KEY']}"},
timeout=10,
).json()<?php $ch = curl_init("https://api-diotp.diorbit.com/v1/me"); curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer " . getenv("DIOTP_API_KEY")]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $me = json_decode(curl_exec($ch), true);
{
"client": { "id": 42, "name": "Chai Point", "status": "live" },
"key": { "id": 7, "name": "server", "last_four": "9f2c" }
}When to call it
GET /v1/me tells you which account an API key belongs to and whether that account can send. It sends nothing and costs nothing, so it is a safe first call for a new integration and a good health check.
Call it when your server starts, after you deploy, and after you rotate a key. If it returns 401, the key in that environment is wrong or revoked, and you find out before a user waits for a code that never comes.
Request and response examples
curl https://api-diotp.diorbit.com/v1/me \
-H "Authorization: Bearer $DIOTP_API_KEY"{
"client": { "id": 42, "name": "Chai Point", "status": "live" },
"key": { "id": 7, "name": "server", "last_four": "9f2c" }
}{
"error": {
"code": "unauthorized",
"message": "invalid api key",
"request_id": "3f1c9a0e5b7d4e2a8c6f1b0d9e8a7c6b"
}
}Account status
client.status says what the key can do right now:
- trial: test mode. Codes go only to the mobile number you signed up with, until the free test messages run out.
- pending_review: you asked to go live and we are checking your business. Test mode rules still apply.
- live: the key sends to any Indian mobile number, charged from your wallet.
- suspended: sending is paused. Sends return account_suspended; contact support.
Error codes
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | No Authorization header, or it is not in the form Bearer <key>. The message says "missing bearer token". |
| 401 | unauthorized | The key does not exist or was revoked. The message says "invalid api key". |
| 401 | unauthorized | The key belongs to a project that was switched off. The message says "application is inactive". |
Retrieve your account: FAQ
No. The per-key sending limit applies to sends only, and this call is never charged.
DiOTP keeps a hash of each key, not the key itself, so it can only show you enough to tell keys apart. If you lose a key, create a new one and revoke the old one.
Not today. Your wallet balance is on the dashboard. For what you have spent in a month, use GET /v1/usage.
Need help integrating?
Our team helps with integration, DLT templates and going live.

