API v1REST · JSON · HTTPS

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

GET/v1/me

Confirms a key works and shows the account it belongs to. Useful as a health check when you deploy.

Response

  • client.idintegerrequired
    Your account id.
  • client.namestringrequired
    Your business name.
  • client.statusstringrequired
    Where your account stands.

    Values: trial | pending_review | live | suspended

  • key.namestringrequired
    The name you gave this key.
  • key.last_fourstringrequired
    The last four characters of the key.
curl https://api-diotp.diorbit.com/v1/me \
  -H "Authorization: Bearer $DIOTP_API_KEY"
Response200 OK
{
  "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

Request
curl https://api-diotp.diorbit.com/v1/me \
  -H "Authorization: Bearer $DIOTP_API_KEY"
A live account200 OK
{
  "client": { "id": 42, "name": "Chai Point", "status": "live" },
  "key": { "id": 7, "name": "server", "last_four": "9f2c" }
}
A wrong or revoked key401 Unauthorized
{
  "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

StatusCodeMeaning
401unauthorizedNo Authorization header, or it is not in the form Bearer <key>. The message says "missing bearer token".
401unauthorizedThe key does not exist or was revoked. The message says "invalid api key".
401unauthorizedThe 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.

Need help integrating?

Our team helps with integration, DLT templates and going live.