Skip to Content
Browse the Docs▾

Get a post

GET/api/content/v1/posts/{slug}

One post, render-ready: markdown and safe HTML, table of contents, head metadata, JSON-LD and related posts.

curl -H "Authorization: Bearer $REVNU_CONTENT_API_KEY" \
  https://revnu.com/api/content/v1/posts/graph-rag

Response

{
  "redirected": false,
  "blog": { "blogSlug": "…", "creatorName": "…", "authorName": "…", "logoUrl": "…", "baseUrl": "…" },
  "nav": [{ "type": "blog", "prefix": "blog", "label": "All" }, { "type": "how_to", "prefix": "guides", "label": "Guides" }],
  "post": {
    "slug": "graph-rag",
    "title": "…",
    "contentType": "how_to",
    "canonicalPath": "/guides/graph-rag",
    "canonicalUrl": "https://yourdomain.com/blog/guides/graph-rag",
    "metaDescription": "…",
    "authorName": "…",
    "readingMinutes": 8,
    "body": { "markdown": "…", "html": "…" },
    "toc": [{ "text": "…", "slug": "…" }],
    "heroImageUrl": "https://…",
    "faqItems": [{ "question": "…", "answer": "…" }],
    "citations": ["https://…"],
    "publishedAt": 1753000000000,
    "updatedAt": 1753100000000
  },
  "headMeta": {
    "title": "…",
    "description": "…",
    "canonical": "…",
    "robots": "index,follow",
    "openGraph": { "url": "…", "type": "article", "image": { "url": "…", "width": 1200, "height": 630 } },
    "twitter": { "card": "summary_large_image", "image": { "url": "…" } }
  },
  "jsonLd": [{ "@type": "Article" }, { "@type": "BreadcrumbList" }, { "@type": "FAQPage" }],
  "related": [{ "slug": "…", "title": "…", "contentType": "blog", "canonicalPath": "/…" }]
}

Using it

  • Routing. Use canonicalPath: /{slug} for regular posts, /{prefix}/{slug} for typed content such as guides and comparisons. Mount everything under one path, for example /blog.

  • Trailing slashes. canonicalUrl, headMeta and jsonLd follow your site's slash convention, detected when you connect your blog. canonicalPath never ends in a slash; it is a route key, not a URL.

  • Links between posts in body.html are root-relative. If your blog mounts at /blog, rewrite them once when rendering: html.replace(/href="\/(?!\/)/g, 'href="/blog/').

  • Body. body.markdown is GitHub-flavoured markdown, tables included. body.html is the same post already rendered, tables as plain <table> elements. If you render the markdown yourself, turn on GFM tables. More: tables and links look wrong.

  • Styling. Wrap body.html in a container and style plain tags, tables included. Raw HTML in the source is escaped and javascript: URLs are rejected, so it is safe to inject.

  • Head tags. Pipe headMeta into your framework's metadata API: canonical for the canonical tag, robots, and the Open Graph and Twitter fields. Note that openGraph.image and twitter.image are single objects, so map them to whatever your framework expects (Next.js wants an images array). Embed each jsonLd entry in a <script type="application/ld+json">. This is the same structured data the hosted blog ships.

  • Changed URLs. If a post's URL was changed in Revnu, its old slug still returns the post with redirected: true, and canonicalPath holds the new one. Redirect permanently to it.

  • Section nav. nav lists the content types the blog has posts in, for a section menu. It is empty when every post is a regular blog post.

  • Related posts. related holds up to three other published posts on the same topic.

  • Byline. post.authorName is the name to show: the post's author, else the blog's author, else the business name.

  • Hero image. heroImageUrl is a stable URL that Revnu hosts; hotlink it, or copy it into your own storage if your CMS must own its images.

404 for an unknown slug or an unknown or revoked token.

Frequently Asked Questions

Should I render the markdown or the HTML?

The HTML, unless you have a reason not to. It is the hosted blog's exact pipeline, already escaped, with a table of contents to match. The markdown is there for full control; render it with GitHub-flavoured markdown so tables survive.

Do I get the FAQ rich result too?

Yes. jsonLd includes the FAQPage entry when the post has FAQs; embed every entry and the rich results the hosted blog earns carry over.