API Reference

Integrate Mrque into your workflow — upload projects, manage preview links, and automate deploy from CI, scripts, or AI coding agents.

Base URL & authentication

All API requests go to https://api.mrque.com. HTTPS is required — plain HTTP is rejected (not redirected). Requests to the API host over HTTP receive a 400 Bad Request.

Authenticate with a Bearer token in the Authorization header:

Authorization: Bearer mk_…your_key_here…

API keys start with mk_. Generate or regenerate yours in Settings → Integrations. The full key is shown once on generation — copy it immediately. API access requires a Pro or Agency plan.

Rate limit

100 requests per minute per API key. When the limit is exceeded you receive 429 Too Many Requests with a Retry-After header (seconds until the window resets).

Endpoints

POST/upload

Upload a project archive and receive a preview URL. Body must be multipart/form-data.

FieldTypeRequiredNotes
filebinaryYesZIP archive of your project
namestringNoHuman-readable project name (defaults to filename)
expiresIn7 | 30 | 90NoDays until expiry (default 7; never not available via API)
passwordstringNoOptional password to gate the preview

Response 201:

{
  "id": "clx…",
  "url": "https://mrque.com/p/<slug>",
  "name": "my-project",
  "expires_at": "2026-07-18T00:00:00.000Z",
  "status": "active"
}
GET/previews

List your previews, newest first.

Query paramTypeDefaultNotes
statusstringFilter by active, expired, or revoked
limitinteger20Max 100
offsetinteger0Pagination offset

Response 200:

[
  {
    "id": "clx…",
    "url": "https://mrque.com/p/<slug>",
    "name": "landing-page-v3",
    "status": "active",
    "expires_at": "2026-07-18T00:00:00.000Z",
    "views": 14
  }
]
GET/previews/:id

Get a single preview by ID. Includes comment_count.

Response 200:

{
  "id": "clx…",
  "url": "https://mrque.com/p/<slug>",
  "name": "landing-page-v3",
  "status": "active",
  "expires_at": "2026-07-18T00:00:00.000Z",
  "views": 14,
  "comment_count": 3
}
DELETE/previews/:id

Revoke a preview immediately. The link will no longer be accessible.

Response 200:

{ "success": true, "message": "Preview revoked" }

Error codes

StatusMeaningExample body
400HTTPS required / bad request{"error":"HTTPS is required"}
401Missing or invalid API key{"error":"Invalid or missing API key"}
403Plan required or upload limit reached{"error":"…","upgrade_url":"https://mrque.com/pricing"}
404Preview not found{"error":"Preview not found"}
413File too large{"error":"File too large"}
422Invalid file type or missing fields{"error":"Invalid file type"}
429Rate limit exceeded (100/min){"error":"Rate limit exceeded"} + Retry-After

OpenAPI 3 spec available at https://api.mrque.com/openapi.json.

Code examples

Node.js — upload a project

// Node.js — upload a project ZIP via the Mrque API
import { readFileSync } from 'fs';

const API_KEY = process.env.MIRRCO_API_KEY; // mk_…

async function uploadPreview(zipPath, name) {
  const form = new FormData();
  form.append('file', new Blob([readFileSync(zipPath)], { type: 'application/zip' }), 'project.zip');
  form.append('name', name);
  form.append('expiresIn', '30');

  const res = await fetch('https://api.mrque.com/upload', {
    method: 'POST',
    headers: { Authorization: `Bearer ${API_KEY}` },
    body: form,
  });

  if (!res.ok) {
    const err = await res.json();
    throw new Error(err.error ?? `Upload failed: ${res.status}`);
  }

  const { url, expires_at } = await res.json();
  console.log('Preview ready:', url);
  console.log('Expires:', expires_at);
  return url;
}

uploadPreview('./dist.zip', 'My Landing Page v3');

Node.js — list + revoke previews

const API_KEY = process.env.MIRRCO_API_KEY;
const headers = { Authorization: `Bearer ${API_KEY}` };

// List active previews
const list = await fetch('https://api.mrque.com/previews?status=active', { headers });
const previews = await list.json();
console.log(previews.map(p => `${p.name}: ${p.url}`));

// Get one preview (includes comment_count)
const get = await fetch(`https://api.mrque.com/previews/${previews[0].id}`, { headers });
console.log(await get.json()); // { id, url, name, status, expires_at, views, comment_count }

// Revoke a preview
const del = await fetch(`https://api.mrque.com/previews/${previews[0].id}`, {
  method: 'DELETE', headers,
});
console.log(await del.json()); // { success: true, message: 'Preview revoked' }

