Sitemaps
Fetch every indexable URL managed by Inventra for sitemap.xml generation.
Returns all URLs Inventra manages for your organization (blog posts, category pages) in a format ready to drop into a sitemap.xml.
List sitemap entries
GET /api/organizations/{orgId}/sitemaps
Response
{
"items": [
{
"url": "/blog/how-to-grow-with-content",
"lastModified": "2026-03-15T12:00:00Z",
"changeFrequency": "weekly",
"priority": 0.8
},
{
"url": "/blog/category/marketing",
"lastModified": "2026-03-01T00:00:00Z",
"changeFrequency": "weekly",
"priority": 0.6
}
]
}URLs are returned as pathnames (starting with /) — you prepend your own site's base URL.
Use with Next.js sitemap.ts
// app/sitemap.ts
import type { MetadataRoute } from 'next';
import { Inventra } from 'inventra';
const inventra = new Inventra({
apiKey: process.env.INVENTRA_API_KEY!,
orgId: process.env.INVENTRA_ORG_ID!
});
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const entries = await inventra.sitemaps.listEntries();
const baseUrl = 'https://example.com';
return entries.map((entry) => ({
url: `${baseUrl}${entry.url}`,
lastModified: new Date(entry.lastModified),
changeFrequency: entry.changeFrequency,
priority: entry.priority
}));
}The SDK ships a helper that does the prepend + conversion for you — see inventra/next.