REST API
Links
Endpoints

Endpoints

Use the links endpoints to list, create, update and delete the workspace's short links. The response shape is on the Link object page, and clicks over time are in link analytics.

Links need a plan that includes Links; otherwise every Links endpoint returns 403 with the code COMMERCIAL_ENTITLEMENT_REQUIRED. Reading needs the key's Links · View permission, creating and editing Links · Create and edit, and deleting Links · Delete.

GET /links

List the workspace's links, newest first.

Query parameters

FieldTypeDescription
limitnumberPage size. Defaults to 20 and cannot exceed 100.
cursorstringPagination cursor returned by a previous list response.
searchstringOptional. Matches the short link, title, destination or description, ignoring case.
labelstringOptional. Only links with this label ID.

Example request

curl --request GET \
  --url 'https://api.feedhive.com/links?limit=20' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Response body

FieldTypeDescription
successbooleanWhether the request succeeded.
data.itemsLink[]Links on this page.
data.totalnumberLinks matching the search and label across every page.
data.has_morebooleanWhether another page is available.
data.next_cursorstring | nullCursor for the next page, or null when there are no more results. It only continues the same search and label.

GET /links/:id

Fetch one link.

Path parameters

FieldTypeDescription
idstringLink identifier.

Example request

curl --request GET \
  --url 'https://api.feedhive.com/links/3fbbb9dd-dcfa-4eb4-8a07-ceaae129fc5e' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Response body

FieldTypeDescription
successbooleanWhether the request succeeded.
dataLinkThe link.

Returns 404 with "Link not found" when the link isn't in the workspace.

POST /links

Create a short link.

Request body

FieldTypeDescription
destination_urlstringRequired. Where the link redirects: an http or https URL without credentials, up to 2,048 characters.
titlestringRequired. The link's name in FeedHive, 1–200 characters.
slugstringOptional. 3–80 letters, numbers, hyphens or underscores. Needs your own link domain; leave it out for a generated one.
domainstringOptional. One of your link domains. Defaults to the workspace's link domain, or FeedHive's.
descriptionstring | nullOptional, up to 500 characters.
preview_image_urlstring | nullOptional. Image URL shown when the link is shared.
preview_media_idstring | nullOptional. ID of an uploaded image from the Media API. Use this or preview_image_url, not both.
utm_sourcestring | nullOptional, up to 200 characters. The same goes for utm_medium, utm_campaign, utm_term and utm_content.
labelsstring[]Optional. Label IDs from the Labels API.

Unknown fields return 400. A slug that's already taken on that domain returns 409 with the code SLUG_UNAVAILABLE, and an unknown label, image or domain returns 422.

Example request

curl --request POST \
  --url 'https://api.feedhive.com/links' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"destination_url": "https://fernwaycoffee.com/spring", "title": "Spring menu"}'

Response body

Returns 201 with the new link.

FieldTypeDescription
successbooleanWhether the request succeeded.
dataLinkThe created link.

PATCH /links/:id

Change the fields you send. Every later click follows the change.

Path parameters

FieldTypeDescription
idstringLink identifier.

Request body

FieldTypeDescription
destination_urlstringOptional. Where the link redirects: an http or https URL without credentials, up to 2,048 characters.
titlestringOptional. The link's name in FeedHive, 1–200 characters.
slugstringOptional. 3–80 letters, numbers, hyphens or underscores. Needs your own link domain; leave it out for a generated one.
domainstringOptional. One of your link domains. Defaults to the workspace's link domain, or FeedHive's.
descriptionstring | nullOptional, up to 500 characters.
preview_image_urlstring | nullOptional. Image URL shown when the link is shared.
preview_media_idstring | nullOptional. ID of an uploaded image from the Media API. Use this or preview_image_url, not both.
utm_sourcestring | nullOptional, up to 200 characters. The same goes for utm_medium, utm_campaign, utm_term and utm_content.
labelsstring[]Optional. Replaces the link's labels.
disabledbooleanOptional. true pauses the link so it stops redirecting; false turns it back on.

Example request

curl --request PATCH \
  --url 'https://api.feedhive.com/links/3fbbb9dd-dcfa-4eb4-8a07-ceaae129fc5e' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"utm_campaign": "spring-2027"}'

Response body

FieldTypeDescription
successbooleanWhether the request succeeded.
dataLinkThe updated link.

DELETE /links/:id

Delete a link. It stops redirecting.

Path parameters

FieldTypeDescription
idstringLink identifier.

Example request

curl --request DELETE \
  --url 'https://api.feedhive.com/links/3fbbb9dd-dcfa-4eb4-8a07-ceaae129fc5e' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Response body

FieldTypeDescription
successbooleanWhether the request succeeded.
dataLinkThe deleted link.