Endpoint
GET/link/:link_id
APIs that can be used to work with State programmatically
This API method returns a short link by its id.
Authorization required.
| Parameter | Description |
|---|---|
| link_id | Required |
| Parameter | Description |
|---|---|
| ip | Optional. If provided and the link has geo-targeted URLs, the response includes a link for the corresponding country |
curl https://state.sk/api/link/abcdef?ip=192.168.0.1 \
-H 'x-api-key: state_xxxxxxxxxx'
The requested link
{
"id": "id-1",
"org_id": "org-1",
"user_id": "user-1",
"folder_id": null,
"domain_id": 1,
"domain": "state.sk",
"slug": "somethingrandom",
"url": "https://google.com",
"title": "Google",
"expires_at": null,
"expires_after": 0,
"expire_url": null,
"utm_source": null,
"utm_medium": null,
"utm_campaign": null,
"utm_term": null,
"utm_content": null,
"utm_reference": null,
"created_at": "2025-10-07T13:12:01.761Z",
"updated_at": "2025-10-07T13:12:01.761Z",
"ios": null,
"android": null,
"redirect_code": null,
"has_password": false,
"short_url": "https://state.sk/somethingrandom",
"clicks": 0,
"clicked_at": "2025-10-15T13:12:01.761Z",
"folder": null,
"tags": [],
"ab": [],
"geo": [],
"geo_url": "https://uk.google.com"
}
| Parameter | Description |
|---|---|
| id | Unique ID in the database |
| org_id | Your team ID in the database |
| user_id | ID of a user who created the link |
| domain_id | Domain ID |
| domain | Domain name |
| slug | Part of the short link after / |
| url | Original long URL |
| title | Either user-defined title or a title of the original website |
| folder_id | Folder ID assigned to the short link or null |
| folder | Folder object if defined |
| tags | Array of existing tags assigned to the short link |
| utm_source | UTM source for the short link; overrides the destination URL’s UTM source if set |
| utm_medium | UTM medium for the short link; overrides the destination URL’s UTM medium if set |
| utm_campaign | UTM campaign for the short link; overrides the destination URL’s UTM campaign if set |
| utm_term | UTM term for the short link; overrides the destination URL’s UTM term if set |
| utm_content | UTM content for the short link; overrides the destination URL’s UTM content if set |
| utm_reference | Custom tag (non-standard) for referral programs or similar use cases |
| ios | The iOS destination URL for the short link; takes priority on iOS devices |
| android | The Android destination URL for the short link; takes priority on Android devices |
| has_password | Boolean. true or false |
| expires_at | ISO date when the link expires |
| expires_after | Maximum number of clicks before expiration |
| expire_url | Optional redirect URL after expiration |
| redirect_code | Custom redirect code. Default is 302 |
| clicks | Number of clicks |
| clicked_at | Last time the link was clicked |
| ab | An array of A/B test URLs and the percentage of traffic to send to each URL |
| geo | An array of geo URLs for different countries |
| geo_url | If query parameter ip is set and the link has geo-targeted URLs, the response includes a link for the corresponding country |
| created_at | The date and time when the short link was created |
| updated_at | The date and time when the short link was updated |