OneMesh Integrate

Developer Guides

Conceptual guides and best practices for building on top of the OneMesh Ecosystem. Learn the architecture before diving into the API Reference.

Building Mobile Apps with OneMesh

1. Authentication Strategy

Unlike our web applications which rely on cookies (BFF architecture), native mobile applications (iOS/Android) must use our dedicated JWT authentication endpoints.

POST /api/v1/auth/mobile/login
POST /api/v1/auth/mobile/refresh

These endpoints return an access_token and a refresh_token. You must pass the access token in the Authorization: Bearer header for all subsequent requests.

2. Operating within a Business (Tenant)

OneMesh is a multi-tenant platform. A single user (e.g. an agency owner) may have access to multiple businesses. In the mobile app, there is no concept of a "Global Active Tenant". Instead, every request must explicitly declare which business it is operating on using the following header:

X-Tenant-ID: barberia-el-cid

3. Real-time Events (SSE)

To receive live chat messages without polling, connect to our Server-Sent Events (SSE) stream at /api/chat/stream. Since standard EventSource libraries in Flutter/React Native do not easily support custom headers, you may pass your JWT and Tenant ID via query parameters:

GET /api/chat/stream?token=eyJhbG...&tenant_id=barberia-el-cid