Skip to main content

Tenants

Endpoints for listing tenants (stores) the authenticated user could sign up for.


List Tenants

GET /api/v2/tenants

Returns tenants where the authenticated user does not have an account, ordered by popularity (user count). Supports optional country filtering, name search, and cursor pagination.

Tenant Mode: Multi-tenant (do NOT send X-Farfalla-Tenant-Id). When X-CustomFenice-Tenant-Id is sent with a value other than 1, the list is restricted to that tenant's family (owner plus tenants whose aggregator_id equals the header value). May be empty if the user is already registered in every family member.

Request:

curl "https://app.publica.la/api/v2/tenants?country_code=AR&per_page=10" \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/json"

Query Parameters

ParameterTypeDefaultDescription
country_codestring (2 chars)-ISO 3166-1 alpha-2 country code
querystring (2-128 chars)-Case-insensitive substring match against tenant name
per_pageinteger (1-100)20Items per page
cursorstring-Cursor for next page (provided by the previous response)
info

When country_code is omitted no country filter is applied and all eligible tenants are returned. The query parameter is normalized to NFC form before matching to handle accented characters consistently.

Response

200 OK

{
"data": [
{
"id": 42,
"name": "Editorial Planeta",
"domain": "planeta.publica.la",
"logo": "https://cdn.publica.la/planeta/logo/logo.png",
"country_code": "AR",
"country_name": "Argentina",
"colors": {
"primary": "#1a1a2e",
"secondary": "#e94560"
}
},
{
"id": 15,
"name": "Grupo Santillana",
"domain": "santillana.publica.la",
"logo": "https://cdn.publica.la/santillana/logo/logo.png",
"country_code": "AR",
"country_name": "Argentina",
"colors": {
"primary": "#ffffff",
"secondary": "#0066cc"
}
}
],
"meta": {
"per_page": 10,
"next_cursor": "eyJ1c2Vyc19jb3VudCI6MTIzNCwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
"prev_cursor": null
}
}

Response Fields

FieldTypeDescription
data[].idintegerTenant ID
data[].namestringTenant display name
data[].domainstringTenant domain (custom domain or subdomain)
data[].logostringLogo URL
data[].country_codestring or nullTenant country (from sign-up intent)
data[].country_namestring or nullCountry name in English
data[].colorsobjectBrand colors (primary, secondary)
meta.per_pageintegerPage size
meta.next_cursorstring or nullOpaque cursor for the next page. null when there are no more pages
meta.prev_cursorstring or nullOpaque cursor for the previous page. null on the first page

Ordering

Results are ordered by popularity (number of users, descending). Tenants with more users appear first. This ordering is fixed and not configurable via API parameters.

Filtering

  • Only tenants with an active plan (has_plan = true) are included
  • Tenants where the user already has an account are excluded
  • Country filtering uses the tenant's signUpIntent.country_code
  • Custom app scope: see the note under "List Tenants" above

Pagination

Uses cursor-based pagination. Save meta.next_cursor from the response and pass it back in the cursor query parameter on the next request, along with the same filters:

# Page 1
curl "https://app.publica.la/api/v2/tenants?country_code=AR&per_page=5" \
-H "Authorization: Bearer {access_token}"

# Page 2 (re-send all filters and the cursor from meta.next_cursor)
curl "https://app.publica.la/api/v2/tenants?country_code=AR&per_page=5&cursor=eyJ1c2Vyc..." \
-H "Authorization: Bearer {access_token}"

The cursor is opaque. Treat it as a token: do not parse, modify, or store individual fields from it. When meta.next_cursor is null, there are no more pages.

Error Responses

CodeCause
412X-Farfalla-Tenant-Id header was sent (not allowed on multi-tenant endpoints)
422country_code is not exactly 2 characters, query is out of range, or per_page is out of range

See Also

X

Graph View