Skip to main content

API Reference

Moonlight exposes a REST API at http://localhost:3000. Interactive documentation is available via Swagger UI at /api/docs.

Active development

The API is being shipped alongside the rest of Moonlight, which is in active development. Endpoint paths, request and response shapes for endpoints marked as exploratory may change between minor releases. Where an endpoint is stable enough for integration work, the per-endpoint page says so. When in doubt, pin to a specific server version and watch the changelog.

Authentication

Most endpoints require a JWT Bearer token. See Authentication for details.

Base URL

EnvironmentURL
Localhttp://localhost:3000
Stagehttps://stage-api.moon-light.app
Productionhttps://api.moon-light.app

Response Format

All responses are JSON. Monetary amounts are expressed in cents (integer).

{
"id": 1,
"amountCents": 50000,
"baseCurrency": "USD"
}

50000 cents = $500.00

Error Responses

{
"statusCode": 400,
"message": "Entry is already voided",
"error": "Bad Request"
}

Endpoints Overview

GroupBase PathAuthDescription
Auth/authPublic / JWTLogin, token refresh, current user
Entries/entriesJWTFinancial entries CRUD, status, void, refund, reimburse
Documents/entries/:id/documentsJWTUpload, request, fulfill, approve, reject
Accounting/accountingJWTConnections, push/pull sync
Webhooks/webhooks/accounting/:connectionIdNoneIncoming webhooks from accounting systems
Workspaces/workspacesJWTWorkspace CRUD, user assignments
Projects/projectsJWTProject CRUD, user assignments
Parties/partiesJWTParty listing, details, accounts
Tags/tagsJWTTag listing by workspace
Users/usersJWTUser CRUD, role assignments
Roles/rolesJWTRole listing
Reports/reportsJWTSummary, timeline, by-party, by-tag, by-project, flows, calendar, distribution
Integrations/integrationsJWTIntegration CRUD, API key rotation
Ingest/api/v1/ingestAPI KeyData ingestion (JSON, CSV, images)
Submissions/api/v1/submissionsAPI KeySubmission status and listing

Reporting

Report endpoints return aggregated financial data. Some reports are exploratory and not suitable for control-grade decisions. See Reports API for details on each endpoint and its trust level.