Endpoint
PUT/link/:link_id/geo
APIs that can be used to work with State programmatically
This API method allows the authenticated team to update, add, or remove GEO links associated with an existing short link.
Authorization required.
| Parameter | Description |
|---|---|
| link_id | Required |
| Parameter | Description |
|---|---|
| items | Array of URLs with country codes |
Each array element must include a valid URL and a country code.\
Example:
{
"items": [
{ "id": 1, "url": "https://bing.com", "country": "US" },
{ "url": "https://duckduckgo.com", "country": "SK" }
]
}
Links with IDs are updated, links without IDs are added, and any existing GEO link not included in the payload will be deleted.
curl -X 'PUT' https://state.sk/api/link/link42/geo \
-H 'x-api-key: state_xxxxxxxxxx' \
-d '{
"items": [
{ "id": 1, "url": "https://bing.com", "country": "US" },
{ "url": "https://duckduckgo.com", "country": "SK" }
]
}'
The updated link
{
"id": "link42",
"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,
"domain": null,
"redirect_code": null,
"has_password": false,
"short_url": "https://state.sk/somethingrandom",
"clicks": 3,
"clicked_at": "2025-10-15T13:12:01.761Z",
"folder": null,
"tags": [],
"ab": [],
"geo": [
{ "id": 1, "url": "https://bing.com", "country": "US" },
{ "url": "https://duckduckgo.com", "country": "SK" }
]
}
Detailed information about the link fields in the Link article.