REST API v1

API Reference

The Mellite API is organized around REST. Predictable resource-oriented URLs, form-encoded request bodies, JSON-encoded responses, standard HTTP response codes, and Bearer token authentication.

Base URL

https://api.mellite.io/api

Authentication

Authenticate your account by including your secret API key in the Authorization header. All API requests must be made over HTTPS. API keys are managed in the Developer Dashboard.

curl -X POST https://api.mellite.io/api/projects \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sapphire Heights",
    "total_units": 120,
    "erp_sync_enabled": true,
    "timezone": "Asia/Kolkata"
  }'

Security: Never expose API keys in client-side code, mobile app binaries, or public repositories. Use environment variables for server-side applications.

Endpoints

MethodEndpoint
GET/api/projectsPaginated
POST/api/projects
GET/api/projects/{id}
PATCH/api/projects/{id}
DELETE/api/projects/{id}
GET/api/unitsPaginated
POST/api/units/{id}/lock
GET/api/catalog/categories
POST/api/sync/bom
GET/api/webhooksPaginated

Pagination

List endpoints return paginated results. Use the following query parameters to navigate through pages.

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerResults per page (default: 25, max: 100)
sortstringField to sort by (e.g. created_at)
orderstringasc or desc (default: desc)

Status Codes

200OK - Successful request
201Created - Resource created
400Bad Request - Invalid payload
401Unauthorized - Missing/invalid API key
404Not Found - Resource does not exist
422Unprocessable - Validation error
429Rate Limited - Too many requests
500Server Error - Something went wrong

Rate Limiting

API requests are rate limited per API key. Exceed the limit and you'll receive a 429 Too Many Requests response. See your Developer Dashboard for current plan limits.

Webhooks

Mellite can push real-time events to your webhook endpoints. Events are sent with a signature header for verification.

EventTrigger
selection.completedBuyer finalizes material selections
payment.confirmedPayment successfully processed
unit.lockedSelections locked for execution
snag.reportedBuyer reports a snag
bom.syncedBOM sync completed

SDKs & Libraries

Official client libraries for popular languages distributed via their respective package managers.

Node.js
npm i mellite-sdk
Python
npm i mellite-py
Go
npm i go-mellite
PHP
npm i mellite-php

API Versioning

We follow semantic versioning for our API. Breaking changes are announced via our changelog and developer newsletter in advance.