Skip to content

Mantle2 Articles Endpoints

Scientific article metadata (ingested via Cloud + Ocean scraping pipeline). Parameter: articleId.

Catalogue & Management

  • GET /v2/articles — list articles
  • POST /v2/articles — create article
  • GET /v2/articles/random — random articles
  • GET /v2/articles/{articleId} — retrieve article
  • PATCH /v2/articles/{articleId} — update article
  • DELETE /v2/articles/{articleId} — delete article
  • POST /v2/articles/check_expired — admin check expired articles

Article Schema

Articles represent scientific publications and research content scraped from external sources (PubMed, DOAJ, SpringerOpen). Each article contains user-created summary/commentary plus rich metadata from the original source.

FieldTypeDescriptionConstraints
idstringUnique article identifier (24-digit zero-padded)Required
titlestringUser-defined article titleRequired, max 100
descriptionstringUser-created summary/descriptionRequired, max 512
tagsarrayUser-defined tags for categorizationMax 10, 30 chars each
contentstringUser-written article content/commentary50-25000 chars
colornumberColor identifier (integer)Auto-generated
color_hexstringHex color codeDerived from color
author_idstringID of user who created the article (24-digit)Required
authorobjectFull user object of article creatorEmbedded
oceanobjectScraped metadata from original sourceSee Ocean Schema
created_atstringISO 8601 timestampAuto-generated
updated_atstringISO 8601 timestampAuto-updated

Ocean Metadata Schema

The ocean object contains rich metadata scraped from the original scientific article source:

