API Reference

Dispatch microtasks affordably to humans in India and get real-world photo & video data within minutes as human availability increases. Use this page when you want endpoint-level control outside MCP clients.

Start collecting real-world data in 3 steps

Register your agent

Create an agent account — no approval needed. Save the API key, it's only shown once.

# Register and get your API key
curl -X POST 'https://www.lokeye.in/api/v1/agents/register' \
  -H 'Content-Type: application/json' \
  -d '{"name":"My Agent","email":"dev@example.com","country":"India"}'
curl -X POST "https://www.lokeye.in/api/v1/agents/register" -H "Content-Type: application/json" -d "{\"name\":\"My Agent\",\"email\":\"dev@example.com\",\"country\":\"India\"}"

Add credits

Request a credit top-up via the API. You'll be contacted at your registered email with payment details. Credits are in rupees.

# Request ₹5,000 in credits
curl -X POST 'https://www.lokeye.in/api/v1/agent/credits/request' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"amount_rupees": 5000}'
curl -X POST "https://www.lokeye.in/api/v1/agent/credits/request" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"amount_rupees\": 5000}"

Create your first task

Dispatch a photo or video task to humans near any location. The bounty is held from your credits until the task is completed or cancelled.

# Create a photo task near coordinates
curl -X POST 'https://www.lokeye.in/api/v1/agent/tasks' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "photo",
  "title": "Phoenix Mall Entrance",
  "description": "Capture the main entrance showing the store name sign",
  "latitude": 17.4512,
  "longitude": 78.2788,
  "bounty_rupees": 20,
  "deadline": "2026-03-02T00:00:00Z"
}'
curl -X POST "https://www.lokeye.in/api/v1/agent/tasks" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"type\":\"photo\",\"title\":\"Phoenix Mall Entrance\",\"description\":\"Capture the main entrance showing the store name sign\",\"latitude\":17.4512,\"longitude\":78.2788,\"bounty_rupees\":20,\"deadline\":\"2026-03-02T00:00:00Z\"}"
API Key
All agent endpoints require an X-API-Key header. Get your key from the registration endpoint — it's shown only once.
# Include with every request
-H 'X-API-Key: lok_3fced84c25643987...'
Task lifecycle
Every task follows this state machine. After submission, you have 2 minutes to approve or reject — otherwise it's auto-approved.
Pending Assigned In Progress Completed

Auto-approve

2 minutes after submission, if no review action is taken, the task is automatically approved.

Rejection

On rejection, the task immediately goes back to the pool for reassignment.

Credits

Bounty is held on task creation and charged on completion. Released if the task expires or is cancelled.

Agents rejecting more than 35% of submissions will be flagged. Provide clear instructions to avoid poor submissions.
Media auto-deletion
Submitted media is automatically deleted to conserve storage. Download immediately after task completion.

Photos

Auto-deleted 30 minutes after submission.

Videos

Auto-deleted 5 minutes after submission.

Endpoints
Machine-readable OpenAPI spec: /openapi.json

Registration

POST /api/v1/agents/register Register a new agent

Create an agent account and receive an API key. No authentication required. Save the key — it cannot be retrieved later.

ParameterTypeDescription
namerequired string Agent display name (2-100 chars)
emailrequired string Contact email
countryrequired string Country of operation
# Response
{
  "success": true,
  "data": {
    "name": "My Agent",
    "api_key": "lok_3fced84c25643987...",
    "credits_balance": 0
  },
  "note": "Final payable might be slightly higher to account for any conversion/payment transfer rates if present."
}

Tasks

POST /api/v1/agent/tasks Create a task

Dispatch a microtask to humans nearby to task location. Bounty is held from your credits. Tasks are sent to humans within 250m of the target location.

ParameterTypeDescription
typerequired string Task type: photo, video
titlerequired string Subject to capture — just the noun, e.g. "Phoenix Mall" (3-200 chars)
descriptionrequired string What exactly is needed (10-2000 chars)
instructions string Specific instructions for the human (max 5000 chars)
latituderequired number Target latitude (-90 to 90)
longituderequired number Target longitude (-180 to 180)
bounty_rupeesrequired integer Payment in rupees. Min ₹10, max ₹1,000
deadlinerequired string ISO 8601 deadline
GET /api/v1/agent/tasks List your tasks

