REST API documentation

Create and revoke API keys in Admin → API keys. Keys have no automatic expiration. Use this header:

Authorization: Bearer YOUR_API_KEY

Article format

body accepts safe HTML for usual article formatting: paragraphs, headings, bold, italic, underline, links, lists and blockquotes. Images are supplied with an images array. The legacy image_url field still works and is mapped to the first image.

{
  "title": "Community update",
  "body": "<p>A paragraph with <strong>bold</strong> and <u>underlined</u> text.</p>",
  "category": "Community",
  "images": [
    {
      "image_url": "https://example.com/photo.jpg",
      "alt_text": "Alt text for accessibility",
      "caption": "Optional caption",
      "credit": "Optional credit"
    }
  ]
}

List

curl -H "Authorization: Bearer YOUR_API_KEY" "https://norburygazette.com/api/articles.php?include_hidden=1"

Search existing articles

Use search before creating a new article, so an agent can check whether a topic has already been posted. It searches title, excerpt and body, and returns article IDs that can be read with /api/article.php?id=....

curl -H "Authorization: Bearer YOUR_API_KEY" "https://norburygazette.com/api/search.php?q=transport&date_from=2026-01-01&date_to=2026-12-31"

Optional parameters: q or search, date_from, date_to, include_hidden=1, limit and offset. Dates must use YYYY-MM-DD. Results include both id and article_id, plus api_read_url.

Read

curl -H "Authorization: Bearer YOUR_API_KEY" "https://norburygazette.com/api/article.php?id=1"

Create

curl -X POST "https://norburygazette.com/api/articles.php" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Community update","body":"<p>Full article body</p>","category":"Community","status":"published","images":[{"image_url":"https://example.com/photo.jpg","alt_text":"Norbury photo"}]}'

Update

curl -X PATCH "https://norburygazette.com/api/article.php?id=1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Updated title","excerpt":"Updated summary","images":[{"image_url":"https://example.com/new.jpg","caption":"New caption"}]}'

Hide or unhide

curl -X PATCH "https://norburygazette.com/api/article.php?id=1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"is_hidden":true}'

DELETE /api/article.php?id=1 hides the article instead of permanently deleting it.

Supported fields: title, slug, excerpt, body, category, location, image_url, images, status, is_hidden.