API Reference

Complete reference for all SoapBox API endpoints.

Base URL

https://api.soapboxsuperapp.com/api/v1

Common Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerItems per page (default: 20, max: 100)

Churches

Access church and community data

GET
/churches

List all churches

Scope: read:churches
GET
/churches/:id

Get church details

Scope: read:churches
GET
/churches/:id/members/count

Get member count

Scope: read:churches

Events

Manage church events and registrations

GET
/events

List events

Scope: read:events
GET
/events/:id

Get event details

Scope: read:events
GET
/events/upcoming

Get upcoming events

Scope: read:events
POST
/events/:id/register

Register for event

Scope: write:events
DELETE
/events/:id/register

Unregister from event

Scope: write:events

Users

Access user profiles and memberships

GET
/users/:id

Get user profile

Scope: read:users
GET
/users/me

Get current user

Scope: read:users
GET
/users/:id/churches

Get user's churches

Scope: read:users

Prayers

Prayer request management

GET
/prayers

List prayer requests

Scope: read:prayers
GET
/prayers/:id

Get prayer details

Scope: read:prayers
POST
/prayers

Create prayer request

Scope: write:prayers
POST
/prayers/:id/pray

Record a prayer

Scope: write:prayers
POST
/prayers/:id/answered

Mark as answered

Scope: write:prayers

Donations

Access donation records (requires special approval)

GET
/donations

List donations

Scope: read:donations
GET
/donations/:id

Get donation details

Scope: read:donations
GET
/donations/summary

Get donation summary

Scope: read:donations

Groups

Small group management

GET
/groups

List small groups

Scope: read:groups
GET
/groups/:id

Get group details

Scope: read:groups
GET
/groups/:id/members

Get group members

Scope: read:groups
POST
/groups/:id/join

Join a group

Scope: write:groups
DELETE
/groups/:id/leave

Leave a group

Scope: write:groups

Example: List Churches

Request

curl https://api.soapboxsuperapp.com/api/v1/churches \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": [
    {
      "id": 1,
      "name": "First Baptist Church",
      "description": "A welcoming community...",
      "city": "Dallas",
      "state": "TX",
      "country": "USA",
      "website": "https://firstbaptist.org",
      "memberCount": 1500,
      "createdAt": "2024-01-15T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "hasMore": true
  }
}

Example: Create Prayer Request

Request

curl -X POST https://api.soapboxsuperapp.com/api/v1/prayers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "communityId": 123,
    "content": "Please pray for my family during this difficult time.",
    "isAnonymous": false
  }'

Response

{
  "data": {
    "id": 456,
    "communityId": 123,
    "userId": 789,
    "content": "Please pray for my family during this difficult time.",
    "isAnonymous": false,
    "isAnswered": false,
    "prayerCount": 0,
    "createdAt": "2024-03-10T15:30:00Z"
  }
}

Error Handling

All errors follow a consistent format:

{
  "error": "NotFound",
  "message": "Church with ID 999 not found",
  "statusCode": 404
}
Status CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing credentials
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error