| title | Quick Start |
|---|---|
| description | Go from a blank project to live read/write API endpoints in under 60 seconds. |
You need a urBackend account and a MongoDB connection string (Atlas free tier works). The base URL for all API calls is https://api.ub.bitbros.in.
Once the project is created, navigate to **Settings** to find your two API keys:
- **`pk_live_...`** — your publishable key, safe to use in frontend and mobile code.
- **`sk_live_...`** — your secret key, for server-side use only. Never expose this in client code.
Store both keys in environment variables:
```bash
VITE_URBACKEND_KEY=pk_live_xxxxxx
URBACKEND_SECRET=sk_live_yyyyyy
```
1. Go to the **Database** tab in your project.
2. Click **Create Collection**.
3. Enter a name, for example `products`.
4. Optionally define a schema (field names and types). You can also skip this and post arbitrary JSON — urBackend will store it as-is.
5. Click **Save**.
Your collection endpoint is now live at `/api/data/products`.
<CodeGroup>
```bash curl
curl -X POST "https://api.ub.bitbros.in/api/data/products" \
-H "x-api-key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{"name": "Widget", "price": 9.99, "inStock": true}'
```
```javascript fetch
const response = await fetch('https://api.ub.bitbros.in/api/data/products', {
method: 'POST',
headers: {
'x-api-key': 'sk_live_...',
'Content-Type': 'application/json'
},
body: JSON.stringify({ name: 'Widget', price: 9.99, inStock: true })
});
const result = await response.json();
// { success: true, data: { _id: '...', name: 'Widget', price: 9.99, inStock: true }, message: '...' }
console.log(result.data);
```
</CodeGroup>
A successful insert returns HTTP `201` with the saved document, including its generated `_id`.
<CodeGroup>
```bash curl
curl "https://api.ub.bitbros.in/api/data/products" \
-H "x-api-key: pk_live_..."
```
```javascript fetch
const response = await fetch('https://api.ub.bitbros.in/api/data/products', {
headers: {
'x-api-key': 'pk_live_...'
}
});
const { data } = await response.json();
// data is an array of documents
console.log(data);
```
</CodeGroup>
You can narrow results with query parameters:
```bash
# Page 2, 10 results per page, sorted by price descending
GET /api/data/products?page=2&limit=10&sort=-price
```
To fetch a single document by its `_id`:
```bash
GET /api/data/products/<document-id>
```
You now have a working backend — collections, inserts, and reads are all live. A few natural next steps:
- Add user authentication. The Auth API (
/api/userAuth/*) handles sign-up, login, JWTs, and social login. See the Authentication guide. - Let frontend users write data. Enable Row-Level Security on a collection so authenticated users can write their own documents with
pk_live. See Row-Level Security. - Enforce data shape. Define field types, required constraints, and unique fields in the collection schema. See Collections & Schemas.