User
Endpoints for user profile, continue reading, and push notification management.
All endpoints in this section use multi-tenant mode (do NOT send X-Farfalla-Tenant-Id).
User Profile
GET /api/v2/user
Returns the authenticated user's profile and the list of tenants they belong to.
Request:
curl https://app.publica.la/api/v2/user \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/json"
Response: 200 OK
{
"id": 12345678,
"admin": false,
"email": "user@example.com",
"picture": "https://www.gravatar.com/avatar/abc123?s=160&d=mm&r=g",
"tenants": [
{
"id": 1,
"name": "Publica.la",
"domain": "app.publica.la",
"logo": "https://cdn.publica.la/publicala/logo/logo.png",
"country_code": "AR",
"country_name": "Argentina",
"colors": {
"primary": "#D5D5D5",
"secondary": "#0080FF"
}
},
{
"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"
}
}
]
}
Continue Reading
GET /api/v2/user/continue-reading
Returns publications the user has started reading across all tenants, ordered by most recently read.
Request:
curl "https://app.publica.la/api/v2/user/continue-reading?per_page=6" \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/json"
| Parameter | Type | Default | Description |
|---|---|---|---|
per_page | integer | 6 | Items per page |
Response: 200 OK
{
"filter_name": "section",
"filter_value": "continue_reading",
"title": "Continue Reading",
"data": [
{
"id": 153598,
"tenant_id": 1,
"name": "The Governor and the Rebel",
"slug": "the-governor-and-the-rebel",
"cover_url": "https://cdn.publica.la/issues/cover.jpg",
"published_at": "2020-11-20 03:00:00",
"type": "epub",
"description": "A historical novel...",
"external_id": "9786599001772",
"number_of_pages": 30,
"lang": "pt",
"author": "Azevedo, Israel Belo De",
"publisher": "Editora Prazer Da Palavra",
"bisac": "Fiction > Historical"
}
],
"meta": {
"current_page": 1,
"from": 1,
"to": 2,
"last_page": 1,
"per_page": 6,
"total": 2
}
}
My Content
GET /api/v2/user/my-content
Returns every publication the user has access to across all tenants they belong to. Unlike /user/continue-reading, this endpoint includes content the user has not opened yet, and excludes physical and revoked items.
This is the multi-tenant view used by the Fenice "My Library" tab.
Tenant Mode: Multi-tenant (do NOT send X-Farfalla-Tenant-Id)
Request:
curl "https://app.publica.la/api/v2/user/my-content?per_page=20" \
-H "Authorization: Bearer {access_token}" \
-H "Accept: application/json"
| Parameter | Type | Default | Description |
|---|---|---|---|
per_page | integer (1-100) | 6 | Items per page |
cursor | string | - | Cursor for next page (provided by the previous response) |
Response: 200 OK
{
"filter_name": "section",
"filter_value": "my_content",
"title": "My Content",
"data": [
{
"id": 153598,
"tenant_id": 1,
"name": "The Governor and the Rebel",
"slug": "the-governor-and-the-rebel",
"cover_url": "https://cdn.publica.la/issues/cover.jpg",
"published_at": "2020-11-20 03:00:00",
"type": "epub",
"description": "A historical novel...",
"external_id": "9786599001772",
"number_of_pages": 30,
"lang": "pt",
"author": "Azevedo, Israel Belo De",
"publisher": "Editora Prazer Da Palavra",
"bisac": "Fiction > Historical"
}
],
"meta": {
"per_page": 20,
"next_cursor": "eyJpZCI6MTUzNTk4LCJfcG9pbnRzVG9OZXh0SXRlbXMiOnRydWV9",
"prev_cursor": null
}
}
Behavior
- Each item carries
tenant_idso the client knows whichX-Farfalla-Tenant-Idto send when opening the reader, downloading content, or hitting any single-tenant endpoint. - Revoked content (publisher pulled the issue) is excluded.
- Physical publications (
type: physical) are excluded. - Content the user has not opened yet is included (the main difference from continue-reading, which requires a saved reading position).
This endpoint never returns commerce fields (price, purchase_link, etc.). Commerce fields are tenant-specific, so they are only exposed by single-tenant endpoints with scope=all. The scope query parameter is ignored here. See Commerce for details.
Pagination
Uses cursor-based pagination. The response meta.next_cursor and meta.prev_cursor fields are passed back as the cursor query parameter to navigate.
Push Notifications
Subscribe
POST /api/v2/user/push-notifications
Registers a Firebase Cloud Messaging (FCM) token for push notifications. Tokens are registered per user per tenant.
Request:
curl -X POST https://app.publica.la/api/v2/user/push-notifications \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"fcm_token": "dGVzdC10b2tlbi0xMjM0NTY3ODk...",
"device_token": "device-uuid-123",
"platform": "ios"
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
fcm_token | string | Yes | Firebase Cloud Messaging token |
device_token | string | No | Device-specific identifier |
platform | string | No | Device platform (ios, android) |
Response: 201 Created with empty body.
FCM tokens refresh periodically on iOS. Call this endpoint each time the app receives a new token to keep it up to date.
Unsubscribe
DELETE /api/v2/user/push-notifications
Removes push notification registration for a device across all tenants.
Request:
curl -X DELETE https://app.publica.la/api/v2/user/push-notifications \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"device_token": "device-uuid-123",
"platform": "ios"
}'
Response: 204 No Content
See Also
- Authentication - Login and session management
- Tenants - List tenants the user could sign up for
- Library - Browse content within a tenant
- Commerce - Storefront mode and purchase flow