API Reference
Programmatic access to iPetition petitions, signatures, and analytics.
Authentication
Bearer token via API key. Create keys in your dashboard.
Rate limits
60 requests/minute per key (default). Returns 429 with Retry-After header.
Base URL
https://xdvazlxpuculyktqdjjc.supabase.co/functions/v1/api-v1
Quick start
curl -H "Authorization: Bearer ipk_your_api_key" \
"https://xdvazlxpuculyktqdjjc.supabase.co/functions/v1/api-v1/v1/petitions?status=active&per_page=5"All responses follow a JSON:API-subset format with data and meta (total, page, perPage, hasMore).
Endpoints
/v1/petitionspetitions:readList petitions with optional geo, category, and status filters. Returns paginated results.
Query parameters
geo_iduuidFilter by geographic areainclude_childrenbooleanInclude child geo locationscategory_iduuidFilter by categorystatusstringactive, victory, or closed (default: active)sortstringrecent, popular, or trending (default: recent)pageintegerPage number (default: 1)per_pageintegerItems per page, max 100 (default: 20)/v1/petitions/:slugpetitions:readGet a single petition by its URL slug. Returns full petition detail with geo and escalation data.
/v1/petitionspetitions:writeCreate a new petition in draft status. Requires title (10-150 chars), description (50+ chars), categoryId, and geoId.
/v1/petitions/:id/signaturessignatures:readList public signatures for a petition. Paginated, sorted by most recent.
Query parameters
pageintegerPage number (default: 1)per_pageintegerItems per page, max 100 (default: 20)/v1/petitions/:id/analyticsanalytics:readGet analytics summary for a petition including views, shares, and signature growth.
Available scopes
petitions:readList and view petitionspetitions:writeCreate new petitionssignatures:readList public signaturesanalytics:readAccess petition analyticsError codes
401Invalid or missing API key403Insufficient scope for this endpoint404Resource not found422Validation error (check request body)429Rate limit exceeded (check Retry-After header)