Complete reference for all 301LINK API v1 endpoints

REST API Endpoints

All endpoints are served from https://api.301link.com/.

Endpoints Overview

Method Path Description Auth Required
GET /v1/get/:shortcode Resolve a short link by its shortcode No
GET /v1/new_account Create a new account and receive an access code No
GET /v1/links List all links belonging to the authenticated account Yes
GET /v1/link Create a new short link Yes
DELETE /v1/link Delete a short link Yes
GET /v1/get_account Get account information Yes

Look up a short link by its shortcode.

Request

GET /v1/get/myshortcode HTTP/1.1
Host: 301link.com

Response

Returns a Link object as JSON.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ShortCode": "abcd",
  "PointsTo": "https://example.com/1",
  "CreatedBy": 0,
  "Accesses": 123
}

Accounts

Create a New Account

Create a new account. Returns an access code that is used to authenticate all subsequent requests to protected endpoints.

Request

GET /v1/new_account HTTP/1.1
Host: 301link.com

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Uid": 123,
  "AccessCode": "550e8400-e29b-41d4-a716-446655440000",
  "DateCreated": "2026-01-01T00:00:00.000Z",
  "MaxLinks": 20
}

Get Account Info

Get information about your account

Request

GET /v1/user_info?auth=<access_code> HTTP/1.1
Host: 301link.com

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "Uid": 123,
  "AccessCode": "550e8400-e29b-41d4-a716-446655440000",
  "DateCreated": "2026-01-01T00:00:00.000Z",
  "MaxLinks": 20
}

Retrieve all short links belonging to the authenticated account.

Request

GET /v1/links?auth=<access_code> HTTP/1.1
Host: 301link.com

Response

Returns an array of Link objects as JSON.

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "ShortCode": "abcd",
    "PointsTo": "https://example.com/1",
    "CreatedBy": 0,
    "Accesses": 123
  },
  {
    "ShortCode": "test",
    "PointsTo": "https://example.com/2",
    "CreatedBy": 0,
    "Accesses": 0
  }
]

Create or delete a short link for the authenticated account. Both operations use the same endpoint (/v1/link), distinguished by the HTTP method.

Request

GET /v1/link?url=<long_url>&short=<custom_shortcode>&auth=<access_code> HTTP/1.1
Host: 301link.com

Short is optional. It is if you want a custom URL.

Validation Rules

  • url (long_url): Maximum 2000 characters
  • short (custom_shortcode): If specified, must be at least 5 characters and at most 2000 characters

Response

On success, the full shortened URL is returned as plain text.

HTTP/1.1 200 OK
Content-Type: text/plain

https://301link.com/abcd

Request

DELETE /v1/link?short=<shortcode>&auth=<access_code> HTTP/1.1
Host: 301link.com

Response

HTTP/1.1 200 OK
Content-Type: text/plain

Success

CLI Example

# 1. Create an account
ACCESS_CODE=$(curl -s https://api.301link.com/v1/new_account | jq -r .AccessCode)

# 2. Create a short link
SHORT_URL=$(curl -s "https://api.301link.com/v1/link?url=https://example.com/page&auth=$ACCESS_CODE")

# 3. Resolve the shortcode
SHORTCODE="abcd"
curl "https://api.301link.com/v1/get/$SHORTCODE"

# 4. List all your links
curl "https://api.301link.com/v1/links?auth=$ACCESS_CODE"

# 5. Delete a link
curl -X DELETE "https://api.301link.com/v1/link?short=$SHORTCODE&auth=$ACCESS_CODE"