Import
POST /workspaces/:wsId/import/links
Import links from a CSV string. Auto-detects Bitly export format or accepts generic CSV.
Role: editor+
curl -X POST https://nobsredir.com/api/workspaces/ws_abc123/import/links \ -H "X-API-Key: nobs_your_key" \ -H "Content-Type: application/json" \ -d '{ "csv": "target,title,tags\nhttps://example.com,My Page,\"marketing,social\"\nhttps://other.com,Other,campaign", "format": "auto", "domain": "go.yourco.com" }'Request body
| Field | Type | Required | Description |
|---|---|---|---|
csv | string | Yes | Raw CSV text (including header row) |
format | string | No | "generic", "bitly", or "auto" (default: "auto") |
domain | string | No | Domain for imported links (default: fnl.sh) |
CSV columns
Generic format - recognized target columns: target, url, destination, long_url
| Column | Required | Description |
|---|---|---|
target / url / destination / long_url | Yes | Destination URL |
title | No | Link title |
slug | No | Custom slug (requires custom domain) |
tags | No | Comma-separated tags (max 10) |
note | No | Internal note |
Bitly format - auto-detected when bitlink column is present. Uses long_url for target.
Response (201)
{ "created": 2, "skipped": 0, "errors": [ { "row": 4, "reason": "Missing target URL" } ], "links": [ { "id": "xK9mQ2bL", "domain": "go.yourco.com", "slug": "abc123", "target": "https://example.com", "title": "My Page", "tags": ["marketing", "social"], "short_url": "https://go.yourco.com/abc123" } ]}Error responses
| Status | Reason |
|---|---|
| 400 | Missing csv field, empty CSV, no data rows, over 500 rows, no target column |
| 403 | Insufficient role (viewer cannot import) |
Per-row errors
Rows that fail validation are reported in the errors array with the 1-indexed row number and reason. Valid rows are still imported.
Common per-row errors:
- Missing target URL
- Invalid URL (not http/https)
- Custom slug on fnl.sh (requires custom domain)
- Slug already exists on this domain
- Invalid slug characters
Limits
- Maximum 500 data rows per request
- Maximum 10 tags per link (extras truncated)
- Custom slugs require a custom domain