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

# API Overview

> Overview of the Linquid REST API

## Base URL

All API requests should be made to:

```
https://api.linquid.io
```

## Authentication

Public API endpoints are authenticated via API key in the `X-API-Key` header.
Dashboard/session endpoints use session authentication and CSRF protection.

```bash theme={null}
curl -H "X-API-Key: lw_your_api_key_here" \
  https://api.linquid.io/api/links
```

See [Authentication](/quickstart/authentication) for details.

## Request Format

* All request bodies must be JSON
* Include `Content-Type: application/json` header for POST/PUT/PATCH requests

## Response Format

All responses follow a consistent format:

### Success Response

```json theme={null}
{
  "success": true,
  "data": {
    // Resource data
  }
}
```

### Success Response (List)

```json theme={null}
{
  "success": true,
  "data": [
    // Array of resources
  ],
  "pagination": {
    "total": 100,
    "page": 1,
    "limit": 20,
    "hasMore": true
  }
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message"
  }
}
```

## HTTP Status Codes

| Code | Description                               |
| ---- | ----------------------------------------- |
| 200  | Success                                   |
| 201  | Created                                   |
| 400  | Bad Request - Invalid input               |
| 401  | Unauthorized - Invalid or missing API key |
| 403  | Forbidden - Insufficient permissions      |
| 404  | Not Found - Resource doesn't exist        |
| 409  | Conflict - Resource already exists        |
| 429  | Too Many Requests - Rate limited          |
| 500  | Internal Server Error                     |

## Common Error Codes

| Code                    | Description                              |
| ----------------------- | ---------------------------------------- |
| `INVALID_API_KEY`       | API key is invalid or disabled           |
| `UNAUTHORIZED`          | Authentication required                  |
| `FORBIDDEN`             | Insufficient permissions for this action |
| `NOT_FOUND`             | Requested resource not found             |
| `VALIDATION_ERROR`      | Request body validation failed           |
| `RATE_LIMITED`          | Too many requests                        |
| `INSUFFICIENT_CREDITS`  | Workspace has insufficient credits       |
| `FEATURE_NOT_AVAILABLE` | Feature not available on current plan    |

## Pagination

List endpoints support pagination:

| Parameter | Description             | Default |
| --------- | ----------------------- | ------- |
| `page`    | Page number (1-indexed) | 1       |
| `limit`   | Items per page          | 20      |

```bash theme={null}
curl "https://api.linquid.io/api/links?page=2&limit=50" \
  -H "X-API-Key: lw_your_api_key_here"
```

## Filtering

Many list endpoints support filtering:

```bash theme={null}
# Filter links by campaign
curl "https://api.linquid.io/api/links?campaignId=camp_abc123" \
  -H "X-API-Key: lw_your_api_key_here"

# Filter by date range
curl "https://api.linquid.io/api/analytics/overview?start=2024-01-01&end=2024-01-31" \
  -H "X-API-Key: lw_your_api_key_here"
```

## Timestamps

All timestamps are returned in ISO 8601 format (UTC):

```json theme={null}
{
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T14:45:00.000Z"
}
```

## IDs

Resources use prefixed IDs for easy identification:

| Prefix  | Resource   |
| ------- | ---------- |
| `link_` | Links      |
| `rule_` | Rules      |
| `camp_` | Campaigns  |
| `px_`   | Pixels     |
| `dom_`  | Domains    |
| `ws_`   | Workspaces |

## API Endpoints

<CardGroup cols={2}>
  <Card title="Links" icon="link" href="/api-reference/links/list">
    Create and manage smart links
  </Card>

  <Card title="Rules" icon="code-branch" href="/api-reference/rules/list">
    Configure routing rules
  </Card>

  <Card title="Campaigns" icon="bullhorn" href="/api-reference/campaigns/list">
    Organize links into campaigns
  </Card>

  <Card title="Analytics" icon="chart-line" href="/api-reference/analytics/overview">
    Access click and conversion data
  </Card>

  <Card title="Conversions" icon="bullseye" href="/api-reference/conversions/track">
    Track conversion events
  </Card>

  <Card title="Pixels" icon="code" href="/api-reference/pixels/list">
    Manage tracking pixels
  </Card>

  <Card title="Advanced Modules" icon="sitemap" href="/api-reference/advanced-modules">
    Workspace, billing, integrations, affiliate, partner, and security APIs
  </Card>

  <Card title="Workspaces" icon="users" href="/api-reference/workspaces/overview">
    Manage workspaces, members, invitations, and ownership transfer
  </Card>

  <Card title="Billing" icon="credit-card" href="/api-reference/billing/overview">
    Plans, credits, subscriptions, and auto-recharge APIs
  </Card>

  <Card title="Customers & Events" icon="chart-line" href="/api-reference/customers/overview">
    Customer entities, event streams, cohorts, and attribution APIs
  </Card>

  <Card title="Integrations" icon="plug" href="/api-reference/integrations/overview">
    Integration install/configuration, provider callbacks, and outbound webhooks
  </Card>

  <Card title="Affiliate & Partner" icon="handshake" href="/api-reference/affiliate/overview">
    Program-owner APIs, marketplace flows, and partner-portal APIs
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/webhooks/overview">
    Workspace, link-level, and automation webhook management
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="Auth & Settings" icon="code" href="/api-reference/auth/overview">
    Session auth lifecycle, linked accounts, and user settings APIs
  </Card>

  <Card title="Domains & Organization" icon="link" href="/api-reference/domains/overview">
    Domain onboarding, tags, folders, and UTM template APIs
  </Card>

  <Card title="Tracking Modules" icon="chart-line" href="/api-reference/qr/overview">
    QR, deep-link attribution, publishable key, and SDK tracking APIs
  </Card>

  <Card title="Data Operations" icon="code" href="/api-reference/bulk-import/overview">
    Search, bulk operations, imports, and async export pipelines
  </Card>

  <Card title="Utilities & Support" icon="sparkles" href="/api-reference/utilities/overview">
    FX rates, notifications, feedback, metatags, email logs, and wrapped APIs
  </Card>

  <Card title="Identity & Enterprise" icon="users" href="/api-reference/identity/overview">
    OAuth apps, SAML SSO, and SCIM provisioning APIs
  </Card>

  <Card title="Public & Embed" icon="sitemap" href="/api-reference/public-embed/overview">
    Public stats and embedded analytics/link creation surfaces
  </Card>
</CardGroup>
