Developer reference

DIDHub Documentation

Everything you need to integrate DIDHub into your product — REST API, SDKs, webhooks, integration guides, deployment patterns. Most flows are single-call REST.

API quickstart

The DIDHub REST API uses standard JSON over HTTPS with bearer-token authentication. The most common operations are exposed as single REST calls. Full reference at didhub.io/#api.

# Authenticate (one-time)
curl -H "Authorization: Bearer $DIDHUB_TOKEN" https://api.didhub.io/v1/me

# List inventory by country
curl -H "Authorization: Bearer $DIDHUB_TOKEN" https://api.didhub.io/v1/numbers?country=US&city=NYC

# Buy a number
curl -X POST -H "Authorization: Bearer $DIDHUB_TOKEN" \
  -d '{"number": "+12125551234"}' \
  https://api.didhub.io/v1/numbers/order

# Configure routing
curl -X PATCH -H "Authorization: Bearer $DIDHUB_TOKEN" \
  -d '{"sip_uri": "sip:[email protected]"}' \
  https://api.didhub.io/v1/numbers/+12125551234/routing

# Send SMS
curl -X POST -H "Authorization: Bearer $DIDHUB_TOKEN" \
  -d '{"from": "+12125551234", "to": "+447700123456", "body": "Hi"}' \
  https://api.didhub.io/v1/sms/send

SDKs

Node / TypeScript

npm install @didhub/sdk — first-class TS types, async/await, runtime-validated responses.

Python

pip install didhub — sync + async clients, dataclasses for response models, retries built in.

Go

go get github.com/didhub/didhub-go — context-aware, generated from the OpenAPI spec, zero-allocation request paths.

PHP

composer require didhub/didhub-php — Guzzle-based HTTP, PSR-7 compatible, Laravel service provider included.

Ruby

gem install didhub — idiomatic Ruby, faraday adapter, suitable for Rails integrations.

Java / Kotlin

com.didhub:didhub-sdk on Maven Central — RxJava + coroutines support, suitable for Android.

Integration guides

Webhooks

DIDHub posts events to your endpoint as they happen — call started, call ended, SMS received, port-in completed, billing event, etc. Webhooks are signed (HMAC-SHA256) and delivered with at-least-once semantics + retry.

# Configure webhook URL via dashboard or API
POST /v1/webhooks
{"url": "https://your-app.com/didhub/webhook", "events": ["call.started", "call.ended", "sms.received", "port.completed"]}

# Sample event payload
{
  "type": "call.ended",
  "id": "evt_abc123",
  "timestamp": "2026-04-25T14:23:45Z",
  "data": {
    "from": "+447700123456",
    "to": "+12125551234",
    "duration_sec": 142,
    "direction": "inbound"
  }
}

Frequently asked questions

Is the API free?

Yes. The API is included with every DIDHub account at no extra charge. You pay only for the underlying numbers, minutes, and messages.

What's the rate limit?

Default: 100 req/sec per API key, 10,000 req/min. Higher limits available on request for high-volume customers (contact-center auto-provisioning, mass port-ins, etc.).

Where's the OpenAPI spec?

Published at https://api.didhub.io/v1/openapi.json. The SDKs above are generated from this spec; use it to generate your own client in any language.

Are webhooks signed?

Yes. Each delivery includes an X-DIDHub-Signature header (HMAC-SHA256 of body using your shared secret). Validate before processing.

Ready to get a number?

Pick a DID in 80+ countries from $1.99/month. Activates instantly on most numbers.