GNSDeveloper Docsv1.0 (Current)
API Reference

REST API Reference

Complete endpoint specification, parameters, and response schemas for the GNS REST API.

GNS REST API Reference

All requests to the GNS API are served over HTTPS and expect/return JSON payloads.

  • Production Base URL: https://api.gns.iitdeveloper.com
  • Current API Version: v1 (/api/v1/...)
  • OpenAPI Schema: Statically exported at /content/openapi.json (85 paths)

Global Headers

HeaderRequiredExample / FormatDescription
AuthorizationYesBearer gns_live_sk_...Application secret key or Keycloak JWT.
Content-TypeYes (for POST/PATCH)application/jsonRequest payload format.
Idempotency-KeyOptional9b1deb4d-3b7d-4bad-...Prevents duplicate sends on network retries.

Core Notification Endpoints

1. Dispatch Notification

POST /api/v1/notifications

Dispatches a notification across email, SMS, WhatsApp, or in-app channels.

Request Body Parameters

ParameterTypeRequiredDescription
channelstringYesDestination channel: email, sms, whatsapp, in_app.
recipientstringYesTarget email address, E.164 phone number, or user ID.
subjectstringOptionalSubject line (used for email and in-app).
bodystringYesPlaintext message body.
html_bodystringOptionalFormatted HTML content (for email).
template_idstringOptionalStored template identifier.
template_dataobjectOptionalKey-value pairs interpolated into template placeholders.
Response202 Accepted
{
  "status": "accepted",
  "notification_id": "notif_01J7K3X9AB0C1D2E",
  "channel": "email",
  "delivery_status": "queued"
}

Transactional OTP Endpoints

2. Send OTP Code

POST /api/v1/otp/send

Generates and delivers a cryptographically secure one-time password.

Request Body Parameters

ParameterTypeRequiredDescription
channelstringYesemail or sms.
recipientstringYesTarget recipient.
lengthintegerOptionalNumber of digits (default: 6, options: 4 or 6).
ttl_secondsintegerOptionalTime before expiry (default: 300).
codestringOptionalCaller-provided custom code (requires otp:custom_code permission).
Response200 OK
{
  "status": "sent",
  "transaction_id": "otp_01J7M5QW8B9C0D1E",
  "expires_in_seconds": 300
}

3. Verify OTP Code

POST /api/v1/otp/verify

Validates a user-submitted code against an active session.

Response200 OK
{
  "status": "verified",
  "transaction_id": "otp_01J7M5QW8B9C0D1E",
  "verified_at": "2026-09-13T13:30:00Z"
}

Custom Sending Domain Endpoints

4. List Verified Domains

GET /api/v1/domains

Returns all custom sending domains configured for the current tenant.

5. Add Custom Domain

POST /api/v1/domains

Registers a new sending domain and generates DNS challenge tokens.

6. Verify Domain DNS Records

POST /api/v1/domains/{domain_id}/verify

Triggers immediate DNS resolution checks for SPF and DKIM.


Delivery Activity Endpoints

7. Query Activity Feed

GET /api/v1/activity

Queries the paginated, masked delivery timeline across all applications and channels.

8. Retry Delivery

POST /api/v1/activity/{id}/retry

Re-enqueues a previously failed dispatch for execution.

On this page