Developer API Documentation

Integrate 4wrd.ing into your applications with our simple and powerful REST API

Authentication

All API requests require authentication

Include your API key in the x-api-key header with every request.

x-api-key: YOUR_API_KEY

Get your API key from the admin dashboard.

Create Short Link

POST
/api/v1/shorten

Request Body

{
  "url": "https://example.com",
  "slug": "my-link"        // optional
}

Example Request

curl -X POST https://4wrd.ing/api/v1/shorten \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://google.com", "slug": "go"}'

Response

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "slug": "go",
    "short_link": "https://4wrd.ing/go",
    "admin_link": "https://4wrd.ing/550e8400-e29b-41d4-a716-446655440000",
    "target_url": "https://google.com"
  }
}

Create Multiple Links (Bulk)

POST
/api/v1/shorten

Request Body

{
  "url": "https://example.com",
  "count": 10,                          // number of links to create (max 100)
  "group_uuid": "uuid-here"             // optional: assign to group
}

Example Request

curl -X POST https://4wrd.ing/api/v1/shorten \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "count": 10}'

Response

{
  "success": true,
  "bulk": true,
  "batch_id": "batch-uuid",
  "count": 10,
  "links": [
    {
      "uuid": "uuid-1",
      "short_link": "https://4wrd.ing/uuid-1",
      "admin_link": "https://4wrd.ing/uuid-1",
      "target_url": "https://example.com"
    },
    ...
  ]
}

Create Link Group

POST
/api/v1/groups

Request Body

{
  "name": "Marketing Campaign",
  "description": "Q1 2024 links"        // optional
}

Example Request

curl -X POST https://4wrd.ing/api/v1/groups \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Marketing Campaign", "description": "Q1 2024"}'

Response

{
  "success": true,
  "group": {
    "uuid": "group-uuid",
    "name": "Marketing Campaign",
    "description": "Q1 2024 links",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Add Links to Group

POST
/api/v1/groups/{group_uuid}/links

Request Body

{
  "link_keys": ["link-uuid-1", "my-slug", "link-uuid-3"]
}

Example Request

curl -X POST https://4wrd.ing/api/v1/groups/GROUP_UUID/links \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"link_keys": ["uuid-1", "my-slug"]}'

Response

{
  "success": true,
  "updated": 2,
  "not_found": []
}

Get Link Statistics

GET
/api/v1/stats/{key}

URL Parameters

key - Can be either a UUID or slug

Example Request

curl https://4wrd.ing/api/v1/stats/go \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "slug": "go",
    "target_url": "https://google.com",
    "clicks": 42,
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Key Features

  • 1
    Dual-Mode Addressing: Every link gets both a UUID and optional custom slug
  • 2
    Smart Lookup: Automatically detects UUID vs slug format
  • 3
    Click Tracking: Built-in analytics for every link
  • 4
    Bulk Creation: Create up to 100 links at once for the same URL
  • 5
    Link Groups: Organize and track links together with combined analytics
  • 6
    Full-Screen Preview: Links display in iframe for seamless experience

Error Codes

400
Bad Request - Invalid URL or missing parameters
401
Unauthorized - Missing or invalid API key
404
Not Found - Link does not exist
409
Conflict - Slug already exists
500
Internal Server Error