P

API Reference

Quickstart API endpoints

When someone visits yoursite.com/blog your code needs to call pullnote.com/pull/note/blog with your api_key, and all the head and body HTML you need comes back in a JSON array.

For a list of blog entries, you call pullnote.com/pull/list/blog

That's pretty much it.

Single note

See /pull/note

  https://pullnote.com/pull/note/[slug]
  e.g.
  https://pullnote.com/pull/note/blog/my_page

List of child notes

See /pull/list

  https://www.pullnote.com/pull/list/[slug]
  e.g.
  https://www.pullnote.com/pull/list/blog?limit=5&page=1  

All pages end point

  https://pullnote.com/pull/note/all?page=1&limit=50

api_key passing

Pass the api key either as the key GET parameter:

  https://pullnote.com/pull/note/blog/my_page?key=...

or as a Bearer token in the fetch header:

await fetch("https://pullnote.com/pull/note", {
    headers: {
      "Content-Type": "application/json; charset=utf-8",
      "pn_authorization": "Bearer " + API_KEY
    }
  })

Note: you MUST use pn_authorization for Pullnote to distinguish between yours and our own internal bearer tokens.

Retrieving content

Pass the URL from your content root onward to retrieve a page e.g.:

# Requested URL:
https://yourlovelysite.com/articles/best_stuff_ever
# ...is retrieved via...
https://pullnote.com/pull/note/articles/best_stuff_ever

If using Svelte, dynamic routing folders make this super simple to cover any page created in the CMS without changing your front-end code.

/pull/note/[slug]

Retrieve a note with title, content_html and all other pertinent information to build a page.

GET Parameters

key: string (optional) api_key for your project, also passable as a Bearer token in the header

Retrieve or Create (roc) Mode (NB: push must be enabled in settings)

roc: integer Set to '1' to signal you wish the note to be created if not found

title: string (optional) The title of the newly created note

prompt: string (optional) Additional prompt for the LLM when generating AI content

img: string (optional) Pass 1 or string prompt to generate AI image to accompany article

Return Parameters

title: string Title of the page

description: string Description for the page

picture: string Image url if one supplied / generated

head_html: string Entire HEAD section, including SEO tags and JSON_LD

content_html: string Entire BODY (bar the title) already HTML rendered

content_md: string The raw, original markdown if you wish to perform your own processing / conversion

category: note Parent note (if applicable)

links: [note] Array of sub-documents (if applicable) to use as basis for a menu

Example

https://pullnote.com/pull/note?key=...

{
  "_id":"65b25e6152be6b2f62100382",
  "title":"Simple, Headless Markdown Blogs",
  "description":"Homepage for the Pullnote headless CMS blog engine.",
  "picture":"https://pullnote.com/i/hero-img.png",
  "head_html": "<title>...</title> etc.",
  "content_html": "<h2>First subheading</h2><p>...etc...</p>",
  "content_md":"## First subheading\n etc.",
  "pathname":"/simple-headless-markdown-blogs",
  "href":"https://pullnote.com/simple-headless-markdown-blogs",
  "category": {...parentdocument},
  "links": [{...subdocuments}],
  "is_root": 1,
  "type": "article",
  "card":"summary_large_image",
  "img":{
    "src":"https://pullnote.com/i/hero-img.png",
    "alt":"Simple, Headless Markdown Blogs"
  },
  "dateCreated":"2024-01-27",
  "dateModified":"2024-02-13",
  "json_ld": {}
}

/pull/note/all

Retrieve all notes for:

  • building a static site all at once, e.g. using Gatsby
  • building a sitemap
  • migrating content

GET Parameters

key: string (optional) api_key for your project, also passable as a Bearer token in the header

page: integer (optional) page to start from. if used, limit must also be passed

limit: integer (optional) limit of pages to retrieve

simple: integer (optional) pass simple=1 to keep the payload to a minimum when building sitemaps

Return Parameters

notes: [note]

Example

https://pullnote.com/pull/note/all?page=1&limit=10

[
  {note},
  {note},
   ...
]

Developers Blog T&Cs Privacy