Location Data
Collections & schema
A collection is a category of points with its own fields. Define the fields first; points can only carry properties the schema knows.
Create a collection
curl -X POST "https://orviamaps.ir/api/v1/collections" \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{
"name": "warehouses",
"title": "Warehouses",
"fields": [
{ "name": "status", "type": "string", "enum": ["active", "inactive", "maintenance"], "required": true, "indexed": true },
{ "name": "capacity", "type": "number", "indexed": true },
{ "name": "manager", "type": "string" },
{ "name": "opened", "type": "date" }
]
}'| Parameter | Type | Description |
|---|---|---|
| name | string | API name: 2–40 lowercase letters, digits, underscores; unique in your account. |
| title | string | Display name. |
| description | string | Optional. |
| fields | list | Optional; you can add fields later. |
Fields
| Parameter | Type | Description |
|---|---|---|
| name | string | Lowercase letters, digits, underscores. Not id, title, location or other built-ins. |
| type | string | number | boolean | date | Dates are ISO 8601 (2026-10-27 or with time) and stored in one format, so they compare correctly. |
| required | boolean | Every point must have it. Only on an empty collection, or when adding the first points. |
| enum | list | Allowed values (string or number fields). |
| indexed | boolean | Creates a database index for fast filtering and sorting on this field. |
POST /api/v1/collections/warehouses/fields { "name": "region", "type": "string" }
DELETE /api/v1/collections/warehouses/fields/region → also removes "region" from every pointIndexes
Index the fields you filter or sort on often. Queries work without an index, but on large collections an index keeps them fast.
GET /api/v1/collections/warehouses/indexes
POST /api/v1/collections/warehouses/indexes { "field": "capacity" }
DELETE /api/v1/collections/warehouses/indexes/capacityList, read, update, delete
GET /api/v1/collections → { usage, collections } (points, storage, limits)
GET /api/v1/collections/warehouses → schema, point count, storage
PATCH /api/v1/collections/warehouses { "title": "…", "description": "…" }
DELETE /api/v1/collections/warehouses → deletes its points and indexes too