TaskiKids API Documentation
REST API for creating and retrieving tasks and rewards programmatically, powered by Supabase Edge Functions.
Base URL
https://tsspmgbvivrldppxlnkg.supabase.co/functions/v1
Authentication
All endpoints require a Supabase JWT token. Include it in the Authorization header:
Authorization: Bearer <your-access-token>
Copy your token from Settings → API Access in the app.
Create Task
POST /create-task
Creates a new task for a family.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
familyId | UUID | Yes | The family ID to create the task for |
name | string | Yes | Task name (max 100 characters) |
description | string | No | Task description (max 500 characters) |
points | number | Yes | Points awarded/deducted (-1000 to 1000, cannot be 0) |
category | string | Yes | Task category (see valid values below) |
priority | string | No | low, medium (default), or high |
deadline | string | No | ISO 8601 date (e.g. 2026-12-31T23:59:59Z) |
autoApprove | boolean | No | Auto-approve when the kid marks it done (default true) |
recurrence | string | No | none (default), daily, weekly, monthly |
recurrenceDays | array | No | For weekly recurrence only: weekdays the task is available (0=Sunday, 1=Monday, ..., 6=Saturday). Empty/omitted = every day. |
assignedKidIds | array | No | Array of kid UUIDs to assign the task to |
Valid Categories
chores— Household choreshomework— School-related taskshealth— Health and hygienecreativity— Creative activitieskindness— Acts of kindnesspraying— Daily prayers (Fajr, Dhuhr, Asr, Maghrib, Isha)religion— Religious activities (Quran reading, Islamic studies, etc.)sports— Physical activitiesother— Miscellaneous
Example
curl -X POST \
'https://tsspmgbvivrldppxlnkg.supabase.co/functions/v1/create-task' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"familyId": "your-family-id",
"name": "Make your bed",
"points": 10,
"category": "chores",
"recurrence": "daily",
"assignedKidIds": ["your-kid-id"]
}'
Success Response (201 Created)
{
"success": true,
"task": {
"id": "...",
"familyId": "your-family-id",
"name": "Make your bed",
"points": 10,
"category": "chores",
"recurrence": "daily",
"autoApprove": true,
"assignedKidIds": ["your-kid-id"],
"isActive": true
}
}
Retrieve Tasks
GET /get-tasks?kidId=<uuid>
Retrieves all active tasks configured for a specific kid, including their current assignment status.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
kidId | UUID | Yes | The kid ID to retrieve tasks for (must belong to your family). This is the Kid ID shown in the app under Settings → API Access — the same value assignedKidIds takes on Create Task. |
Example
curl -X GET \
'https://tsspmgbvivrldppxlnkg.supabase.co/functions/v1/get-tasks?kidId=your-kid-id' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Success Response (200 OK)
{
"success": true,
"kidId": "your-kid-id",
"tasks": [
{
"id": "...",
"name": "Make your bed",
"description": "Make your bed neatly every morning",
"points": 10,
"category": "chores",
"priority": "medium",
"deadline": null,
"autoApprove": true,
"recurrence": "daily",
"recurrenceDays": null,
"isPaused": false,
"isActive": true,
"assignmentStatus": "pending",
"assignmentDueDate": null
},
{
"id": "...",
"name": "Soccer practice",
"description": null,
"points": 20,
"category": "sports",
"priority": "high",
"deadline": null,
"autoApprove": false,
"recurrence": "weekly",
"recurrenceDays": [1, 3, 5],
"isPaused": false,
"isActive": true,
"assignmentStatus": "submitted",
"assignmentDueDate": null
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | UUID | Task ID |
name | string | Task name |
description | string | Task description (null if not set) |
points | number | Points awarded for completion |
category | string | Task category |
priority | string | low, medium, or high |
deadline | string | ISO 8601 date (null if not set) |
autoApprove | boolean | Whether submissions are auto-approved |
recurrence | string | none, daily, weekly, or monthly |
recurrenceDays | array | Weekdays for weekly tasks (0=Sun..6=Sat), null otherwise |
isPaused | boolean | Whether the task is paused |
isActive | boolean | Whether the task is active (always true in results) |
assignmentStatus | string | Current status: pending, submitted, approved, rejected, or expired |
assignmentDueDate | string | Due date for this specific assignment (null if not set) |
Note: Only active tasks (is_active = true) are returned. Deleted tasks are excluded. Paused tasks are included but flagged with isPaused: true.
One entry per task. A recurring task has a separate assignment record for every occurrence, but it is returned only once here — assignmentStatus and assignmentDueDate describe its most recent occurrence, so this endpoint answers "what tasks does this kid have, and where does each stand right now?" rather than returning a full history.
Create Reward
POST /create-reward
Creates a new reward for a family's reward shop.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
familyId | UUID | Yes | The family ID to create the reward for |
name | string | Yes | Reward name (max 100 characters) |
description | string | No | Reward description (max 500 characters) |
pointCost | number | Yes | Points required to redeem (must be > 0) |
category | string | Yes | Reward category (see valid values below) |
requiresApproval | boolean | No | Parent must approve redemption (default true) |
imageUrl | string | No | URL to a reward image |
Valid Categories
screen_time— Screen time rewards (TV, games, etc.)money— Monetary rewardstrips— Outings and tripstreats— Food treats and snacksprivileges— Special privilegescustom— Custom rewards
Example
curl -X POST \
'https://tsspmgbvivrldppxlnkg.supabase.co/functions/v1/create-reward' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"familyId": "your-family-id",
"name": "30 minutes of video games",
"pointCost": 50,
"category": "screen_time",
"requiresApproval": false
}'
Error Responses
| Status | Description |
|---|---|
| 400 | Bad Request — missing or invalid fields |
| 401 | Unauthorized — missing or invalid token |
| 403 | Forbidden — you cannot create items for this family |
| 404 | Not Found — user profile not found |
| 405 | Method Not Allowed — only POST is supported |
| 500 | Internal Server Error |
All errors follow this format:
{
"error": "Error message describing what went wrong",
"details": "Additional details (optional)"
}
Code Examples
JavaScript / TypeScript
import { createClient } from '@supabase/supabase-js';
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
async function createTask(taskData) {
const { data: { session } } = await supabase.auth.getSession();
const response = await fetch(
`${SUPABASE_URL}/functions/v1/create-task`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${session?.access_token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(taskData),
}
);
return response.json();
}
Python
import requests
SUPABASE_URL = "https://tsspmgbvivrldppxlnkg.supabase.co"
def create_task(access_token, task_data):
response = requests.post(
f"{SUPABASE_URL}/functions/v1/create-task",
headers={
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
},
json=task_data,
)
return response.json()
Rate Limiting
The API uses Supabase's default rate limiting. For high-volume usage, consider implementing client-side throttling.
Support
For issues or questions about the API, email support@taski.kids.
← Back to TaskiKids