API Overview

Introduction to the Moqup API for developers building integrations.

The Moqup API enables developers to integrate Moqup into their applications and workflows. This guide provides an overview of the API capabilities and how to get started.

API Basics

Base URL

All API requests should be made to:

https://moqup.io/api/v1

API Versioning

The API is versioned via the URL path:

  • v1 - Current stable version
  • Version in URL ensures backward compatibility
  • Breaking changes only in new versions

Response Format

All responses are JSON:

json
{
  "success": true,
  "data": { ... }
}

Error Responses

Errors follow a consistent format:

json
{
  "success": false,
  "error": {
    "code": "invalid_request",
    "message": "The request was invalid"
  }
}

Quick Start

Step 1: Get API Key

  1. Log into Moqup
  2. Go to Settings > API
  3. Click Create API Key
  4. Copy your key securely

Step 2: Make First Request

bash
curl https://moqup.io/api/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY"

Step 3: Explore Endpoints

Browse available endpoints:

ResourceEndpoints
Projects/projects, /projects/{id}
Files/projects/{id}/files, /files/{id}
Annotations/files/{id}/annotations, /annotations/{id}
Clients/clients, /clients/{id}

Available Resources

Projects

Manage design projects:

  • GET /projects - List all projects
  • POST /projects - Create new project
  • GET /projects/{id} - Get project details
  • PATCH /projects/{id} - Update project
  • DELETE /projects/{id} - Delete project

Files

Handle design files:

  • GET /projects/{id}/files - List project files
  • POST /projects/{id}/files - Upload file
  • GET /files/{id} - Get file details
  • PATCH /files/{id} - Update file
  • DELETE /files/{id} - Delete file

Annotations

Work with feedback:

  • GET /files/{id}/annotations - List file annotations
  • POST /files/{id}/annotations - Create annotation
  • GET /annotations/{id} - Get annotation
  • PATCH /annotations/{id} - Update annotation
  • DELETE /annotations/{id} - Delete annotation

Clients

Manage client records:

  • GET /clients - List all clients
  • POST /clients - Create client
  • GET /clients/{id} - Get client details
  • PATCH /clients/{id} - Update client
  • DELETE /clients/{id} - Delete client

Common Use Cases

CI/CD Integration

Upload designs automatically:

bash
curl https://moqup.io/api/v1/projects/proj_123/files \
  -X POST \
  -H "Authorization: Bearer $MOQUP_API_KEY" \
  -F "file=@dist/designs/homepage.png" \
  -F "stage=Review"

List Project Annotations

Get all feedback for a project:

javascript
async function getProjectAnnotations(projectId) {
  // First get all files
  const filesRes = await fetch(
    `https://moqup.io/api/v1/projects/${projectId}/files`,
    { headers: { Authorization: `Bearer ${API_KEY}` } }
  );
  const files = await filesRes.json();

  // Then get annotations for each file
  const annotations = [];
  for (const file of files.data) {
    const annotRes = await fetch(
      `https://moqup.io/api/v1/files/${file.id}/annotations`,
      { headers: { Authorization: `Bearer ${API_KEY}` } }
    );
    const fileAnnotations = await annotRes.json();
    annotations.push(...fileAnnotations.data);
  }
  return annotations;
}

Best Practices

Security

  1. Never expose API keys in client-side code
  2. Use environment variables for keys
  3. Rotate keys regularly
  4. Use minimum permissions

Performance

  1. Cache responses when possible
  2. Use pagination for large lists
  3. Respect rate limits

Error Handling

  1. Check status codes before parsing
  2. Implement retries for transient errors
  3. Handle rate limiting gracefully

Documentation

Support

Next Steps

  1. Authentication - Set up access
  2. Projects API - Core endpoints
  3. Rate Limits - Usage limits