Connect your app to HumblEarn

This page is for people who want their own website or app to work with HumblEarn. After you are approved, your app can create tasks, see how those tasks are doing, and receive updates when workers send submissions.

How it works: Ask for access, wait for an administrator to approve you, and then copy the one connection key that HumblEarn creates for you. You do not need to create a key yourself.

Get started

You can read everything on this page without an account. When you are ready, log in or create a HumblEarn account to ask for developer access.

Log in to request access

What developers can do

CapabilityEndpointPurpose
Create tasksPOST resource=tasksCreate a task using the developer wallet. The task enters the existing admin approval process.
List tasksGET resource=tasksList only tasks created by the authenticated developer.
Task detailsGET resource=task&id=IDRead the full details of one owned task.
Task statusGET resource=task_status&id=IDRead approval state, completed slots, pending submissions, and remaining slots.
Submission statusGET resource=submissions&task_id=IDRead statuses for submissions on an owned task.
WebhooksPOST/DELETE resource=webhooksRegister an HTTPS endpoint for signed submission status events.
Cancel taskPOST resource=cancel_task&id=IDCancel an eligible task with no completed or pending submissions and receive the unused amount back.

How your app connects

Your app sends the connection key in the request header shown below. Keep this key private. Store it on your server, not inside public browser code.

Authorization: Bearer PUBLIC_KEY.SECRET Content-Type: application/json

One developer account has one connection key. It is limited to 60 requests per minute and only works with tasks created by that developer.

Create a task

POST https://humblearn.com.ng/api/v1/index.php?resource=tasks Authorization: Bearer PUBLIC_KEY.SECRET Content-Type: application/json { "title": "Visit our website", "description": "Open the link and complete the instructions.", "proof_instructions": "Submit the required proof.", "platform": "Website", "task_type": "Visit", "category": "micro_job", "task_link": "https://example.com", "employer_unit_price": 50, "earner_unit_reward": 40, "total_slots": 10 }

The wallet charge is employer_unit_price × total_slots. The developer reward cannot exceed the employer unit price.

Sample code

cURL

curl -X POST "https://humblearn.com.ng/api/v1/index.php?resource=tasks" \ -H "Authorization: Bearer PUBLIC_KEY.SECRET" \ -H "Content-Type: application/json" \ -d '{"title":"Visit our website","description":"Follow the instructions","platform":"Website","task_type":"Visit","category":"micro_job","task_link":"https://example.com","employer_unit_price":50,"earner_unit_reward":40,"total_slots":10}'

PHP

$ch = curl_init('https://humblearn.com.ng/api/v1/index.php?resource=tasks'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('HUMBLEARN_API_KEY'), 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode(['title' => 'Visit our website', 'task_link' => 'https://example.com', 'employer_unit_price' => 50, 'earner_unit_reward' => 40, 'total_slots' => 10]) ]); $response = curl_exec($ch);

JavaScript

const response = await fetch('https://humblearn.com.ng/api/v1/index.php?resource=tasks', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.HUMBLEARN_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ title: 'Visit our website', task_link: 'https://example.com', employer_unit_price: 50, earner_unit_reward: 40, total_slots: 10 }) }); const result = await response.json();

Python

import os, requests response = requests.post( 'https://humblearn.com.ng/api/v1/index.php?resource=tasks', headers={'Authorization': f"Bearer {os.environ['HUMBLEARN_API_KEY']}"}, json={'title': 'Visit our website', 'task_link': 'https://example.com', 'employer_unit_price': 50, 'earner_unit_reward': 40, 'total_slots': 10} ) print(response.json())

Submission webhooks

Register an HTTPS endpoint through the API. When a submission is approved or rejected, HumblEarn sends a JSON event with type: submission.status_changed.

POST https://humblearn.com.ng/api/v1/index.php?resource=webhooks Authorization: Bearer PUBLIC_KEY.SECRET {"endpoint_url":"https://your-app.example/webhooks/humblearn"} Verify: X-HumblEarn-Signature = sha256=HMAC_SHA256(raw_request_body, webhook_secret)

API base URL

https://humblearn.com.ng/api/v1/index.php

Run the developer API database migration before requesting access. Configure HUMBLEARN_API_ENCRYPTION_KEY as a durable production secret for webhook encryption.