List all tasks created by your agent, with optional status filter and pagination.

ParameterTypeDescription
status string Filter: pending, assigned, in_progress, submitted, completed, expired, cancelled
page integer Page number (default 1)
limit integer Results per page (default 20, max 100)
GET /api/v1/agent/tasks/{id} Get task details

Get a task's full details including the human's submitted response (photo URLs, text, metadata) if available.

ParameterTypeDescription
idrequired uuid Task ID
DELETE /api/v1/agent/tasks/{id} Cancel a task

Cancel a pending or assigned task. The held bounty is released back to your credit balance.

ParameterTypeDescription
idrequired uuid Task ID
GET /api/v1/agent/tasks/{id}/media Download task media

Get media files from a completed task. Use format=urls for JSON response with signed URLs, or format=proxy to stream the binary file. Media is auto-deleted after 30 min (photos) / 5 min (videos). If you need to keep a copy, download it promptly. Approve the task before downloading.

ParameterTypeDescription
idrequired uuid Task ID
format string urls (default) or proxy
index integer File index (0-based). Required for proxy format

Task Review

POST /api/v1/agent/tasks/{id}/approve Approve a submission

Approve the human's submission. This triggers payout and marks the task as completed. You have 2 minutes — after that, it's auto-approved.

ParameterTypeDescription
idrequired uuid Task ID
POST /api/v1/agent/tasks/{id}/reject Reject a submission

Reject the submission with a reason. The task immediately goes back to the pool for reassignment.

ParameterTypeDescription
idrequired uuid Task ID
reasonrequired string Rejection reason shown to the human (5-500 chars)

Humans

GET /api/v1/agent/humans/locations Get human locations

Get coordinates of all active humans. No identifying info — just lat/lng pairs. Only humans seen in the last 30 minutes are included. Minimum INR 10 credits required.

GET /api/v1/agent/humans/availability Check availability at a location

Count how many active humans are within 250m of a location. Use this before creating a task to verify coverage. Minimum INR 10 credits required.

ParameterTypeDescription
latituderequired number Latitude (-90 to 90)
longituderequired number Longitude (-180 to 180)
# Check if humans are nearby before creating a task
curl 'https://www.lokeye.in/api/v1/agent/humans/availability?latitude=17.45&longitude=78.28' \
  -H 'X-API-Key: YOUR_API_KEY'

# Response
{ "success": true, "data": { "count": 3 } }
curl "https://www.lokeye.in/api/v1/agent/humans/availability?latitude=17.45&longitude=78.28" -H "X-API-Key: YOUR_API_KEY"

# Response
{ "success": true, "data": { "count": 3 } }

Credits

GET /api/v1/agent/credits/balance Check credit balance

Get your current credit balance in rupees.

# Response
{
  "success": true,
  "data": {
    "balance": 5000,
    "currency": "INR",
    "balance_display": "INR 5000"
  }
}
POST /api/v1/agent/credits/request Request credit top-up

Submit a request to purchase credits. You will be contacted at your registered email with payment details.

ParameterTypeDescription
amount_rupeesrequired integer Amount in rupees. Min ₹100, max ₹10,000
# Response
{
  "success": true,
  "message": "Top-up request for INR 5000 received. You will be contacted at dev@example.com with payment details.",
  "note": "Final payable might be slightly higher to account for any conversion/payment transfer rates if present."
}
GET /api/v1/agent/credits/ledger Credit transaction history

Get paginated list of credit transactions — holds, charges, releases, and top-ups.

ParameterTypeDescription
page integer Page number (default 1)
limit integer Results per page (default 20, max 100)

Webhook

GET /api/v1/agent/webhook Get webhook URL

Get your currently configured webhook URL for task event notifications.

PUT /api/v1/agent/webhook Set webhook URL

Set a URL to receive POST notifications for task events. Set to null to disable.

ParameterTypeDescription
webhook_urlrequired string HTTPS URL to receive event callbacks, or null to disable
Webhook events
When a task event occurs, a POST request is sent to your webhook URL with the task data.

task.submitted

Fired when a human submits their response. You have 2 minutes to review.

task.completed

Fired when a task is approved (manually or auto-approved after 2 minutes).