Base address: https://api.2minutestore.com/nigraan/v1

Keys

Every call carries your secret key: Authorization: Bearer ngk_live_…. Keep it on your server, never in an app or web page. Ask us to revoke a key at once if it leaks.

  • Live keys (ngk_live_…) give real decisions and count toward your plan.
  • Test keys (ngk_test_…) cost nothing and never learn. They pass everything, unless the text contains nigraan:review or nigraan:block; then you get that answer, so you can build every path.

Check an upload

POST https://api.2minutestore.com/nigraan/v1/checks?wait=8
Authorization: Bearer ngk_live_…
Idempotency-Key: item-123-v2
Content-Type: application/json

{
  "ref": "item-123",
  "title": "Blue lamp",
  "text": "A desk lamp with a warm LED.",
  "images": ["https://cdn.example.com/lamp-front.jpg"],
  "media": [{ "type": "video", "url": "https://cdn.example.com/lamp.mp4" }]
}
  • title up to 300 characters, text up to 20,000; English, Urdu or Roman Urdu.
  • images: up to 5 public links (http or https), each up to 10 MB.
  • media: up to 1 audio or video link, up to 14 MB.
  • ref: your own id for the item (up to 200 characters); it comes back with every answer.
  • wait (0–25 seconds): wait that long for the full answer. Without it, new content answers pending at once and the decision follows by webhook.
  • Idempotency-Key: send the same key again (after a timeout, say) and you get the same check back, never a second one.
HTTP 200  (202 while pending)
{
  "object": "check",
  "id": "cmx…",
  "mode": "live",
  "ref": "item-123",
  "status": "done",            // pending | done
  "verdict": "pass",           // pass | review | block
  "category": null,            // e.g. "adult", "counterfeit"
  "reason": null,              // one sentence for your reviewer
  "instant": true,             // answered from what was seen before
  "created_at": "…",
  "completed_at": "…"
}

pass: show it. review: keep it hidden until your reviewer decides. block: keep it hidden; your reviewer can still clear it.

Never make your users wait

Do not keep your user on a loading screen while a check runs. The usual pattern:

  1. Save the upload at once as pending. The uploader sees it; other people see it after the decision.
  2. Send us the links to its photos, audio or video, not the files, so the upload itself is never slowed.
  3. Call POST /checks without wait. New content answers pending at once.
  4. The decision arrives by webhook: show it on pass, keep it hidden on review or block.

Short text can use wait instead and usually gets the full answer in the same request.

Read a check

GET https://api.2minutestore.com/nigraan/v1/checks/{id}

Tell us your reviewer's decision

When your reviewer clears or hides an item, send it. The same content is then decided the same way instantly, and copies of photos your reviewers hide are stopped at once. Live keys only.

POST https://api.2minutestore.com/nigraan/v1/decisions
{ "check_id": "cmx…", "decision": "hide", "category": "adult", "reason": "nude photo" }

Your levels

GET https://api.2minutestore.com/nigraan/v1/policy
PUT https://api.2minutestore.com/nigraan/v1/policy   { "policy": { "passScore": 92, "categories": { "adult": "strict", "political": "off" } } }

Levels per category: off, lenient, standard, strict. Categories that are illegal in Pakistan are never switched off (they become lenient).

Webhooks

Give us an https address and we POST every finished decision there: { "type": "check.completed", "created_at": "…", "data": { …the check… } }. Answer with any 2xx. If your server does not answer, we try again after 1, 5 and 30 minutes, then 2, 6 and 12 hours.

Every webhook is signed: header Nigraan-Signature: t=…,v1=…. Check it with your webhook secret before trusting the body:

import crypto from 'crypto';

// rawBody = the request body exactly as received (a string), header = req.headers['nigraan-signature']
function fromNigraan(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // older than 5 minutes
  const want = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return crypto.timingSafeEqual(Buffer.from(want, 'hex'), Buffer.from(parts.v1 || '', 'hex'));
}

Errors and limits

  • 400: something in the request is wrong; the message says what.
  • 401: missing, wrong or revoked key, or the account is paused.
  • 404: no such check for your account. 409: that check is not finished yet.
  • 429: per-minute or monthly limit reached; the message says which.

If Nigraan does not answer within your own time limit, follow your outage rule: hold the upload until the answer comes, or let it through and check it later.