Skip to content
Documentation menu

Requests and responses

Exchange format, pagination, filters, idempotency and plan-dependent features.

Base URL#

All routes live under https://api.hyllo.fr/api/public/v1. The paths in this guide are relative to that base: GET /me means GET https://api.hyllo.fr/api/public/v1/me.

The /api/public/v1 prefix is the public API’s. The app’s internal API is not documented and may change at any time: do not call it. See Versioning policy.

Request and response format#

  • Requests and responses are JSON. With a body, send Content-Type: application/json, and Accept: application/json in every case.
  • Identifiers are ULIDs (for example 01ARZ3NDEKTSV4RRFFQ69G5FAV), to be handled as opaque strings.
  • Dates use the ISO 8601 format (2026-12-01T10:00:00.000000Z).
  • An optional field with no value is returned as null.
  • Field names are those of the reference, as is: their case varies from one resource to another, respect it.
  • Ignore fields you do not know: new fields may appear without notice.

Response envelopes#

A single resource is wrapped in data:

{
  "data": {
    "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "title": "Promo",
    "url": "https://example.com/promo"
  }
}

A paginated list adds links (neighbouring pages, null when there is none) and meta (current_page, last_page, per_page, total…):

{
  "data": [
    {
      "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
    }
  ],
  "links": {
    "first": "https://api.hyllo.fr/api/public/v1/short-links?page=1",
    "last": "https://api.hyllo.fr/api/public/v1/short-links?page=3",
    "prev": null,
    "next": "https://api.hyllo.fr/api/public/v1/short-links?page=2"
  },
  "meta": {
    "current_page": 1,
    "last_page": 3,
    "total": 42
  }
}

Some lists are not paginated and only return data: a page’s links, the workspace’s webhooks (with a usage meta).

A creation answers 201 (except POST /short-links/bulk: 200; resending a webhook delivery: 202). A deletion answers 204, with no body. Errors have their own shape: see Error format.

Pagination#

Paginated lists accept page (starting at the first) and per_page. By default a page holds 15 items; per_page can go up to 100.

To go through everything, read meta.last_page in each response and request the pages one by one up to the last one:

const headers = {
  Authorization: `Bearer ${process.env.HYLLO_API_TOKEN}`,
  Accept: 'application/json',
}

const shortLinks = []
let page = 1
let lastPage = 1

do {
  const response = await fetch(`https://api.hyllo.fr/api/public/v1/short-links?page=${page}&per_page=100`, { headers })

  if (!response.ok) {
    throw new Error(`HTTP ${response.status}: ${await response.text()}`)
  }

  const body = await response.json()
  shortLinks.push(...body.data)
  lastPage = body.meta.last_page
  page += 1
} while (page <= lastPage)

console.log(`${shortLinks.length} short links`)

If items are created during the walk, one of them may appear twice: deduplicate by id.

Filters and sorting#

The short link, QR code and link page lists accept these parameters:

  • search: text search; a value that is too short answers 422.
  • status: keeps only the resources in that status. The accepted values depend on the resource: see the reference.
  • sort: recent (default), updated, name or visits.
  • domain: hyllo for resources served on Hyllo’s domain, or the ULID of one of the workspace’s custom domains. An unknown domain answers 422.

Folders do not exist in the public API: the folder parameter answers 422 field_not_available.

Idempotency#

Creations (POST) accept the Idempotency-Key header: a string of your choice (a UUID works), specific to the operation. Replayed with the same key and the same request, the creation returns the original response, with the Idempotent-Replayed: true header, instead of creating a duplicate. The key is kept for 24 hours.

  • Same key, same request: the original response is replayed.
  • Same key, different request (path or body): 422 idempotency_key_mismatch.
  • Same key while the first request is still running: 409 idempotency_in_progress. Wait a moment, then replay.
  • Only successful responses are kept: after an error, replaying the request runs it again.
  • An empty or too long key, or one with non-printable characters, answers 422 (errors.idempotency_key). The key is specific to the token.

Plan-dependent features#

The workspace plan’s rights apply as they do in the app. A field or feature the plan does not include answers 402, even with the right scope. The body says why:

{
  "message": "This feature requires the Business plan.",
  "code": "plan_required",
  "feature": "short_links.custom_alias",
  "required_plan": "business",
  "addon": null,
  "limit": null,
  "usage": null
}
CodeMeaning
plan_requiredThe feature is not included in the plan.
quota_reachedThe plan’s limit is reached (limit and usage give the figures).
plan_restrictedThe resource is read-only after a plan downgrade.

For example: a custom short code, a custom domain, password protection, expiry or a visit limit, an advanced QR code design or link page theme. The possible 402s are listed operation by operation in the reference.

Read next