WoNS/
Developer REST API Reference
v1.0

WoNS REST API Documentation

Programmatically create, manage, and delete short links with sub-millisecond global resolution, custom domains, and automated SSL.

Base URL
https://api.wons.in/v1
Response Format
JSON (application/json)
Resolution Latency
< 2ms (Direct Index)
GET
/api/v1/...

Authentication Header

Authenticate all requests by supplying your developer API key in either the x-api-key header or Authorization: Bearer header.

cURL Code
curl -X GET "https://api.wons.in/v1/links" \
  -H "x-api-key: YOUR_API_KEY"
HTTP Response
200
{
  "success": true,
  "count": 1,
  "links": [
    {
      "domain": "wons.in",
      "slug": "github",
      "destination": "https://github.com",
      "redirectType": 301,
      "status": "active",
      "clicks": 42
    }
  ]
}
GET
/api/v1/domains

List Custom Domains

Retrieve all configured custom domains, SSL status, and verification states.

cURL Code
curl -X GET "https://api.wons.in/v1/domains" \
  -H "x-api-key: YOUR_API_KEY"
HTTP Response
200
{
  "success": true,
  "domains": [
    {
      "domain": "wons.in",
      "status": "active",
      "verified": true,
      "sslStatus": "active",
      "isDefault": true
    },
    {
      "domain": "link.subhm.in",
      "status": "active",
      "verified": true,
      "sslStatus": "active",
      "cnameTarget": "wons.in"
    }
  ]
}
POST
/api/v1/domains

Add Custom Domain

Register a new custom domain or subdomain. Point your DNS CNAME record to wons.in for automated SSL provisioning.

Request Body JSON

FieldTypeRequiredDescription
domainstring
Required
Fully-qualified domain name (e.g. link.subhm.in)
rootRedirectstringOptionalOptional redirect URL for root path visitors
cURL Code
curl -X POST "https://api.wons.in/v1/domains" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "domain": "link.subhm.in",
    "rootRedirect": "https://subhm.in"
  }'
HTTP Response
201
{
  "success": true,
  "domain": {
    "domain": "link.subhm.in",
    "status": "active",
    "verified": true,
    "cnameTarget": "wons.in",
    "rootRedirect": "https://subhm.in"
  }
}