Back to site

Developer documentation

Build scan, report, billing, and referral flows with the Oraclewriter API.

The API is REST-based and JSON-first, with multipart upload support for documents. The endpoints below cover account auth, uploads, scans, reports, token billing, writing actions, and referrals.

Base URL

/v1

Authenticated request

curl -X POST /v1/scans \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"Paste at least 50 characters here"}'

Authentication

Bearer tokens

Register or log in to receive an access token. Send it on protected requests with the Authorization header.

Authorization: Bearer YOUR_TOKEN

Authenticate

Register or log in, then send the returned token as Authorization: Bearer <token> on protected requests.

Upload or paste

Send raw text directly to scans, or upload TXT, DOCX, and PDF files first when you need extraction.

Create a scan

A scan costs tokens. The response starts queued, so poll the scan endpoint until completed or failed.

Review the result

Use probabilities, confidence, feature breakdown, suspicious segments, and rationale as review evidence, not proof.

Resume drafts

Writing documents autosave server-side so students can return to the latest draft and restore snapshots.

Buy tokens

Use billing packages and checkout endpoints to add tokens through Paystack when balances are low.

Qualify referrals

Referral bonuses are waived until the referred account completes a token purchase.

Scan request

{
  "text": "At least 50 characters of text to review",
  "file_id": null,
  "webhook_url": "https://example.com/oraclewriter/webhook",
  "metadata": {
    "assignment_id": "ENG-204"
  }
}

Scan result fields

probabilities: human, ai, and hybrid likelihoods
confidence_level: low, medium, or high
overall_score: normalized review score
feature_breakdown: signals that influenced the result
suspicious_segments: highlighted passages with reasons
disclaimer: reminder that scans require human review

Endpoint reference

Customer API routes

Protected routes accept bearer tokens. File upload uses multipart/form-data; other write endpoints use JSON.

GET/health

Check whether the API service is available. No authentication required.

POST/v1/auth/register

Create an account. Optional referral_code is accepted, but the referrer is rewarded only after the new user buys tokens.

POST/v1/auth/login

Exchange email and password for a short-lived bearer token.

GET/v1/me

Return the signed-in user, token balance, and referral code.

POST/v1/files/upload

Upload TXT, DOCX, or PDF and receive extracted text plus a file_id for scanning.

POST/v1/scans

Create a probabilistic AI-authorship scan from raw text or a previous upload.

GET/v1/scans

List the latest scans for the authenticated user.

GET/v1/scans/{scan_id}

Fetch status, probabilities, rationale, suspicious segments, and model metadata.

GET/v1/scans/{scan_id}/report

Download a report payload for a completed scan.

DELETE/v1/scans/{scan_id}

Delete one of the authenticated user's scans.

POST/v1/writing-documents

Create an editable student draft for the Writing Partner.

GET/v1/writing-documents

List saved writing drafts for the authenticated user.

GET/v1/writing-documents/{document_id}

Load editable HTML, plain text, references, and timestamps for one draft.

PUT/v1/writing-documents/{document_id}

Autosave the latest draft content and references.

GET/v1/writing-documents/{document_id}/versions

List recent version snapshots for a draft.

POST/v1/writing-documents/{document_id}/versions/{version_id}/restore

Restore an older draft version into the current editable draft.

DELETE/v1/writing-documents/{document_id}

Delete one saved writing draft.

GET/v1/billing/balance

Return the user's token balance, scan cost, writing-action cost, referral reward, and referral code.

GET/v1/billing/packages

List active token packages available for checkout.

POST/v1/billing/checkout

Start a Paystack checkout for a token package.

POST/v1/billing/verify

Verify a returned Paystack reference and credit purchased tokens for the authenticated user.

GET/v1/billing/transactions

List recent token package purchases for the authenticated user.

POST/v1/billing/writing-action

Debit tokens for rewrite, humanize, chat, or citation writing actions.

GET/v1/billing/referral

Return referral link and qualified referral count.

POST/v1/billing/paystack/webhook

Receive signed Paystack charge.success events and credit token purchases after server-side verification.