# API Reference Overview

The Exit WeWeb Portal API is a RESTful API built on Supabase that provides comprehensive building inspection management capabilities.

# Base URL

https://edknwrcztqwhskjpoxta.supabase.co/rest/v1

# Authentication

All API requests require authentication headers:

apikey: YOUR_ANON_KEY
Authorization: Bearer YOUR_ACCESS_TOKEN

# Request Format

  • All POST/PATCH requests should use Content-Type: application/json
  • Query parameters for filtering: ?column=eq.value
  • Ordering: ?order=column.desc
  • Limiting: ?limit=10&offset=0
  • Selecting specific columns: ?select=id,name,created_at

# Response Format

Responses are returned in JSON format:

[
  {
    "id": 1,
    "created_at": "2025-01-22T10:00:00Z",
    "field": "value"
  }
]

# Error Handling

Errors follow the standard HTTP status codes:

  • 200 OK - Successful request
  • 201 Created - Resource created successfully
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Missing or invalid authentication
  • 403 Forbidden - Insufficient permissions (RLS policy violation)
  • 404 Not Found - Resource not found
  • 409 Conflict - Duplicate resource or constraint violation

# Common Headers

apikey: YOUR_ANON_KEY
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Prefer: return=representation

# Pagination

Use limit and offset parameters:

GET /users?limit=20&offset=40

Or use the Range header:

Range: 0-9

# Filtering

PostgREST operators for filtering:

  • eq - equals
  • neq - not equals
  • gt - greater than
  • gte - greater than or equal
  • lt - less than
  • lte - less than or equal
  • like - LIKE operator (use * for wildcard)
  • ilike - case-insensitive LIKE
  • in - one of a list of values
  • is - IS operator (for null checks)

Example:

GET /buildings?client_id=eq.123&city=ilike.*York*