API Documentation

Welcome to the yLnk External Client API documentation. This API allows you to programmatically create, manage, and analyze short links using API key authentication.

Getting Started

Authentication

All API requests require authentication using an API key. You can create and manage API keys from your Settings page.

Using API Keys

Include your API key using the X-API-Key header:

X-API-Key: YOUR_API_KEY

Note: External client APIs only accept API keys via the X-API-Key header. JWT tokens (Authorization Bearer) are not supported for these endpoints.

Workspace Scope

  • External API keys are workspace-bound.
  • Every request runs in the workspace (orgId) attached to that API key.
  • Cross-workspace data is not accessible.

Breaking Change (Key Rotation Required)

  • Legacy external API keys without workspace binding (orgId = null) are rejected.
  • Recreate API keys from the target workspace and rotate keys in your client applications.

Base URL

https://api.ylnk.cc/v2/external/client

Rate Limits

Rate limits and API-key availability depend on the effective workspace plan and configured server policies. Request throttling and link-creation quotas are separate. Handle 429 with bounded backoff; do not assume a fixed limit or that all responses expose quota headers.

Creation and domains

Response Format

All API responses follow this structure:

{
  "status": true,
  "message": "Success message",
  "data": { ... }
}

Error Handling

Errors are returned with appropriate HTTP status codes:

  • 400 Bad Request: Invalid request parameters
  • 401 Unauthorized: Missing or invalid API key
  • 403 Forbidden: Insufficient permissions
  • 406 Not Acceptable: Subscription quota rejection
  • 409 Conflict: Alias conflict, ambiguous code or changed/deleted idempotent request
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server error

Error response format:

{
  "status": false,
  "message": "Error",
  "data": null,
  "error": [
    {
      "errorCode": 400,
      "message": "Readable error message"
    }
  ]
}

Endpoints

Short Links

Analytics

Code Examples

Choose your preferred language: