API Reference

Authentication

MarkStore uses Bearer token authentication. Include your API token in the Authorization header with the Bearer scheme.

Your API Token

You can find your personal API token in your account settings. Keep it safe and never expose it in client-side code.

Example Request

Here's a sample cURL request showing how to authenticate with your token:

bash
curl -X GET https://usemarkstore.com/api/v1/files \
  -H "Authorization: Bearer msk_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Accept: application/json"

Authentication Headers

HeaderDescription
AuthorizationBearer token in the format: Bearer msk_...
AcceptSet to application/json (recommended)

Quick Example (Node.js)

Using the fetch API with a Bearer token.

javascript
const token = 'msk_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
const res = await fetch('https://usemarkstore.com/api/v1/files', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Accept': 'application/json',
  }
});

const data = await res.json();
console.log(data);

Making Requests

All API requests should be made to the base URL with the appropriate HTTP method.

Base URL

https://usemarkstore.com

Error Handling

The API returns standard HTTP status codes and JSON error responses.

CodeDescription
200Success
201Created
400Bad Request — invalid parameters
401Unauthorized — missing or invalid token
404Not Found — resource doesn't exist
409Conflict — resource already exists
500Server Error

Example error response:

{
  "error": "Unauthorized — provide Authorization: Bearer msk_…"
}

Rate Limits

API requests are rate-limited to ensure fair usage. If you exceed the limit, you'll receive a 429 status code.

Files

Endpoints for uploading, downloading, and managing files. Supports Markdown (.md) and JSON (.json) file types.

Endpoints

GET
/api/v1/files

List and retrieve files

POST
/api/v1/files

Upload a file

GET
/api/v1/files/{id}

Get a specific file

PATCH
/api/v1/files/{id}

Update a file

DELETE
/api/v1/files/{id}

Delete a file

List Files

Retrieve all files in your account. Optionally filter by folder or project.

ParameterTypeDescription
folderstringFilter by folder name (use "all" for all folders)
projectstringFilter by project ID or name

Response:

{
  "files": [
    {
      "id": "file_abc123",
      "name": "document.md",
      "type": "md",
      "folder_id": "folder_xyz",
      "folder_name": "Documents",
      "size": 1234,
      "created_at": "2025-05-01T12:34:56Z",
      "updated_at": "2025-05-02T10:00:00Z"
    }
  ]
}

Create File

Upload a new file. Supports Markdown and JSON content.

bash
curl -X POST https://usemarkstore.com/api/v1/files \
  -H "Authorization: Bearer msk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "notes.md",
    "type": "md",
    "content": "# My Notes\n\nHello, world!"
  }'
FieldTypeDescription
name*stringFilename (auto-appends .md or .json)
type*string"md" or "json"
contentstringFile content
folderNamestringTarget folder name
projectIdstringTarget project ID
projectNamestringTarget project name

Response (201 Created):

{
  "ok": true,
  "file": {
    "id": "file_new123",
    "name": "notes.md",
    "type": "md",
    "folder_id": "folder_default",
    "folder_name": "Files",
    "size": 28,
    "created_at": "2025-05-03T14:00:00Z",
    "updated_at": "2025-05-03T14:00:00Z",
    "content": "# My Notes\n\nHello, world!"
  }
}

Get File

Retrieve a specific file by ID, including its content.

bash
curl -X GET https://usemarkstore.com/api/v1/files/{id} \
  -H "Authorization: Bearer msk_..."

Update File

Update a file's content and/or name. Creates a new version.

bash
curl -X PATCH https://usemarkstore.com/api/v1/files/{id} \
  -H "Authorization: Bearer msk_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "# Updated content", "name": "renamed.md"}'

Delete File

Permanently delete a file.

bash
curl -X DELETE https://usemarkstore.com/api/v1/files/{id} \
  -H "Authorization: Bearer msk_..."

Folders

Organize your files with folders. Create, list, update, and delete folders programmatically.

GET
/api/v1/folders

List all folders

POST
/api/v1/folders

Create a folder

GET
/api/v1/folders/{id}

Get folder by ID

PATCH
/api/v1/folders/{id}

Rename a folder

DELETE
/api/v1/folders/{id}

Delete a folder

List Files in Folder

Use the folder query parameter on the files endpoint.

bash
curl -X GET "https://usemarkstore.com/api/v1/files?folder=Documents" \
  -H "Authorization: Bearer msk_..."

Projects

Group your content into projects for better organization. Projects have their own folder structure.

Project Endpoints

GET
/api/v1/projects

List all projects

POST
/api/v1/projects

Create a project

GET
/api/v1/projects/{id}

Get project by ID

PATCH
/api/v1/projects/{id}

Update project

DELETE
/api/v1/projects/{id}

Delete project

Project Folders

GET
/api/v1/projects/{id}/folders

List project folders

POST
/api/v1/projects/{id}/folders

Create project folder

PATCH
/api/v1/projects/{id}/folders/{folderId}

Update folder

DELETE
/api/v1/projects/{id}/folders/{folderId}

Delete folder

List Project Files

bash
curl -X GET "https://usemarkstore.com/api/v1/files?project=my-project" \
  -H "Authorization: Bearer msk_..."

Create File in Project

bash
curl -X POST https://usemarkstore.com/api/v1/files \
  -H "Authorization: Bearer msk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "readme.md",
    "type": "md",
    "content": "# Project README",
    "projectName": "my-project"
  }'

Versions

Every update to a file creates a new version. View version history and retrieve previous versions via the API.

GET
/api/v1/files/{id}/versions

List file versions

GET
/api/v1/files/{id}/versions/{version}

Get specific version

List Versions

bash
curl -X GET https://usemarkstore.com/api/v1/files/{id}/versions \
  -H "Authorization: Bearer msk_..."

Share

Create public share links for your files. Anyone with the link can view the file content without authentication.

GET
/api/v1/files/{id}/share

Get share status

POST
/api/v1/files/{id}/share

Enable sharing

DELETE
/api/v1/files/{id}/share

Revoke share link

Enable Sharing

bash
curl -X POST https://usemarkstore.com/api/v1/files/{id}/share \
  -H "Authorization: Bearer msk_..."

Need Help?

If you have questions or need support, check out our quickstart guide or reach out.