Attach Links
POSThttps://www.viso.li/api/campaign/:id/links
Adds short links you already own to a campaign. The response is the updated campaign, including its attached links.
Send Authorization: Bearer sk_api_your_api_key on every request. See authentication.
Path parameters
| Field | Type | Description |
|---|---|---|
id | string | Required. The campaign UUID. |
Request body
Fields
| Field | Type | Description |
|---|---|---|
linkSlugs | string[] | Required. One or more public slugs to attach. |
Example request
1curl -X POST https://www.viso.li/api/campaign/3f1c0c2a-7b4e-4d91-9c2a-1b8e6f0d2a11/links \
2 -H "Authorization: Bearer sk_api_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "linkSlugs": [
6 "def456"
7 ]
8}'
Success response
Returns 200 OK. The body matches GET /api/campaign/:id.
response.json
1{
2 "id": "3f1c0c2a-7b4e-4d91-9c2a-1b8e6f0d2a11",
3 "name": "Bio link",
4 "description": null,
5 "status": "ACTIVE",
6 "templateKey": "bio-evergreen",
7 "goal": {
8 "type": "CLICKS",
9 "config": {
10 "target": 10000,
11 "windowDays": 30
12 }
13 },
14 "progress": {
15 "type": "CLICKS",
16 "target": 10000,
17 "current": 1240,
18 "remaining": 8760,
19 "percent": 12,
20 "reached": false
21 },
22 "linkCount": 2,
23 "links": [
24 {
25 "slug": "abc123",
26 "alias": null,
27 "url": "https://example.com/bio"
28 }
29 ],
30 "startsAt": null,
31 "endsAt": null,
32 "createdAt": "2026-08-22T14:00:00.000Z"
33}
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Required. Campaign UUID. |
name | string | Required. Campaign name. |
description | string | null | Required. Short description, or null. |
status | string | Required. ACTIVE, DRAFT, or ENDED. |
templateKey | string | null | Required. Stored template key, or null. |
goal | object | null | Required. Typed goal settings stored for this campaign. |
progress | object | null | Required. Current vs target, when the goal is numeric. |
linkCount | number | Required. Number of attached links. |
links | object[] | Required. Attached short links with slug, alias, and destination URL. |
links[].slug | string | Required. Public slug of the attached link. |
links[].alias | string | null | Required. Custom back-half, or null. |
links[].url | string | Required. Destination URL. |
startsAt | string | null | Required. ISO 8601 start, or null. |
endsAt | string | null | Required. ISO 8601 end, or null. |
createdAt | string | Required. ISO 8601 time the campaign was created. |
Errors
| Status | Error | Description |
|---|---|---|
| 400 | Bad Request | The campaign id is invalid, linkSlugs is empty, or a slug could not be found. |
| 401 | Unauthorized | Missing, malformed, or invalid Bearer token. |
| 403 | Forbidden | Campaigns are not available on the current plan. |
| 404 | Not Found | No campaign with that id belongs to you. |
| 429 | Too Many Requests | More than 10 requests per minute and 50 requests per day. Some responses include a Retry-After header. |
| 500 | Internal Server Error | Unexpected server error. Retry the request. |