FieldTypeDescriptionConstraints
titlestringOriginal article title from sourceRequired
urlstringURL to original articleURI format
authorstringOriginal article author(s)Optional
sourcestringPublication source (e.g., "PubMed", "DOAJ")Optional
abstractstringOriginal article abstractMax 10000 chars
contentstringFull article text contentMax 100000 chars
keywordsarrayArticle keywords/subjectsMax 25 items
linksobjectRelated links (DOI, PMC, etc.)Key-value pairs
theme_colorstringExtracted theme color from sourceHex format (#RRGGBB)
datestringPublication dateISO 8601 datetime
faviconstringSource website favicon URLURI format

Endpoints and Responses

GET /v2/articles

Retrieve paginated list of articles.

Query Parameters

NameTypeDescription
limitintPage size
pageintPage index
searchstringFree-text search
sortstringSort expression

Responses

200 OK:

json
{
	"items": [
		{
			"id": "000000000000002345678901",
			"title": "Circadian Rhythm and Sleep Patterns",
			"description": "Analysis of how circadian rhythms affect sleep quality in shift workers",
			"tags": ["sleep", "circadian", "health", "research"],
			"content": "This article explores the relationship between circadian rhythms and sleep patterns...",
			"color": 16711680,
			"color_hex": "#FF0000",
			"author_id": "000000000000000123456789",
			"author": {
				"id": "000000000000000123456789",
				"username": "dr_smith",
				"email": "[email protected]"
			},
			"ocean": {
				"title": "Effects of Circadian Disruption on Sleep Quality in Night Shift Workers",
				"url": "https://pubmed.ncbi.nlm.nih.gov/12345678/",
				"author": "Smith J, Johnson A, Williams K",
				"source": "PubMed",
				"abstract": "Background: Circadian rhythm disruption is common among night shift workers...",
				"content": "Full article text content here...",
				"keywords": ["circadian rhythm", "sleep", "shift work", "melatonin", "chronobiology"],
				"links": {
					"doi": "10.1234/journal.2024.12345",
					"pmc": "PMC12345678"
				},
				"theme_color": "#003366",
				"date": "2024-11-15T00:00:00Z",
				"favicon": "https://pubmed.ncbi.nlm.nih.gov/favicon.ico"
			},
			"created_at": "2025-01-09T14:48:00Z",
			"updated_at": "2025-01-09T14:48:00Z"
		}
	],
	"page": 1,
	"limit": 20,
	"total": 1
}

400 Bad Request — invalid query parameters

POST /v2/articles

Create new article entry.

Request Body

json
{
	"title": "Chronobiology Research Review",
	"description": "Comprehensive review of recent chronobiology research findings",
	"tags": ["chronobiology", "research", "review"],
	"content": "This review examines the latest developments in chronobiology research, focusing on practical applications for improving sleep and health outcomes. The field has seen significant advances in understanding how circadian rhythms influence various physiological processes...",
	"ocean": {
		"title": "Advances in Chronobiology: A 2024 Review",
		"url": "https://doaj.org/article/xyz789",
		"author": "Chen L, Patel R",
		"source": "DOAJ",
		"abstract": "This comprehensive review examines recent advances...",
		"content": "Full article content...",
		"keywords": ["chronobiology", "circadian", "sleep"],
		"links": {
			"doi": "10.5678/review.2024.999"
		},
		"theme_color": "#1a5490",
		"date": "2024-12-01T00:00:00Z",
		"favicon": "https://doaj.org/favicon.ico"
	}
}

Responses

201 Created:

json
{
	"id": "000000000000002345678902",
	"title": "Chronobiology Research Review",
	"description": "Comprehensive review of recent chronobiology research findings",
	"tags": ["chronobiology", "research", "review"],
	"content": "This review examines the latest developments in chronobiology research...",
	"color": 8421504,
	"color_hex": "#808080",
	"author_id": "000000000000000123456789",
	"author": {
		"id": "000000000000000123456789",
		"username": "dr_smith",
		"email": "[email protected]"
	},
	"ocean": {
		"title": "Advances in Chronobiology: A 2024 Review",
		"url": "https://doaj.org/article/xyz789",
		"author": "Chen L, Patel R",
		"source": "DOAJ",
		"abstract": "This comprehensive review examines recent advances...",
		"content": "Full article content...",
		"keywords": ["chronobiology", "circadian", "sleep"],
		"links": {
			"doi": "10.5678/review.2024.999"
		},
		"theme_color": "#1a5490",
		"date": "2024-12-01T00:00:00Z",
		"favicon": "https://doaj.org/favicon.ico"
	},
	"created_at": "2025-01-10T11:00:00Z",
	"updated_at": "2025-01-10T11:00:00Z"
}

400 Bad Request — validation error (e.g., title too long, content too short/long, too many tags)

401 Unauthorized — authentication required

403 Forbidden — permission denied

GET /v2/articles/random

Retrieve random article selection.

Query Parameters

NameTypeDescription
limitintNumber of random articles to get

Responses

200 OK:

json
{
	"items": [
		{
			"id": "000000000000002345678903",
			"title": "Neural Mechanisms of Memory",
			"description": "Exploring how the brain encodes and retrieves memories",
			"tags": ["neuroscience", "memory", "brain"],
			"content": "Recent advances in neuroscience have revealed fascinating insights...",
			"color": 255,
			"color_hex": "#0000FF",
			"author_id": "000000000000000987654321",
			"author": {
				"id": "000000000000000987654321",
				"username": "neuro_researcher",
				"email": "[email protected]"
			},
			"ocean": {
				"title": "Neural Correlates of Long-Term Memory Formation",
				"url": "https://springeropen.com/articles/memory-2024",
				"author": "Brown M, Davis P",
				"source": "SpringerOpen",
				"abstract": "We investigated neural mechanisms underlying memory formation...",
				"content": "Full research article...",
				"keywords": ["memory", "neuroscience", "hippocampus", "plasticity"],
				"links": {
					"doi": "10.1234/springer.2024.456"
				},
				"theme_color": "#006699",
				"date": "2024-10-20T00:00:00Z",
				"favicon": "https://springeropen.com/favicon.ico"
			},
			"created_at": "2025-01-08T09:30:00Z",
			"updated_at": "2025-01-08T09:30:00Z"
		}
	],
	"page": 1,
	"limit": 1,
	"total": 1
}

GET /v2/articles/

Retrieve single article by ID.

Path Parameters

NameTypeDescription
articleIdstringArticle identifier (24-digit string)

Responses

200 OK — returns full article object (same structure as POST response)

404 Not Found:

json
{
	"error": {
		"code": "E404",
		"message": "Article not found"
	}
}

PATCH /v2/articles/

Update article. Only the article creator or admin can update.

Path Parameters

NameTypeDescription
articleIdstringArticle identifier (24-digit string)

Request Body

Any subset of updatable fields:

json
{
	"title": "Updated Title",
	"description": "Updated description",
	"tags": ["new", "tags"],
	"content": "Updated article content with at least 50 characters to meet minimum length requirement."
}

Responses

200 OK — returns updated article object

400 Bad Request — validation error

401 Unauthorized — authentication required

403 Forbidden — not article creator or admin

404 Not Found

DELETE /v2/articles/

Delete article. Only the article creator or admin can delete.

Path Parameters

NameTypeDescription
articleIdstringArticle identifier (24-digit string)

Responses

204 No Content — deleted successfully

401 Unauthorized — authentication required

403 Forbidden — not article creator or admin

404 Not Found

POST /v2/articles/check_expired

Admin endpoint to check and process expired articles.

Responses

204 No Content — processed successfully

401 Unauthorized — authentication required

403 Forbidden — admin permission required

Notes

  • Articles are created by users to share and discuss scientific research
  • The ocean object contains rich metadata from the original source (scraped via Cloud + Ocean pipeline)
  • Color is auto-generated as an integer and provided as hex code for frontend use
  • User-scoped listing endpoints exist in users.md (/v2/users/{id|username|current}/articles)
  • Tags are limited to 10 items with max 30 characters each
  • Content must be between 50 and 25,000 characters

Error Format

json
{
	"error": {
		"code": "E404",
		"message": "Not found"
	}
}