Skip to Content
Relink API is in beta.
DocumentationAPI Endpoints

API Endpoints

Base URL

All API requests should be made to: https://relink.is/api/v1/


Authentication

Validate API Key

Endpoint: GET /api/v1/validate

Description: Test if your API key is valid and working properly.

Headers:

Authorization: Bearer rlk_your_api_key_here

Response:

{ "message": "API key is valid", "userId": "clp789user123", "status": "success" }

Errors:

  • 401: Invalid or missing API key

Endpoint: GET /api/v1/smartlink

Description: Retrieve all active smartlinks for the authenticated user.

Headers:

Authorization: Bearer rlk_your_api_key_here

Response:

[ { "id": "clp123abc456def", "status": "Active", "type": "App", "userId": "clp789user123", "createdAt": "2024-01-15T10:30:00.000Z", "updatedAt": "2024-01-15T14:45:00.000Z", "configuration": { /* ... */ }, "analytics": { "totalClicks": 1520, "totalQrCodeScans": 45, "totalFallBack": 12 }, // ... other related data } ]

Endpoint: GET /api/v1/smartlink?id=smartlink_id

Description: Retrieve a specific smartlink by ID.

Parameters:

  • id (query): The smartlink ID

Response: Single smartlink object with all related data.


Endpoint: POST /api/v1/smartlink

Description: Create a new smartlink. Users are limited by their subscription level:

  • Starter: 3 smartlinks maximum
  • Professional: 10 smartlinks maximum
  • Enterprise: Unlimited smartlinks

Headers:

Content-Type: application/json Authorization: Bearer rlk_your_api_key_here

Request Body:

{ "config": { "smartlinkTempUrl": "custom-url", // Optional: 6-char alphanumeric, auto-generated if not provided "smartlinkName": "My Smartlink", // Optional: defaults to "Relink Smartlink" "smartlinkType": "App" // Optional: defaults to "App" } }

Response:

{ "id": "clp123abc456def", "status": "Active", "type": "App", "relink": "https://relink.is/custom-url", "configuration": { /* ... */ }, "analytics": { /* ... */ }, // ... all related objects created with defaults }

Errors:

  • 403: Subscription limit reached
  • 409: Smartlink URL already exists

Endpoint: PUT /api/v1/smartlink

Description: Update an existing smartlink with new configuration, content, and settings.

Headers:

Content-Type: application/json Authorization: Bearer rlk_your_api_key_here

Base Request Structure:

{ "smartlinkId": "your-smartlink-id", "smartlinkConfig": { "type": "App|Url|Landing|QRTag|DigiCard|TxtBin" }, "configuration": { "smartlinkName": "My Smartlink", "smartlinkUrl": "my-smartlink" }, "openGraph": { "title": "Page Title", "description": "Page Description", "imageUrl": "https://example.com/image.jpg" }, "customHtml": { "head": "<meta name='custom' content='value'>", "body": "<script>console.log('Custom HTML');</script>", "active": true } }

Endpoint: DELETE /api/v1/smartlink

Description: Soft delete a smartlink (sets status to “Deleted”).

Headers:

Content-Type: application/json Authorization: Bearer rlk_your_api_key_here

Request Body:

{ "smartlinkId": "your-smartlink-id" }

Response:

{ "message": "Smartlink deleted successfully" }

Errors:

  • 404: Smartlink not found or doesn’t belong to user