Skip to main content

Overview

Create a new dynamic link that intelligently routes users to the right destination based on their device and app installation status. Dynamic links work across iOS, Android, and web platforms with advanced analytics tracking.

Endpoint

POST https://api.bit2connect.com/1.0/links

Request Parameters

For detailed information about all request parameters and payload configuration, see the Create Link API Reference.

Mobile App Integration

You have two options for configuring mobile app behavior: 1. Use Saved Mobile Apps (Recommended)
{
  "payload": {
    "link": "https://example.com/content",
    "iosAppId": "550e8400-e29b-41d4-a716-446655440000",
    "androidAppId": "550e8400-e29b-41d4-a716-446655440001"
  }
}
2. Configure Manually (with optional save)
{
  "payload": {
    "link": "https://example.com/content",
    "ios": {
      "bundleId": "com.example.app",
      "app_store_fallback": "https://apps.apple.com/app/id123456789",
      "saveApp": true,
      "appName": "My iOS App"
    }
  }
}
Learn more about mobile app management in the Mobile Apps Guide.

Code Validation

When specifying a custom code parameter:
  • Length: 3-50 characters
  • Characters: Alphanumeric, hyphens (-), and underscores (_) only
  • Uniqueness: Must be unique within your project
Check Availability First: Use the Check Code Availability endpoint to verify if your desired code is available before creating the link.

Example Request

curl -X POST "https://api.bit2connect.com/1.0/links" \
  -H "X-API-KEY: b2co_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "product-launch",
    "name": "New Product Launch",
    "payload": {
      "link": "https://example.com/products/new-launch",
      "android": {
        "package": "com.example.app",
        "store_fallback": "https://play.google.com/store/apps/details?id=com.example.app"
      },
      "ios": {
        "bundleId": "com.example.app",
        "app_store_fallback": "https://apps.apple.com/app/example-app/id123456789"
      },
      "social": {
        "title": "Introducing Our Latest Product!",
        "description": "Discover amazing features and exclusive deals",
        "image": "https://example.com/images/product-launch.jpg"
      },
      "campaign": {
        "utm_source": "api",
        "utm_medium": "dynamic_link",
        "utm_campaign": "product_launch_2024"
      }
    },
    "expiresAt": "2024-12-31T23:59:59Z"
  }'

Response

Success Response

{
  "success": true,
  "data": {
    "id": "clp123abc456",
    "code": "product-launch",
    "shortUrl": "https://b2co.link/product-launch",
    "originalUrl": "https://example.com/products/new-launch",
    "name": "New Product Launch",
    "status": "ACTIVE",
    "qrCode": "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://b2co.link/product-launch",
    "createdAt": "2024-01-15T10:30:00Z",
    "expiresAt": "2024-12-31T23:59:59Z",
    "clickCount": 0
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

Error Response

{
  "success": false,
  "error": {
    "code": "CODE_ALREADY_EXISTS",
    "message": "The specified code is already in use"
  }
}
For detailed response fields and error codes, see the Create Link API Reference.

Next Steps