Docs · Collections & schema

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" }
    ]
  }'
ParameterTypeDescription
namestringAPI name: 2–40 lowercase letters, digits, underscores; unique in your account.
titlestringDisplay name.
descriptionstringOptional.
fieldslistOptional; you can add fields later.

Fields

ParameterTypeDescription
namestringLowercase letters, digits, underscores. Not id, title, location or other built-ins.
typestring | number | boolean | dateDates are ISO 8601 (2026-10-27 or with time) and stored in one format, so they compare correctly.
requiredbooleanEvery point must have it. Only on an empty collection, or when adding the first points.
enumlistAllowed values (string or number fields).
indexedbooleanCreates 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 point

Indexes

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/capacity

List, 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