> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bit2connect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Links

> Retrieve a paginated list of dynamic links for your project

## Request

<ParamField header="X-API-KEY" type="string" required>
  Your project API key: `b2co_your_api_key`
</ParamField>

<ParamField query="page" type="number" default="1">
  Page number for pagination (starts from 1)
</ParamField>

<ParamField query="pageSize" type="number" default="50">
  Number of links per page (maximum 100)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="array">
  Array of link objects with complete payload structure
</ResponseField>

<ResponseField name="data[].id" type="string">
  Unique identifier for the link
</ResponseField>

<ResponseField name="data[].code" type="string">
  Unique short code for the link
</ResponseField>

<ResponseField name="data[].shortUrl" type="string">
  Complete short URL (e.g., [https://b2co.link/abc123](https://b2co.link/abc123))
</ResponseField>

<ResponseField name="data[].name" type="string">
  Display name of the link
</ResponseField>

<ResponseField name="data[].status" type="string">
  Link status: ACTIVE, PAUSED, or EXPIRED
</ResponseField>

<ResponseField name="data[].payload" type="object">
  Complete link configuration payload
</ResponseField>

<ResponseField name="data[].payload.link" type="string">
  Primary destination URL
</ResponseField>

<ResponseField name="data[].payload.android" type="object">
  Android-specific configuration (optional)
</ResponseField>

<ResponseField name="data[].payload.ios" type="object">
  iOS-specific configuration (optional)
</ResponseField>

<ResponseField name="data[].payload.social" type="object">
  Social media preview configuration (optional)
</ResponseField>

<ResponseField name="data[].id" type="string">
  Unique identifier for the link
</ResponseField>

<ResponseField name="data[].code" type="string">
  Unique short code for the link
</ResponseField>

<ResponseField name="data[].shortUrl" type="string">
  Complete short URL (e.g., [https://b2co.link/abc123](https://b2co.link/abc123))
</ResponseField>

<ResponseField name="data[].name" type="string">
  Display name of the link
</ResponseField>

<ResponseField name="data[].status" type="string">
  Link status: ACTIVE, PAUSED, or EXPIRED
</ResponseField>

<ResponseField name="data[].qrCode" type="string">
  QR code URL for the link
</ResponseField>

<ResponseField name="data[].payload" type="object">
  Complete link configuration payload
</ResponseField>

<ResponseField name="data[].payload.link" type="string">
  Primary destination URL
</ResponseField>

<ResponseField name="data[].payload.android" type="object">
  Android-specific configuration (optional)
</ResponseField>

<ResponseField name="data[].payload.ios" type="object">
  iOS-specific configuration (optional)
</ResponseField>

<ResponseField name="data[].payload.social" type="object">
  Social media preview configuration (optional)
</ResponseField>

<ResponseField name="data[].payload.campaign" type="object">
  UTM campaign parameters (optional)
</ResponseField>

<ResponseField name="data[].createdAt" type="string">
  ISO 8601 timestamp when created
</ResponseField>

<ResponseField name="data[].expiresAt" type="string">
  ISO 8601 timestamp when expires (if set)
</ResponseField>

<ResponseField name="data[].clickCount" type="number">
  Total number of clicks on this link
</ResponseField>

<ResponseField name="data[].projectId" type="string">
  ID of the project this link belongs to
</ResponseField>

<ResponseField name="data[].createdBy" type="string">
  ID of the user who created the link
</ResponseField>

<ResponseField name="data[].updatedAt" type="string">
  ISO 8601 timestamp when last updated
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata
</ResponseField>

<ResponseField name="pagination.page" type="number">
  Current page number
</ResponseField>

<ResponseField name="pagination.pageSize" type="number">
  Number of items per page
</ResponseField>

<ResponseField name="pagination.total" type="number">
  Total number of links
</ResponseField>

<ResponseField name="pagination.totalPages" type="number">
  Total number of pages
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.bit2connect.com/1.0/links?page=1&pageSize=20" \
    -H "X-API-KEY: b2co_your_api_key"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.bit2connect.com/1.0/links?page=1&pageSize=20",
    {
      headers: {
        "X-API-KEY": "b2co_your_api_key",
      },
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.bit2connect.com/1.0/links"
  headers = {"X-API-KEY": "b2co_your_api_key"}
  params = {
      "page": 1,
      "pageSize": 20
  }

  response = requests.get(url, headers=headers, params=params)
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": [
      {
        "id": "clp123abc456",
        "code": "summer-sale",
        "shortUrl": "https://b2co.link/summer-sale",
        "name": "Summer Sale Campaign",
        "status": "ACTIVE",
        "qrCode": "https://b2co.link/summer-sale/qr",
        "payload": {
          "link": "https://example.com/summer-sale",
          "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": "Summer Sale - Up to 50% Off!",
            "description": "Don't miss our biggest sale of the year",
            "image": "https://example.com/images/summer-sale.jpg"
          },
          "campaign": {
            "utm_source": "api",
            "utm_medium": "dynamic_link",
            "utm_campaign": "summer_sale_2024"
          }
        },
        "createdAt": "2024-01-15T10:30:00Z",
        "expiresAt": "2024-12-31T23:59:59Z",
        "clickCount": 1247,
        "qrCode": "https://b2co.link/summer-sale/qr",
        "projectId": "proj_abc123",
        "createdBy": "user_xyz789",
        "updatedAt": "2024-01-15T10:30:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "pageSize": 20,
      "total": 45,
      "totalPages": 3
    }
  }
  ```

  ```json Error Response theme={null}
  {
    "success": false,
    "error": {
      "code": "INVALID_PARAMETERS",
      "message": "Invalid page size. Maximum allowed is 100."
    }
  }
  ```
</ResponseExample>

## Error Codes

<ResponseField name="INVALID_PARAMETERS" type="string">
  Invalid query parameters provided
</ResponseField>

<ResponseField name="INVALID_API_KEY" type="string">
  API key is missing or invalid
</ResponseField>

<ResponseField name="RATE_LIMIT_EXCEEDED" type="string">
  Too many requests, please try again later
</ResponseField>
