Developer API

Integrate your applications with the RegenImpactHub ecosystem. Our open API allows you to submit actions and retrieve verified impact data.

POST
/api/submit
Submits a new regenerative action to the platform. The action will be created with the status `submitted`, awaiting AI pre-check and human validation. This endpoint triggers the asynchronous AI verification.

Authentication

Requests must include an `Authorization: Bearer <FirebaseIdToken>` header. The Firebase ID token should be generated on the client-side after user login.

Request Body

ParameterTypeRequiredDescription
titlestringYesA concise title for the regenerative action.
descriptionstringYesA detailed description of the action performed.
orgIdstringYesThe ID of the organization submitting the action.
projectIdstringYesThe ID of the project this action belongs to.
categorystringNoCategory of the action (e.g., "Agroforestry").
locationstringNoLocation where the action took place (e.g., "Recife, Brazil").
mediaUrlsarrayNoAn array of strings, where each string is a URL to a piece of evidence (image, video, document, etc.).

Example Usage (cURL)

curl -X POST https://your-regenimpacthub-url.com/api/submit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_FIREBASE_ID_TOKEN>" \
  -d '{
    "orgId": "org_12345",
    "projectId": "proj_67890",
    "title": "Cleanup Drive at Boa Viagem Beach",
    "description": "We organized a group of 30 volunteers and removed over 100kg of trash from the sand and sea at Boa Viagem beach, Recife.",
    "category": "Waste Management",
    "location": "Recife, PE, Brazil",
    "mediaUrls": [
      "https://example.com/cleanup-photo.jpg"
    ]
  }'

Success Response (200)

{
  "success": true,
  "actionId": "aBcDeFgHiJkLmNoPqRsT"
}
GET
/api/org/[slug]
Retrieves the public profile of an organization and a list of all its verified actions (`status: "verified"`).

URL Parameters

Replace `[slug]` with the organization's unique slug (e.g., `/api/org/coletivo-mulungu`).

Example Usage (JavaScript Fetch)

fetch('https://your-regenimpacthub-url.com/api/org/regensampa-coletivo')
  .then(response => response.json())
  .then(data => {
    console.log('Organization:', data.organization);
    console.log('Verified Actions:', data.actions);
    // Render the profile and actions in your UI
  });

Example Response (200)

{
  "organization": {
    "id": "org_12345",
    "name": "RegenSampa Coletivo",
    "slug": "regensampa-coletivo",
    "bio": "A collective focused on regenerating urban spaces in São Paulo.",
    "isVerified": true,
    "createdAt": { "_seconds": 1729353000, "_nanoseconds": 0 }
  },
  "actions": [
    {
      "id": "actionId1",
      "orgId": "org_12345",
      "projectId": "projId_456",
      "title": "Community Garden in Vila Madalena",
      "description": "Started a community garden with 15 local families.",
      "status": "verified",
      "validationScore": 85,
      "isPublic": true,
      "createdAt": { "_seconds": 1729353921, "_nanoseconds": 123000000 },
      "validatedAt": { "_seconds": 1729353950, "_nanoseconds": 456000000 }
    }
  ]
}
LEAP APIs
/api/leap/...
Endpoints to manage the LEAP assessment module for SMEs (Small and Medium-sized Enterprises).

The platform uses a series of endpoints to conduct the LEAP assessment (Locate, Evaluate, Assess, Prepare). Currently, they are used internally by the application wizard, but they are documented here for future B2B integrations.

  • POST /api/leap/start: Initiates a new assessment for the authenticated user's organization. Returns an `assessmentId`.
  • POST /api/leap/assessment/[assessmentId]/l: Saves the data for the "Locate" step.
  • POST /api/leap/assessment/[assessmentId]/e: Saves the data for the "Evaluate" step.
  • POST /api/leap/assessment/[assessmentId]/a: Saves the data for the "Assess" step.
  • POST /api/leap/assessment/[assessmentId]/p: Saves the data for the "Prepare" step and finalizes the assessment.

All requests to these endpoints require authentication via `FirebaseIdToken`.