Skip to main content
POST
/
links
/
create
Create Link
curl --request POST \
  --url https://api.example.com/links/create \
  --header 'Content-Type: application/json' \
  --data '
{
  "organizationId": "<string>",
  "name": "<string>",
  "targetUrl": "<string>",
  "slug": "<string>",
  "expiresAt": "<string>",
  "expiredRedirectUrl": "<string>",
  "ogTitle": "<string>",
  "ogDescription": "<string>",
  "ogImageUrl": "<string>",
  "ogVideoUrl": "<string>",
  "iosUrl": "<string>",
  "androidUrl": "<string>",
  "externalId": "<string>"
}
'
{
  "id": "<string>",
  "slug": "<string>",
  "name": "<string>",
  "targetUrl": "<string>",
  "organizationId": "<string>",
  "createdBy": "<string>",
  "createdAt": "<string>"
}

Authentication

Requires API key with write:links scope.

Request Body

organizationId
string
required
Organization ID to create the link under
name
string
required
Display name for the link (max 255 characters)
targetUrl
string
required
Destination URL (must be absolute HTTP/HTTPS URL)
slug
string
Custom slug (3-50 characters, alphanumeric, hyphens, underscores). Auto-generated if not provided
expiresAt
string
ISO 8601 expiration date. Link redirects to expiredRedirectUrl after this time
expiredRedirectUrl
string
URL to redirect to after expiration
ogTitle
string
Open Graph title for link previews (max 200 characters)
ogDescription
string
Open Graph description (max 500 characters)
ogImageUrl
string
Open Graph image URL
ogVideoUrl
string
Open Graph video URL
iosUrl
string
iOS-specific destination URL (for device targeting)
androidUrl
string
Android-specific destination URL (for device targeting)
externalId
string
Your external identifier for this link (max 255 characters)

Response

id
string
Unique link identifier
slug
string
Generated or custom slug. Full URL is https://dby.to/{slug}
name
string
Display name
targetUrl
string
Destination URL
organizationId
string
Parent organization ID
createdBy
string
User ID that created the link
createdAt
string
ISO 8601 timestamp of creation

Example Request

curl -X POST https://api.databuddy.cc/links/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "organizationId": "org_abc123",
    "name": "Product Launch",
    "targetUrl": "https://example.com/products/new",
    "slug": "launch",
    "ogTitle": "Check out our new product!",
    "ogDescription": "The best product launch of 2024",
    "ogImageUrl": "https://example.com/og-image.png"
  }'

Example Response

{
  "id": "lnk_xyz123",
  "slug": "launch",
  "name": "Product Launch",
  "targetUrl": "https://example.com/products/new",
  "organizationId": "org_abc123",
  "createdBy": "usr_456",
  "expiresAt": null,
  "expiredRedirectUrl": null,
  "ogTitle": "Check out our new product!",
  "ogDescription": "The best product launch of 2024",
  "ogImageUrl": "https://example.com/og-image.png",
  "ogVideoUrl": null,
  "iosUrl": null,
  "androidUrl": null,
  "externalId": null,
  "createdAt": "2024-03-01T17:00:00Z",
  "updatedAt": "2024-03-01T17:00:00Z"
}

Short URL

Your link is now accessible at:
https://dby.to/launch