Back to Docs

Import & Export

Migrate your links from other services or export your data for backup and analysis.

CSV Import

Import links from a CSV file. The CSV must have a header row. Required column: url. Optional columns: slug, tags (comma-separated), expiresAt.

links.csv
url,slug,tags,expiresAt
https://example.com/page-1,page-1,"marketing,q1",2026-12-31
https://example.com/page-2,page-2,"blog",
https://example.com/page-3,,sales,

Upload via the API:

# Dry run (preview without creating)
curl -X POST https://linksnap.forjio.com/api/v1/links/import \
  -H "Authorization: Bearer <token>" \
  -F "file=@links.csv" \
  -F "dryRun=true"

# Actual import
curl -X POST https://linksnap.forjio.com/api/v1/links/import \
  -H "Authorization: Bearer <token>" \
  -F "file=@links.csv"

The dry run response shows how many links would be created, skipped (duplicate slugs), or rejected (invalid URLs) — without actually importing anything.

JSON Export

Export all your links as JSON (Pro and Business plans). The export includes link metadata, tags, and click counts.

GET /api/v1/links/export?format=json

# Response
[
  {
    "id": "lnk_...",
    "url": "https://example.com",
    "slug": "my-link",
    "clicks": 142,
    "tags": ["marketing"],
    "createdAt": "2026-01-15T10:00:00Z"
  },
  ...
]

CSV Export

Export all your links as CSV (available on all plans). The file downloads directly:

GET /api/v1/links/export?format=csv

# Downloads: linksnap-export-2026-03-23.csv
# Columns: id, url, slug, shortUrl, clicks, tags, status, createdAt

Migrating from Bitly

To migrate your links from Bitly:

  1. Export from Bitly: Go to Bitly dashboard → Settings → Data → Export. Download the CSV file.
  2. Reformat the CSV: Bitly exports use the columns long_url and title. Rename long_url to url. Optionally add a slug column.
  3. Import to LinkSnap: Use the CSV import endpoint or upload through the dashboard.
Example: reformatted Bitly export
url,slug,tags
https://example.com/blog-post,blog-post,"bitly-import"
https://example.com/product,product,"bitly-import"
https://example.com/landing,landing,"bitly-import"

Tip: Add a "bitly-import" tag to all imported links so you can easily find and manage them later.