{"openapi":"3.1.0","info":{"title":"Postrex Content API","version":"1.0.0","description":"Read the posts Postrex has published for one website, to render them on that website. The key from Settings → Integrations in the Postrex dashboard belongs to one website; send it as a bearer token — it is not accepted in the URL. At most 120 requests per minute per website. Read-only: posts are written, edited and published in Postrex."},"externalDocs":{"description":"Publish webhook and the other ways to get posts onto your site","url":"https://postrex.com/docs/webhooks"},"servers":[{"url":"https://postrex.com"}],"security":[{"apiKey":[]}],"paths":{"/api/v1/posts":{"get":{"operationId":"listPosts","summary":"List published posts","description":"Up to 100 published posts of the key's website, newest first.","responses":{"200":{"description":"The posts.","content":{"application/json":{"schema":{"type":"object","required":["posts"],"properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"429":{"description":"More than 120 requests in a minute.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}},"/api/v1/posts/{slug}":{"get":{"operationId":"getPost","summary":"Get one published post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The post's slug."}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"type":"object","required":["post"],"properties":{"post":{"$ref":"#/components/schemas/Post"}}}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"404":{"description":"No published post with this slug on the key's website.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"429":{"description":"More than 120 requests in a minute.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"The Content API key from Settings → Integrations (it starts with bw_)."}},"schemas":{"Post":{"type":"object","required":["id","title","slug","metaDescription","bodyMarkdown","bodyHtml","faq","featuredImageUrl","altText","language","publishedAt","dateModified","jsonLd","analyticsBeacon"],"properties":{"id":{"type":"string","format":"uuid","description":"The post's id in Postrex (a UUID). It never changes — store your copy under it."},"title":{"type":["string","null"],"description":"The headline."},"slug":{"type":["string","null"],"description":"The URL slug Postrex suggests for the post."},"metaDescription":{"type":["string","null"],"description":"The meta description, for your page's <meta name=\"description\">."},"bodyMarkdown":{"type":"string","description":"The full article as Markdown: byline, table of contents, body, FAQ and related posts."},"bodyHtml":{"type":"string","description":"The same article rendered to HTML, ready to put into your page."},"faq":{"type":"array","description":"The article's questions and answers, as on the page (the same ones are in bodyMarkdown and in jsonLd).","items":{"type":"object","required":["question","answer"],"properties":{"question":{"type":"string"},"answer":{"type":"string"}}}},"featuredImageUrl":{"type":["string","null"],"description":"URL of the featured image, or null."},"altText":{"type":["string","null"],"description":"Alt text for the featured image, or null."},"language":{"type":["string","null"],"description":"Language code of the article, e.g. \"en\"."},"publishedAt":{"type":["string","null"],"format":"date-time","description":"When the post was published (ISO 8601, UTC)."},"dateModified":{"type":["string","null"],"format":"date-time","description":"When the post was last changed after it was published (ISO 8601, UTC), or null."},"jsonLd":{"type":"object","description":"Ready-to-embed schema.org JSON-LD graph (BlogPosting with author, publisher, breadcrumb and FAQ) for a <script type=\"application/ld+json\"> on the post's page."},"analyticsBeacon":{"type":"string","description":"Optional cookieless analytics: a <script> to put on the post's page that reports views and reading time back to Postrex for this post. Leave it out to opt out."}}}}}}