API Documentation

Integrate NextLinks into your applications with our powerful REST API.

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Getting Your API Key

  1. Navigate to Account Settings
  2. Select API Keys
  3. Click "Generate New Key"
  4. Copy and securely store your key

Analytics API

Get Click Data

GET /v1/analytics/clicks

Retrieve click analytics for your links.

curl "https://api.nextlinks.com/v1/analytics/clicks?\
start_date=2024-01-01&end_date=2024-01-31&\
dimensions=country,device" \
  -H "Authorization: Bearer YOUR_API_KEY"

Get Conversion Data

GET /v1/analytics/conversions

Retrieve conversion data for your links.

curl "https://api.nextlinks.com/v1/analytics/conversions?\
link_id=abc123&start_date=2024-01-01" \
  -H "Authorization: Bearer YOUR_API_KEY"

Webhook Management

Create Webhook

POST /v1/webhooks

Create a new webhook endpoint.

curl -X POST https://api.nextlinks.com/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhook",
    "events": ["link.clicked", "conversion.recorded"],
    "secret": "your-webhook-secret"
  }'

Rate Limits

API requests are subject to rate limiting based on your plan:

Free Plan

  • 60 requests per minute
  • 1,000 requests per day

Pro Plan

  • 300 requests per minute
  • 10,000 requests per day

Enterprise Plan

  • Custom limits available
  • Contact sales for details

Error Handling

The API uses standard HTTP response codes and returns errors in JSON format:

{
  "error": {
    "code": "invalid_request",
    "message": "The request was invalid",
    "details": {
      "field": "destination",
      "reason": "URL is required"
    }
  }
}

Common Error Codes

  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 429 - Too Many Requests
  • 500 - Internal Server Error