Skip to content

API Reference

OpenDS provides a RESTful API for programmatic access to design system data. All endpoints are prefixed with /api/.

Authentication

Most endpoints require authentication. Use JWT tokens obtained from the login endpoint.

Headers

http
Authorization: Bearer <jwt-token>
Content-Type: application/json

Base URL

  • Development: http://localhost:3001/api
  • Production: https://your-opends-instance.com/api

Health Endpoints

EndpointMethodDescriptionAuthentication
/healthGETService statusNo
/health/readyGETReadiness probeNo
/health/liveGETLiveness probeNo

Example Response:

json
{
  "status": "ok",
  "timestamp": "2025-12-16T23:45:00.000Z",
  "version": "0.1.0"
}

Authentication Endpoints

EndpointMethodDescriptionAuthentication
/auth/loginPOSTUser loginNo
/auth/registerPOSTUser registrationNo
/auth/meGETCurrent user infoYes
/auth/logoutPOSTLogoutYes

Login Example:

json
POST /api/auth/login
{
  "email": "user@example.com",
  "password": "password123"
}

Design Files Endpoints

Manage design files from connected design tools.

EndpointMethodDescriptionAuthentication
/design-filesGETList all design filesYes
/design-files/:idGETGet specific design fileYes
/design-files/:id/syncPOSTSync design file from sourceYes
/design-files/:id/componentsGETGet components from design fileYes

Design File Object:

json
{
  "id": "uuid",
  "name": "Design System",
  "source": "penpot",
  "sourceId": "penpot-file-id",
  "lastSyncedAt": "2025-12-16T23:45:00.000Z",
  "createdAt": "2025-12-16T23:45:00.000Z",
  "updatedAt": "2025-12-16T23:45:00.000Z"
}

Components Endpoints

Work with extracted design components.

EndpointMethodDescriptionAuthentication
/componentsGETList all componentsYes
/components/:idGETGet specific componentYes
/components/:id/generatePOSTGenerate code for componentYes
/components/:id/specGETGet component specificationYes

Component Object:

json
{
  "id": "uuid",
  "name": "Button",
  "description": "Primary action button",
  "framework": "vue",
  "code": "<template>...</template>",
  "props": [...],
  "designFileId": "uuid",
  "createdAt": "2025-12-16T23:45:00.000Z",
  "updatedAt": "2025-12-16T23:45:00.000Z"
}

Design Tokens Endpoints

Manage design tokens (colors, typography, spacing, etc.).

EndpointMethodDescriptionAuthentication
/tokensGETList all design tokensYes
/tokens/:idGETGet specific tokenYes
/tokens/exportPOSTExport tokens as CSS/JSONYes

Plugin Endpoints

Interact with the Penpot plugin.

EndpointMethodDescriptionAuthentication
/plugin/connectPOSTConnect Penpot pluginYes
/plugin/dataPOSTReceive data from Penpot pluginYes

File Management Endpoints

Manage uploaded files and assets.

EndpointMethodDescriptionAuthentication
/filesPOSTUpload fileYes
/files/:idGETGet fileYes
/files/:idDELETEDelete fileYes

Error Responses

All endpoints return standard error responses:

json
{
  "error": "Error message",
  "code": "ERROR_CODE",
  "statusCode": 400
}

Common Error Codes:

  • UNAUTHORIZED - Authentication required
  • FORBIDDEN - Insufficient permissions
  • NOT_FOUND - Resource not found
  • VALIDATION_ERROR - Invalid request data
  • INTERNAL_ERROR - Server error

Rate Limiting

API requests are limited to 100 requests per minute per IP address. Exceeding this limit returns HTTP 429.

Interactive API Documentation

For interactive exploration of the API, visit /docs on your OpenDS instance (e.g., http://localhost:3001/docs).

Released under the MIT License.