REST /api/v1/search/offline 7 endpoints
GET /api/v1/search/offline/api/v1/search/offline

List all offline search query records stored locally

Public

Response Example

{
  "data": [
    {
      "id": "oq_00000055",
      "query": "hansen",
      "status": "completed",
      "contact_hits": 3,
      "note_hits": 1,
      "executed_at": "2026-03-26T07:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1
  }
}
GET /api/v1/search/offline/api/v1/search/offline/:id

Retrieve a specific offline search result

Public

Response Example

{
  "id": "oq_00000055",
  "query": "hansen",
  "contacts": [
    {
      "id": "cnt_00000045",
      "name": "Lena Hansen",
      "email": "l.hansen@nordtech.no",
      "phone": "+47 412 33 221",
      "org_name": "Nordtech AS",
      "created_at": "2025-07-19T06:00:00Z"
    }
  ],
  "notes": [
    {
      "id": "note_00000300",
      "contact_id": "cnt_00000045",
      "content": "Hansen requested demo of analytics module.",
      "author_name": "Marius Dahl",
      "created_at": "2026-03-10T10:00:00Z"
    }
  ],
  "executed_at": "2026-03-26T07:30:00Z"
}
POST /api/v1/search/offline/api/v1/search/offline

Execute a full-text search against the local offline cache

Public

Request Example

{
  "query": "hansen",
  "scope": [
    "contacts",
    "notes"
  ]
}

Response Example

{
  "id": "oq_00000056",
  "query": "hansen",
  "scope": [
    "contacts",
    "notes"
  ],
  "contacts": [
    {
      "id": "cnt_00000045",
      "name": "Lena Hansen",
      "email": "l.hansen@nordtech.no",
      "phone": "+47 412 33 221",
      "org_name": "Nordtech AS",
      "created_at": "2025-07-19T06:00:00Z"
    }
  ],
  "notes": [],
  "status": "completed",
  "executed_at": "2026-03-26T09:25:00Z"
}
PUT /api/v1/search/offline/api/v1/search/offline/:id

Re-run an offline search with updated scope

Public

Request Example

{
  "scope": [
    "contacts"
  ]
}

Response Example

{
  "id": "oq_00000056",
  "query": "hansen",
  "scope": [
    "contacts"
  ],
  "status": "completed",
  "updated_at": "2026-03-26T09:27:00Z"
}
DELETE /api/v1/search/offline/api/v1/search/offline/:id

Remove an offline search record from local history

Public

Response Example

{
  "id": "oq_00000056",
  "deleted": true
}
GET /api/v1/search/offline/api/v1/search/offline/cache/freshness

Return the last time the offline cache was refreshed

Public

Response Example

{
  "last_synced_at": "2026-03-26T06:00:00Z",
  "age_minutes": 205,
  "is_stale": false,
  "stale_threshold_minutes": 480
}
GET /api/v1/search/offline/api/v1/search/offline/cache/status

Check whether a usable offline cache exists for the device

Public

Response Example

{
  "cache_available": true,
  "contact_count": 1420,
  "note_count": 3871,
  "last_synced_at": "2026-03-26T06:00:00Z"
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}