API Documentation

Access your projects programmatically with our RESTful API. Available for Pro plan users.

v1.0
Pro Only

Authentication

All API requests require authentication using an API key. Only Pro plan users have access to the API.

Getting Your API Key

  1. Upgrade to the Pro plan
  2. Click your account menu (top right)
  3. Select "API Access"
  4. Click "Generate API Key"
  5. Toggle "API Access" to enable your key
  6. Copy and securely store your key

Using Your API Key

Include your API key in the Authorization header:

curl -H "Authorization: Bearer pm_your_api_key_here" https://projectmirror.app/api/v1/projects

Security Best Practices

  • Never share your API key publicly
  • Don't commit it to version control
  • Rotate keys regularly
  • Regenerate immediately if compromised
  • Disable API access when not in use
  • Use the toggle to enable/disable access as needed

Quick Start

1. Make Your First Request

curl -H "Authorization: Bearer YOUR_API_KEY" https://projectmirror.app/api/v1/projects

2. Filter Active Projects

curl -H "Authorization: Bearer YOUR_API_KEY" https://projectmirror.app/api/v1/projects?status=active

3. Sort by Title

curl -H "Authorization: Bearer YOUR_API_KEY" https://projectmirror.app/api/v1/projects?sort=title&order=asc

Endpoints

GET/api/v1/projects

Retrieve your projects with flexible sorting and filtering options.

Query Parameters
ParameterTypeDefaultDescription
sortstringdatedate, title, or status
orderstringdescasc or desc
statusstringallactive, draft, archived, or all
limitnumber501-100
offsetnumber0Pagination offset
Example Response (200 OK)
{
    "success": true,
    "data": [
      {
        "_id": "507f...",
        "title": "My Project",
        "description": "...",
        "url": "https://example.com",
        "tags": ["web", "app"],
        "technologies": ["React", "Next.js"],
        "status": "active",
        "projectDate": "2024-01-15T00:00:00.000Z",
        "createdAt": "2024-01-10T12:00:00.000Z"
      }
    ],
    "pagination": {
      "total": 42,
      "limit": 50,
      "offset": 0,
      "hasMore": false
    },
    "meta": {
      "sort": "date",
      "order": "desc",
      "status": "all"
    }
}

Error Responses

401Unauthorized

Missing or invalid API key

{
    "error": "Invalid API key",
    "message": "API key is invalid or has been disabled."
  }

403Access Denied

Not an active Pro plan user or subscription expired

{
    "error": "Access denied",
    "message": "API access is only available for active Pro plan users. Your subscription may have expired or been downgraded.",
    "currentPlan": "Basic",
    "upgradeUrl": "https://projectmirror.app/#pricing"
  }

400Bad Request

Invalid parameters

{
    "error": "Invalid sort parameter",
    "message": "Sort parameter must be one of: date, title, status",
    "received": "invalid"
  }

Code Examples

Fetch Projects (JavaScript)

const API_KEY = 'pm_your_api_key_here';

  async function fetchProjects() {
    const response = await fetch(
      'https://projectmirror.app/api/v1/projects',
      {
        headers: {
          'Authorization': `Bearer ${API_KEY}`
        }
      }
    );
    
    const data = await response.json();
    return data;
  }

With Pagination

async function getProjectsPaginated(page = 0, pageSize = 10) {
    const offset = page * pageSize;
    
    const response = await fetch(
      `https://projectmirror.app/api/v1/projects?limit=${pageSize}&offset=${offset}`,
      {
        headers: {
          'Authorization': `Bearer ${API_KEY}`
        }
      }
    );
    
    return response.json();
  }

Ready to Get Started?

Upgrade to Pro and start using the API today!