This document describes the public REST API endpoints available in ModParks.
All API endpoints are prefixed with /api/v1.
Public endpoints for reading data (such as getting a project or fetching versions) do not require authentication and can be accessed without an API key.
However, certain private or rate-limited endpoints may require an API key to be passed in the Authorization header as a Bearer token.
- Header:
Authorization: Bearer <your_api_key> - Example:
Authorization: Bearer mp_a2d0example
If a protected endpoint receives a request without a valid header, it will return a 401 Unauthorized error:
{
"error": "Missing or invalid Authorization header"
}Fetches public details of a specific project by its slug.
- URL:
/api/v1/projects/[slug] - Method:
GET - Response (200 OK):
{ "id": "12345", "slug": "sample-mod", "name": "Sample Mod", "description": "A sample mod for Minecraft", "iconUrl": "https://example.com/icon.png", "type": "mod", "license": "MIT", "sourceUrl": "https://github.com/...", "downloads": { "total": 1500, "native": 500, "modrinth": 800, "curseforge": 200 }, "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "2026-06-01T00:00:00Z", "author": { "username": "Pitan76", "displayName": "Pitan", "avatarUrl": "https://github.com/..." }, "categories": ["Utility", "Magic"], "tags": ["fabric", "forge"] } - Error (404 Not Found): If the project does not exist or is private.
Fetches a list of public projects.
- URL:
/api/v1/projects - Method:
GET - Query Parameters:
limit(optional): Default 20, Max 80.offset(optional): Default 0.
- Response (200 OK):
{
"data": [
{
"id": "12345",
"slug": "sample-mod",
"name": "Sample Mod",
"iconUrl": "https://example.com/icon.png",
"type": "mod",
"license": "MIT",
"downloads": {
"total": 1500,
"native": 500,
"modrinth": 800,
"curseforge": 200
},
"createdAt": 1672531200000,
"updatedAt": 1685587200000,
"author": {
"username": "Pitan76",
"displayName": "Pitan",
"avatarUrl": "https://github.com/..."
},
"categories": ["Utility","Magic"],
"tags": ["fabric","forge"]
}
],
"meta": {
"limit": 20,
"offset": 0,
"count": 1
}
}- Error (400 Bad Request): Invalid
limit/offset.
Fetches all public versions of a specific project.
- URL:
/api/v1/projects/[slug]/versions - Method:
GET - Response (200 OK):
{ "versions": [ { "id": "abc-123", "versionNumber": "1.0.0", "mcVersions": ["1.20.1", "1.20.2"], "loaders": ["fabric", "forge"], "changelog": "Initial release", "fileUrl": "https://...", "fileName": "sample-mod-1.0.0.jar", "fileSize": 1024000, "downloads": 500, "createdAt": "2026-06-01T00:00:00Z" } ] }
Fetches public profile information of a user.
- URL:
/api/v1/users/[username] - Method:
GET - Response (200 OK):
{ "id": "user-123", "username": "Pitan76", "displayName": "Pitan", "avatarUrl": "https://github.com/...", "bio": "Minecraft Mod Developer", "createdAt": "2026-01-01T00:00:00Z" } - Error (404 Not Found): If the user does not exist.
Fetches recently posted ideas on the Idea Board.
- URL:
/api/v1/ideas - Method:
GET - Query Parameters:
limit(optional): Default 20, Max 80.
- Response (200 OK):
{ "ideas": [ { "id": "idea-1", "title": "We need a better minimap mod", "description": "It would be great if...", "author": { "username": "player1", "avatarUrl": "https://..." }, "createdAt": "2026-06-01T00:00:00Z" } ] }
Fetches the profile settings of the currently authenticated user.
- URL:
/api/v1/profile - Method:
GET - Headers: Requires Authentication Cookie / Session.
- Response (200 OK):
{ "id": "user-123", "username": "Pitan76", "displayName": "Pitan", "avatarUrl": "https://github.com/...", "bio": "Minecraft Mod Developer", "locale": "ja" } - Error (401 Unauthorized): If not logged in.
Fetches the current user's integration settings (API keys are masked).
- URL:
/api/v1/profile/integrations - Method:
GET - Response (200 OK):
{ "hasModrinthKey": true, "hasCurseforgeKey": false }
Updates Modrinth or CurseForge API keys.
- URL:
/api/v1/profile/integrations - Method:
PUT - Body:
{ "modrinthApiKey": "mrp_xxxxxxxx", "curseforgeApiKey": "$2a$10$..." } - Response (200 OK)
Imports a project from Modrinth or CurseForge.
- URL:
/api/v1/projects/import - Method:
POST - Body:
{ "platform": "modrinth", "externalId": "A1b2C3d4" } - Response (201 Created): Returns the imported project details including the new slug.
Synchronizes an imported project's details and downloads with the external platform.
- URL:
/api/v1/projects/[slug]/sync - Method:
POST - Response (200 OK): Returns the updated project details.
Updates project settings such as comment enablement and issue tracker URL.
- URL:
/api/v1/projects/[slug]/settings - Method:
PUT - Body:
{ "commentsEnabled": true, "issueTrackerUrl": "https://github.com/...", "status": "public" } - Response (200 OK)
Fetches comments for a project (if enabled).
- URL:
/api/v1/projects/[slug]/comments - Method:
GET - Response (200 OK):
{ "comments": [ { "id": "comment-1", "content": "Great mod!", "author": { "username": "player1", "avatarUrl": "..." }, "createdAt": "2026-06-01T00:00:00Z" } ] }
Posts a new comment to a project.
- URL:
/api/v1/projects/[slug]/comments - Method:
POST - Body:
{ "content": "This is a new comment." } - Response (201 Created)
Deletes a specific comment (requires author or admin).
- URL:
/api/v1/projects/[slug]/comments/[commentId] - Method:
DELETE - Response (200 OK)
Follows a specific user.
- URL:
/api/v1/users/[username]/follow - Method:
POST - Response (200 OK)
Unfollows a specific user.
- URL:
/api/v1/users/[username]/follow - Method:
DELETE - Response (200 OK)
Fetches the list of followers or users being followed.
- URL:
/api/v1/users/[username]/followers(or/following) - Method:
GET - Response (200 OK):
{ "users": [ { "username": "player1", "displayName": "Player One", "avatarUrl": "..." } ], "count": 1 }
Updates a collection's details (author only).
- URL:
/api/v1/collections/[id] - Method:
PUT - Body:
{ "name": "My Favorites", "description": "Best mods ever", "visibility": "public", "iconUrl": "https://..." } - Response (200 OK)
Deletes a collection (author only).
- URL:
/api/v1/collections/[id] - Method:
DELETE - Response (200 OK)
Follows another user's collection.
- URL:
/api/v1/collections/[id]/follow - Method:
POST - Response (200 OK)
Unfollows a collection.
- URL:
/api/v1/collections/[id]/follow - Method:
DELETE - Response (200 OK)