Skip to content
ParanormalInvestigators.org badge

Developers

iOS companion app & sync API

Everything the ParanormalInvestigators iOS app uses to sign in, pick a case file, and push geotagged field evidence straight into the team's private case.

Connection

API base: https://www.paranormalinvestigators.org/api/v1

Supabase URL: https://xrnoriyvsontanhxepde.supabase.co

Auth: send Authorization: Bearer <access_token>. Tokens from POST /api/v1/auth/token and from supabase-swift sign-in are interchangeable. Row Level Security limits every request to the signed-in investigator's own teams.

Field upload flow

  1. POST /auth/token → store access_token + refresh_token in the Keychain.
  2. GET /sync/teams, then GET /sync/cases?team_id=… or POST /sync/cases to start one.
  3. For each capture: POST /sync/cases/{id}/upload-url with the filename → PUT the bytes to signed_url with the returned headers.
  4. POST /sync/cases/{id}/evidence with client_id, kind, storage_path, captured_at, lat/lng, device_info, optional sensor_data. Batch up to 100 with { items: [...] }.
  5. Evidence always arrives Private (Team Only). The team reviews it on the web and flips individual items to Public.
  6. Keep the app current with GET /sync/changes?since=<server_time>, or subscribe to Supabase Realtime on evidence_items.
curl -X POST https://www.paranormalinvestigators.org/api/v1/sync/cases/$CASE/evidence \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"client_id":"8F1C…","kind":"evp","title":"Basement EVP 3:12 AM",
       "storage_path":"<from upload-url>","mime_type":"audio/m4a",
       "captured_at":"2026-12-02T09:12:00Z","lat":36.86,"lng":-94.37,
       "device_info":{"model":"iPhone 17 Pro","app":"1.0"}}'

Endpoints

  • GET/api/v1/healthService health check
  • POST/api/v1/auth/tokenEmail + password → access & refresh tokens
  • POST/api/v1/auth/refreshExchange refresh_token for a new access token
  • GET/api/v1/meauthCurrent user, profile and team memberships
  • GET/api/v1/sync/teamsauthTeams the user belongs to
  • GET/api/v1/sync/casesauthList case files (?team_id, ?status)
  • POST/api/v1/sync/casesauthCreate a case file
  • GET/api/v1/sync/cases/{id}authCase file with all evidence (signed media URLs, 1h)
  • PATCH/api/v1/sync/cases/{id}authUpdate title, summary, status, location
  • POST/api/v1/sync/cases/{id}/upload-urlauthGet a signed URL to PUT a media file
  • POST/api/v1/sync/cases/{id}/evidenceauthCreate evidence (single or batch, idempotent by client_id, always Private)
  • GET/api/v1/sync/cases/{id}/evidenceauthList evidence (?since=ISO for deltas)
  • PATCH/api/v1/sync/evidence/{id}authUpdate title, notes or visibility
  • DELETE/api/v1/sync/evidence/{id}authDelete evidence (uploader or team lead)
  • GET/api/v1/sync/changesauthDelta sync of cases + evidence (?since=ISO)