Skip to Content
DocumentationGuidesFrontend Map API

Frontend Map API

All endpoints follow Strapi’s standard response conventions:

  • Success → HTTP 2xx with { "data": ..., "meta": {} }.
  • Error → the matching HTTP status with { "data": null, "error": { "status", "name", "message", "details" } }.

The HTTP status code is authoritative — there is no ok flag. Status codes used:

StatusMeaning
200Success
400Missing or invalid query parameter (ValidationError)
404Nothing matched the request (NotFoundError)
501The server is missing configuration required to fulfil the request (NotImplementedError)
500Unexpected server error

Get content type from path

GET /api/get-content-type?pathname=[path]&site=[site]&locale=[locale]&compact=[bool]

Example:

GET /api/get-content-type?pathname=/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant&site=andronis&locale=en&compact=false

Example response (200):

{ "data": { "site": "andronis", "pathname": "/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant", "locale": "en", "matched": { "collectionType": "plugin::andronis.andronis-restaurant", "rule": "{locale}/{hotel}/restaurants/{slug}", "params": { "locale": "en", "hotel": "andronis-boutique-hotel", "slug": "lauda-restaurant" } } }, "meta": {} }

Example response with compact=true (200):

{ "data": { "contentType": "plugin::andronis.andronis-restaurant" }, "meta": {} }

Errors:

  • 400site is missing or unknown.
  • 404 — no rule matched the pathname. Pass debug=1 to include the considered candidates under error.details.
{ "data": null, "error": { "status": 404, "name": "NotFoundError", "message": "No content type matches the given pathname", "details": { "pathname": "/no/such/path", "normalizedPath": "/no/such/path" } } }

Get public URL for a document

Returns the absolute public frontend URL for a single document (powers the admin “Open live page” button).

GET /api/frontend-url?uid=[content-type-uid]&documentId=[id]&locale=[locale]&status=[draft|published]

Example response (200):

{ "data": { "url": "https://www.andronis.com/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant", "path": "/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant" }, "meta": {} }

Errors:

  • 400uid or documentId is missing.
  • 404 — the content type has no frontend URL rule, or the document was not found.
  • 501FRONT_END_URL_<SITE> is not configured on the server. The relative path is still returned under error.details.

Build sitemap

GET /api/build-sitemap?site=[site]&contentType=[content-type]&xml=[bool]&validate=[bool]

Example:

GET /api/build-sitemap?site=andronis&contentType=plugin::andronis.andronis-restaurant

Example response (200):

{ "data": { "count": 9, "urls": [ "https://andronis.com/hotels/andronis-arcadia/restaurants/grande-pool", "https://andronis.com/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant" ] }, "meta": {} }

With validate=true, each generated URL is requested and the response reports status counters under data (byClass, byStatus, and per-URL results). Each result is { url, status, ok }, plus location on redirects. When the request never gets a response, status is null and a reason field explains why (e.g. "timeout after 10000ms" or "fetch failed").

Example response with xml=true (Content-Type: application/xml):

<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://andronis.com/hotels/andronis-arcadia/restaurants/grande-pool</loc> </url> <url> <loc>https://andronis.com/hotels/andronis-boutique-hotel/restaurants/lauda-restaurant</loc> </url> </urlset>

Errors:

  • 400site or contentType is missing, the site is unknown, or no rule exists for the contentType in that site.
Last updated on