Explyra API-E Reference

The Explyra API-E (Enhanced) is a production-ready edge API layer built on Cloudflare Workers. It provides high-performance access to the Explyra ecosystem for third-party integrations, mobile apps, and enterprise workflows.

Base URL: https://api.explyra.me

Key features include:

  • Edge Performance: Globally distributed via Cloudflare's network.
  • Real-time Sync: Seamlessly bridges with the main Explyra Firestore instance.
  • Lifecycle Management: Full control over API keys through a secure Admin UI.
  • Rate Limiting: Tiered quotas to prevent abuse and ensure stability.

Authentication

Public API endpoints require an API Key passed in the x-api-key header. Admin endpoints require a JWT Bearer token obtained via the login process.

Example Header
x-api-key: exp_0229dc541966e1bfaeb66276d4a20dcfff4...

Onboarding Workflow

Follow these steps to start integrating with the Explyra API.

1

Register Your Company

Use the Admin UI or the /admin/register-company endpoint to onboard your organization. You'll need a unique Company ID and admin credentials.

2

Generate API Keys

Login to the API Management Dashboard at api-e/admin-ui/index.html. Navigate to the "API Keys" section and generate a new key for your application.

3

Set Permissions

Ensure your company profile is correctly configured in the main ERP so that API entries can be correctly mapped to your users and departments.

Endpoints Reference

1. System Health

GET /v1/ping

Simple connectivity test to verify your API key and network latency.

2. Expense Management

POST /v1/expenses

Creates a new expense record in the API system and synchronizes it to the main Firebase ERP.

Parameter Type Description
amount Number Required. Total expense amount.
category String Category name (e.g., "Software", "Travel").
note String Optional description or note.
Example Request
curl -X POST https://api.explyra.me/v1/expenses \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"amount": 1250, "category": "Equipment", "note": "Office Supplies"}'
GET /v1/expenses

Lists recent expenses associated with your company ID via the API.

Firebase Sync Workflow

Every transaction created via the API is automatically synced to the main Explyra Firebase instance. This ensures that records are visible in:

  • Admin Portal: Under "Pending Claims" for approval.
  • Employee Hub: In the personal expense history.
  • Audit Logs: Fully traceable back to the originating API key.
Sync Latency: Mirroring is performed at the Edge. Expected latency is < 200ms after a successful API response.

Error Handling

Explyra API uses standard HTTP response codes to indicate the success or failure of an API request.

Code Meaning
401 Unauthorized Invalid or missing x-api-key.
403 Forbidden API key is restricted or quota has been exceeded.
429 Too Many Requests Rate limit exceeded for your current plan.
500 Internal Error Unexpected server-side issue.