Admin social exports

Staff-only, collection-scoped image generation and manual downloads.

All routes require a Clerk bearer token with Fondaro staff access. Callers cannot supply an organization ID, agent identity, image URL or destination. The existing internal brand-site organization owns the export records; collection ownership is enforced separately by the template namespace.

GET /admin/website/social/collections returns penrosebay and fondaro. Omitting collectionId retains the historical Penrose Bay default. Include ?collectionId=fondaro when listing, downloading or cancelling Fondaro posts. Cross-collection IDs are refused.

Fondaro sources and generation

  • GET /admin/website/social/fondaro/catalogue: English editorial seeds and review candidates with original text, exact excerpt, dates and unresolved provenance flags. Generate a review post with reviewId, optional platform and variant: "poster". It creates a fondaro:review row with a normal caption and downloadable kit. The snapshot retains owner authorization and the original source; verifiedUrl remains null unless independently verified. The legacy previewOnly request flag is accepted for compatibility but no longer produces watermarks.
  • GET /admin/website/social/fondaro/listings?q=Marbella: at most 30 recent active, published, unexpired, non-imported Spanish MLS listings. Each result contains a narrow public property projection or an actionable identity issue. Agent lookup requires the exact listing agentId, matching organization and active roster status. Private contacts and CRM information are excluded.
curl -X POST https://api.fondaro.com/admin/website/social/generate \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"collectionId":"fondaro","topicId":"introduction","platform":"instagram","kind":"post","variant":"carousel"}'

For a property, use listingId from the MLS picker instead of topicId. Optional photos is an ordered array of { "index": 0, "x": 0.5, "y": 0.5 }: indices must belong to that listing, be unique, and total 1–8. Crop fractions must be finite and between 0 and 1. A single-card variant requires exactly one.

Instagram property variants are deck and poster. Facebook property variants are facebook-photos, facebook-photo, or portrait deck. Editorial posts use carousel on either platform. Fondaro rejects Stories, Penrose Bay references, guide slugs and colourways. Penrose Bay rejects Fondaro source fields.

Generation returns a pending row and renders asynchronously. Poll GET /admin/website/social?collectionId=fondaro until rendered or failed.

curl 'https://api.fondaro.com/admin/website/social/POST_ID/kit.zip?collectionId=fondaro' \
  -H "Authorization: Bearer $TOKEN" -o fondaro-kit.zip

Fondaro uses fondaro: template IDs and a versioned nullable source_snapshot JSON column. The snapshot freezes public source identity, facts, caption context, photo ordering/crops, dimensions and canonical destination. The existing public listing URL resolver is authoritative; a missing listing URL falls back to the shared canonical Fondaro product URL with honest product wording.

Downloads require a rendered, correctly owned record and storage objects under that exact post’s namespace. MLS eligibility is rechecked. The ZIP includes ordered PNGs, caption.txt, url.txt, posting.txt and post.json. Preview guides are absent from image bytes. POST /:id/cancel?collectionId=fondaro archives locally; render completion cannot overwrite that cancellation.

Penrose Bay compatibility

curl -X POST https://api.fondaro.com/admin/website/social/generate \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"collectionId":"penrosebay","reference":"R12345","kind":"post","variant":"facebook-photos"}'

Use a real available Resales reference. Existing deck/poster/guide/Story and Facebook formats retain their behavior. Legacy unprefixed templates and null snapshots remain Penrose Bay history. Scheduled/published audit rows remain readable and downloadable, but local cancellation refuses them. Reels retain /admin/website/reels generation/list/download routes. No route publishes, schedules or contacts the retired publishing provider.

Fondaro editorial snapshots retain authored line breaks, composition and tone. Own-bucket public properties/images/<uuid>.<image-extension> sources are read through the configured storage client with byte/deadline limits. External URLs retain SSRF-safe fetching. This supports private Spaces DNS inside the cluster without allowing arbitrary authenticated object reads.

Agent avatars in the configured bucket use bounded authenticated storage only when the key is exactly agents/avatars/<listing-agent-id>.webp. Other URLs keep SSRF-safe fetching. Avatar fetch failures log the post/agent IDs and preserve the original snapshot URL instead of erasing it. New property renders crop the source to the full export dimensions, then apply contrast and identity overlays.