Python — upload a project

# Python — upload a project ZIP via the Mrque API
import os
import requests

API_KEY = os.environ["MIRRCO_API_KEY"]  # mk_…
BASE    = "https://api.mrque.com"

def upload_preview(zip_path: str, name: str, expires_in: int = 30) -> str:
    with open(zip_path, "rb") as f:
        resp = requests.post(
            f"{BASE}/upload",
            headers={"Authorization": f"Bearer {API_KEY}"},
            files={"file": ("project.zip", f, "application/zip")},
            data={"name": name, "expiresIn": str(expires_in)},
        )
    resp.raise_for_status()
    data = resp.json()
    print(f"Preview ready: {data['url']}")
    print(f"Expires: {data['expires_at']}")
    return data["url"]

upload_preview("./dist.zip", "My Landing Page v3")

Python — list + revoke previews

import os, requests

API_KEY = os.environ["MIRRCO_API_KEY"]
BASE    = "https://api.mrque.com"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

# List active previews
previews = requests.get(f"{BASE}/previews?status=active", headers=HEADERS).json()
for p in previews:
    print(f"{p['name']}: {p['url']}")

# Get one preview (includes comment_count)
detail = requests.get(f"{BASE}/previews/{previews[0]['id']}", headers=HEADERS).json()
print(detail)  # {'id': …, 'url': …, 'comment_count': 2}

# Revoke a preview
result = requests.delete(f"{BASE}/previews/{previews[0]['id']}", headers=HEADERS).json()
print(result)  # {'success': True, 'message': 'Preview revoked'}

Using Mrque with AI coding agents

Mrque is designed to be AI-native. Tell your coding agent to upload your project and it will generate a shareable preview link automatically — no manual steps required.

Ready-made developer prompt

Copy this into your agent or IDE prompt. Replace <YOUR_KEY> with your API key from Settings.

Use the Mrque API (https://api.mrque.com) to upload this project and generate a preview link. API key: <YOUR_KEY>. POST to /upload with the project files as multipart/form-data.

Cursor

Add the following to your project's .cursorrules file (or paste it into Cursor's system prompt field in Settings → Rules for AI):

# .cursorrules
# Mrque preview deployments
MIRRCO_API=https://api.mrque.com
MIRRCO_KEY=<YOUR_KEY>

When I ask you to "share", "preview", or "deploy" the current project:
1. Build / export the project to a dist/ or build/ directory.
2. Zip that directory.
3. POST the zip to https://api.mrque.com/upload as multipart/form-data with an Authorization: Bearer <YOUR_KEY> header.
4. Return the preview URL from the response JSON.

You can also include a shorter mention directly in any Cursor prompt: “Use the Mrque API at https://api.mrque.com (Bearer {key}) to upload the build output and give me the preview link.”

Claude Code

Reference the Mrque API in your CLAUDE.md project file or in a system prompt so Claude Code can upload previews automatically:

## Preview deployment
Use the Mrque API to share builds with clients.
- Base URL: https://api.mrque.com
- Auth: Authorization: Bearer <YOUR_KEY>
- Upload: POST /upload (multipart/form-data, field: file)
- Returns: { url, expires_at, status }

When asked to "preview", "share", or "deploy":
1. Run the project build command.
2. Zip the output directory.
3. Upload the zip to https://api.mrque.com/upload.
4. Return the preview URL.

Claude Code picks up CLAUDE.md automatically in every session within that project. You can also pass the instructions inline: “Upload the build output to Mrque (https://api.mrque.com, Bearer {key}) and give me the preview link.”

GitHub Copilot

Configure Copilot for your project by adding a .github/copilot-instructions.md file:

<!-- .github/copilot-instructions.md -->
## Preview sharing
This project uses the Mrque API to create shareable preview links.
- API base: https://api.mrque.com
- Auth header: Authorization: Bearer <YOUR_KEY>
- Upload endpoint: POST /upload (multipart/form-data)
  - Required field: file (binary ZIP of the build output)
  - Optional: name (string), expiresIn (7 | 30 | 90)
- On success (201): returns { url, name, expires_at, status }

When I ask to "share" or "preview" the project, build it, zip the output, and POST it to /upload.

GitHub Copilot reads .github/copilot-instructions.md automatically for repository-level context in Copilot Chat and agent mode.

Full machine-readable spec: https://api.mrque.com/openapi.json. Questions? Contact us.