Skip to content

API Reference

The Child Credit API lets you manage internet access credits for child profiles programmatically. This is useful for building automations — for example, granting internet time when chores are completed or integrating with a rewards system.

Authentication

Creating an API Key

  1. Log in to your QuietNet dashboard
  2. Navigate to API Keys
  3. Create a new key with the child_credit:add scope
  4. Set an expiration date
  5. Copy the token — it will only be shown once

Using the API Key

Include your API key in the Authorization header of each request:

Authorization: <your-api-key-token>

Bearer prefix is optional

Both Authorization: mytoken123 and Authorization: Bearer mytoken123 are accepted.

Endpoints

Add Credit Hours

Adds internet access time to a child profile.

POST /api/v1/child_credit/add

Request body:

{
  "profile_id": 1,
  "hours": 2.5
}
Field Type Required Description
profile_id integer Yes ID of the child profile
hours number Yes Hours to add (must be greater than 0)

Success response (200):

{
  "success": true,
  "profile_id": 1,
  "new_allowed_until": "2026-03-03T15:30:00Z",
  "remaining_minutes": 150
}

Example with curl:

curl -X POST https://app.quietnet.app/api/v1/child_credit/add \
  -H "Authorization: your-api-key-token" \
  -H "Content-Type: application/json" \
  -d '{"profile_id": 1, "hours": 2.5}'

Check Credit Status

Returns the current Child Mode and credit status for a profile.

GET /api/v1/child_credit/status?profile_id=<id>
Parameter Type Required Description
profile_id string Yes Profile ID or "default" for the Default Profile

Success response (200):

{
  "child_mode": true,
  "child_credit_enabled": true,
  "access_blocked": false,
  "allowed_until": "2026-03-03T15:30:00Z",
  "remaining_minutes": 90,
  "remaining_hours": 1.5
}

Authentication

The status endpoint uses session authentication (not API keys). It is used by the dashboard and mobile app.

Error Codes

Status Meaning Example Message
400 Missing or invalid parameters "Hours is required and must be positive"
401 Invalid, expired, or revoked API key "Unauthorized"
403 Child Mode not enabled on the profile "Cannot add credit: Child mode is not enabled"
404 Profile not found or doesn't belong to you "Profile not found"
422 Could not save the credit "Failed to add child credit"

Credit Stacking Rules

  • If the profile has no active credits, the new time starts from now
  • If credits are already active, the new hours are added to the existing time
  • The total is capped at 24 hours from the current time

Full API Specification

The complete API specification for all QuietNet endpoints is available below, including profile management, Child Credit, and mobile app endpoints.