Links

Create a New Link

Creates a new branded short link in the specified workspace.

Authorization:

  • Requires valid apikey header
  • Requires Workspace header to specify the workspace

Validation:

  • destination must be a valid URL
  • domainId must reference a verified domain shared with the workspace
  • slashtag must be unique for the domain (auto-generated if not provided)
  • slashtag length must comply with domain settings

Features:

  • links.notes feature allows description field
  • Link TTL is calculated based on workspace features
post/links

Request

  • Base URL
    https://api.rebrandly.com/v1
  • URL
    https://api.rebrandly.com/v1/links
  • Auth
    API key in header apikey

Headers

Workspacestring required
Example:workspace123abc

Workspace ID header (required by middleware)

apikeystring required
Example:your-api-key-here

API key for authentication

Request body

destinationstring uri required

Target URL where the short link redirects

domainIdstring

Public ID of the domain to use (must be verified and shared with workspace)

slashtagstring

Custom path component (auto-generated if not provided, must be unique)

titlestring

Human-readable title for the link

descriptionstring

Link description (requires links.notes feature)

Example request

{
  "destination": "https://example.com/long/path/to/resource",
  "domainId": "domain123abc",
  "domain": {
    "id": "domain123abc"
  },
  "slashtag": "my-custom-link",
  "title": "My Example Link",
  "description": "This link redirects to our example page"
}

Response

Successfully created link

idstring required

Link public ID (link_public_id)

titlestring

Human-readable title for the link

slashtagstring required

URL path component

destinationstring uri required

Target URL where the link redirects

shortUrlstring required

Complete short URL (domain + slashtag)

domainIdstring

Public ID of the domain used

domainNamestring

Full domain name

clicksinteger

Number of clicks on the link

createdAtstring date-time required

Timestamp when link was created

updatedAtstring date-time required

Timestamp when link was last updated

status'active' | 'deleted' | 'blocked' required

Link status

descriptionstring

Link description (only if links.notes feature is enabled)

httpsboolean

Whether the link supports HTTPS

Example response

{
  "id": "abc123def456",
  "title": "My Example Link",
  "slashtag": "my-link",
  "destination": "https://example.com",
  "shortUrl": "rebrand.ly/my-link",
  "domainId": "domain123abc",
  "domainName": "rebrand.ly",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "status": "active",
  "description": "This link redirects to our example page",
  "https": true
}

Changes

No recorded changes to this operation across all 1 revision of this API.