Rupam.ai

How a scan runs

Every scan is a session. The integration your key belongs to has a live workflow, and the workflow decides the steps the session goes through. A new API integration starts on your organisation's ready-made Scan workflow; you can choose another published workflow on the integration's page in the dashboard, for example one that adds a quiz or product recommendations.

On an API integration there is no Rupam page in the flow: your server asks the person each question, takes the photo and shows the result, and tells Rupam each answer. With the Scan workflow the steps are:

  1. 1Start a session with POST /v2/sessions. Store session.id.
  2. 2Age check. The session's first step is __age_gate: send the person's age bracket. A person under 18, or one whose age is unknown, ends the session (outcome age_ineligible).
  3. 3Notice and consent. Read the session: current_render holds the notice text. Show it, then send the person's decision to __notice_consent.
  4. 4Photo. Ask for an upload grant, upload the photo to it, and answer the photo step with the upload_id. The photo is checked and scanned.
  5. 5Result. When the session reaches its result step, read GET …/result, show it, and confirm it was shown. The session ends with outcome result_delivered.

You never hard-code the order: after each answer, read the session and answer whatever current_step is, by its current_step_type, when step_run_status is awaiting_input. A new created session names its first step the same way. Anything else means Rupam is working: wait poll_after_ms and read again. That way your code keeps working when the workflow changes.

What is billed

CallBilled?
POST /v2/sessionsNo. Starting a session is free; the daily and per-minute limits still count it
The photo stepOne scan per session, billed when the skin scan succeeds. A refused or rejected photo is not billed, and neither is a session cancelled or ended before its scan succeeded
Confirming the result shownOnly in a workflow without a skin scan (a quiz alone): the session's one unit is billed when its result is first confirmed shown
Every other callNo
No sandbox and no test key. Every call runs against the live service and counts against your plan.

Plans and API access

Prices are on the Pricing page. This is what each plan gives an API customer.

FreeStarterGrowthProfessional
Getting API accessOn requestOn requestIncludedIncluded
Scans per plan period1502,50010,00050,000
Sessions started per minute, per integration1050150500
Sessions per day1005002,0008,000
Extra scans, per scanNot available$0.05 (India: ₹3 + GST)$0.035 (India: ₹2.25 + GST)$0.025 (India: ₹1.5 + GST)
Skin conditions returned481215
Result images kept15 minutes15 minutes7 days30 days
Product recommendationsNoYes, up to 50 productsYes, up to 500 productsYes, up to 2,000 products

Free and Starter: request access

In the dashboard, open Integrations and choose Request API Key Access, with your website and what you will use the API for. Our team reviews each request. While it is open the page shows Request pending; if it is declined you can choose Request again. Once it is approved you can create keys.

When access is removed

If the plan no longer includes API access, starting a session answers 403 module_not_in_plan. An account suspended after a failed payment answers 403 org_suspended until it is settled.

Keys and authentication

There is no token exchange. Send your secret key itself, as a Bearer token, on every call:

http
Authorization: Bearer rsk_...

Create a secret key

  1. 1Log in to the Rupam dashboard and open Integrations.
  2. 2Add an API integration to a project. It starts on your organisation's ready-made Scan workflow.
  3. 3On the integration's page, under API keys, choose Create key. Give it a label (for example “Production server”) and, if you want, an expiry date.
  4. 4Copy the key from the dialog. It starts rsk_ and is shown once only.
One key, one integration. A key belongs to its integration, so you never name the integration in a call. Usage, limits and the workflow follow that integration.
Store it like a password, in a secret manager or an environment variable on your server. To change keys without downtime, roll the key: you get a new key at once and the old one keeps working for the overlap you choose. You can also give a key an IP allowlist, or revoke it, which stops it on the next call. A revoked, expired or unknown key answers 401 invalid_credential.

The Idempotency-Key header

Every POST that creates something (a session, a step answer, an upload grant, a consent record) needs an Idempotency-Key header of up to 255 characters. Without it the answer is 400 idempotency_key_required.

  • Use a new value (a UUID) for each new request.
  • After a network error or a timeout, retry with the same value. You get the first answer again, with Idempotent-Replayed: true, and nothing happens twice.
  • The same value with a different body is 422 idempotency_key_reused.
  • An upload grant holds a secret, so it is never replayed: a retry is 409 idempotency_secret_not_replayable. Ask for a new grant with a new value.
  • …/cancel and …/redeem take no Idempotency-Key.

Publishable keys (rpk_)

Some integrations also offer a publishable key, for browser pages. It can only start a session (POST /v2/sessions) and read GET /v2/sessions/bootstrap, and only from the sites listed in the integration's allowed origins; anywhere else it answers 403 origin_not_allowed. Everything else on this page needs the secret key.

Every call a key can make

These are all the routes that answer a key. Every other /v2 route is for the dashboard and answers a key with 401 token_audience or 403 scope_missing.

CallKeyWhat it does
POST /v2/sessionsrsk_, rpk_Start a session on the key's integration
GET /v2/sessions/{ses_id}rsk_Read the session's status and current step
POST /v2/sessions/{ses_id}/stepsrsk_ (API integrations)Answer the current step
POST /v2/sessions/{ses_id}/upload-grantsrsk_ (API integrations)Get a one-time upload for the photo
GET /v2/sessions/{ses_id}/resultrsk_Read the result
POST /v2/sessions/{ses_id}/redeemrsk_Swap a one-time result handle for the result
POST /v2/sessions/{ses_id}/cancelrsk_Cancel an open session
POST /v2/sessions/{ses_id}/consent-recordsrsk_Record that the person withdrew consent
GET /v2/sessions/bootstraprpk_, rsk_The published workflow's languages and steps, before a session exists
GET /v2/usagersk_Usage by day and the current plan period
GET /v2/plansrsk_The plans on sale, with their prices and limits

Start a session — POST /v2/sessions

POST/v2/sessions

On an API integration the body can be empty ({}): the key names the integration, and the integration's live workflow decides the steps. Unknown fields are refused with 422 validation_failed. Optional fields include locale (the person's language) and correlation_ref (a reference of your own; never put personal data in it).

bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions" \
  -H "Authorization: Bearer $RUPAM_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Response

http
HTTP/1.1 201 Created

{
  "session": {
    "id": "ses_...",
    "status": "created",
    "expires_at": "2026-11-23T11:15:00Z",
    "locale": "en",
    "offered_languages": ["en"],
    "integration_id": "int_...",
    "project_id": "prj_..."
  },
  "client_token": null,
  "capture_url": null
}

A new session reads status: "created" until its first answer. It expires at expires_at; after that, start a new one. client_token and capture_url are nullon an API integration: they belong to flows where the person uses Rupam's own page.

Read the session — GET /v2/sessions/{ses_id}

GET/v2/sessions/{ses_id}
bash
curl -sS "https://api.rupam.ai/v2/sessions/$SES_ID" \
  -H "Authorization: Bearer $RUPAM_KEY"

Response

json
{
  "id": "ses_...",
  "status": "active",
  "outcome": null,
  "seq": 4,
  "current_step": "__notice_consent",
  "current_step_type": "rupam.notice_consent@1.0",
  "current_render": {
    "notice": "...",
    "language": "en",
    "text": "...the notice to show the person...",
    "purposes": ["analysis"]
  },
  "step_run_status": "awaiting_input",
  "retake": null,
  "progress": null,
  "locale": "en",
  "offered_languages": ["en"],
  "expires_at": "2026-11-23T11:15:00Z",
  "poll_after_ms": null
}
FieldMeaning
statuscreated or active while the session is open; completed, cancelled, expired, abandoned or failed once it ended
outcomeOn a completed session: result_delivered, ended_without_result, consent_declined, age_ineligible, minor_mode_completed, not_available, limit_reached or signed_up. Else null
current_stepThe key of the step to answer now, or null
current_step_typeWhat kind of step it is, such as rupam.age_gate@1.0, rupam.notice_consent@1.0, rupam.capture_selfie@1.0, rupam.quiz@1.0 or rupam.result@1.0. Match on the part before @
current_renderWhile the step waits for the person: what to show (the notice text and purposes, the quiz questions, the photo options). Else null
step_run_statusrunning while Rupam works on the step (photo check, scan, product picks): wait and read again. awaiting_input when it waits for you
retakeWhy the photo step is asking again: no_face, multiple_faces, face_too_small, blurry, too_dark, too_bright, image_unreadable, image_too_large, upload_missing, upload_not_image or upload_too_large. Else null
progressWhile the photo or scan runs: stage is queued, checking_photo or analysing
poll_after_msHow long to wait before the next read

The answer carries an ETag: send it back as If-None-Match and an unchanged session answers 304 with no body.

Answer a step — POST /v2/sessions/{ses_id}/steps

POST/v2/sessions/{ses_id}/steps

The body is {"step_key": <current_step>, "input": {…}}. The first answer starts a created session. An input that does not fit the step is 422 validation_failed and the step stays open.

Step typeinputNotes
rupam.age_gate{"bracket": "25-34"}One of under_18, 18-24, 25-34, 35-44, 45-54, 55+, unknown. Ask the person; never guess. With the Scan workflow, under_18 and unknown end the session (outcome age_ineligible); a workflow can instead continue in a mode for minors.
rupam.notice_consent{"decision": "granted"}granted or declined, for every purpose in the notice. Show current_render.text first. A decline ends the session with outcome consent_declined.
rupam.capture_selfie{"upload_id": "upl_…"}The upload from an upload grant. The photo is checked and scanned, which takes a while: read the session again after poll_after_ms.
rupam.quiz{"answers": {…}}Only in workflows with a quiz. The question and option IDs from current_render: see Quizzes.
rupam.result{"shown": true}Send it after you showed the result. The session ends with outcome result_delivered.

The skin scan itself (rupam.skin_scan) and product picks (rupam.recommendations) are system steps: they take no input, and the session moves on by itself while step_run_status is running.

bash
# The age check (always first while current_step is "__age_gate")
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"step_key": "__age_gate", "input": {"bracket": "25-34"}}'

# The notice: send the decision the person made
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"step_key": "__notice_consent", "input": {"decision": "granted"}}'

Response

json
{
  "session_id": "ses_...",
  "status": "active",
  "outcome": null,
  "current_step": "capture",
  "step_run_id": "...",
  "awaiting": true,
  "in_line": null,
  "code": null,
  "client": null
}

in_line (position, estimate_s, retry_after_s) appears while the scan waits in the queue. A step type you don't know belongs to a workflow this page does not cover: show what current_render holds, or move the integration to the Scan workflow.

Upload the photo — POST /v2/sessions/{ses_id}/upload-grants

POST/v2/sessions/{ses_id}/upload-grants

When current_step is the photo step, ask for a grant with the photo's content_type: image/jpeg, image/png or image/webp. The answer (201) is a one-time upload: upload_id, method, url, fields and expires_at.

  • When method is POST, send a multipart form to url with every entry of fields as a form field, then the photo last, as the field file.
  • When method is PUT, send the photo as the body and every entry of fields as a header.
  • Do not send your Authorization header to the upload URL.
  • Photos up to 10 MB. A grant is a secret: don't log it.
bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/upload-grants" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"content_type": "image/jpeg"}'

# 201: {"upload_id": "upl_...", "method": "POST", "url": "https://...", "fields": {...}, "expires_at": "..."}
# Then send the photo to that url: every entry of fields as a form field, the photo last as "file".
# No Authorization header on this upload.
curl -sS -X POST "$UPLOAD_URL" --form-string "key=..." --form-string "..." -F "file=@face.jpg"

# Then answer the photo step with the upload_id
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d "{\"step_key\": \"$STEP\", \"input\": {\"upload_id\": \"$UPLOAD_ID\"}}"
If the photo can't be used, the session goes back to the photo step and retake says why (for example no_face or blurry). Ask the person for a new photo and take a new grant. A refused photo is not billed.

Photo tips for the person

Only one person in the frame, face filling a good part of the photo, front-facing, even diffuse light, no sunglasses or mask, camera about arm's length away.

Quizzes

A workflow can ask the person a short quiz (for example about how their skin feels) as one of its steps. You build the quiz and add it to a workflow in the dashboard. When the session reaches it, current_step_type is rupam.quiz@… and current_renderholds the questions in the session's language:

json
"current_step": "skin_quiz",
"current_step_type": "rupam.quiz@1.0",
"step_run_status": "awaiting_input",
"current_render": {
  "questions": [
    {
      "id": "q_skin_feel",
      "kind": "single",
      "required": true,
      "text": "How does your skin feel by midday?",
      "options": [
        { "id": "o_oily", "text": "Shiny all over" },
        { "id": "o_combo", "text": "Shiny on the forehead and nose only" },
        { "id": "o_dry", "text": "Tight or flaky" }
      ]
    },
    {
      "id": "q_concerns",
      "kind": "multi",
      "required": false,
      "text": "What would you like to work on?",
      "options": [
        { "id": "o_spots", "text": "Spots" },
        { "id": "o_tone", "text": "Uneven tone" }
      ]
    }
  ]
}
  • Show each question's text and its options. A text can be null when the quiz has none in that language.
  • Answer with {"answers": {<question id>: …}}: one option ID for a single question, a list of option IDs for a multi question.
  • Option IDs only, never free text. Every question with required: true must be answered. A wrong answer is 422 validation_failed and the quiz stays open.
  • When the workflow also has product recommendations, the answers can shape the picks.
bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"step_key": "skin_quiz", "input": {"answers": {
        "q_skin_feel": "o_combo",
        "q_concerns": ["o_spots", "o_tone"]
      }}}'

Read the result — GET /v2/sessions/{ses_id}/result

GET/v2/sessions/{ses_id}/result

The result exists once the session reaches its result step. Until then the answer is 409 result_not_ready: read the session and try again. It stays readable after the session ended.

bash
curl -sS "https://api.rupam.ai/v2/sessions/$SES_ID/result" \
  -H "Authorization: Bearer $RUPAM_KEY"

Response

json
{
  "session_id": "ses_...",
  "status": "active",
  "outcome": null,
  "result_step": "result",
  "delivered": false,
  "steps": [
    // one entry per completed step: step_key, step_type, outcome, output
  ],
  "skin_result": {
    "scan_id": "...",
    "scanned_at": "2026-11-23T10:15:02Z",
    "overall": { "score": 72, "grade": "B", "served_severity": "...", "display_text": "..." },
    "skin_profile": {
      "skin_tone": { "category": "...", "ita_angle": 28.4, "fitzpatrick_estimate": 4, "skin_tone_label": "..." },
      "skin_type": { "classification": "combination", "confidence": 0.81, "score": 3 }
    },
    "conditions": [
      {
        "key": "acne",
        "name": "Acne",
        "score": 91,
        "grade": "A",
        "served_severity": "...",
        "tier": "...",
        "display_text": "...",
        "confidence": 0.84,
        "overlays": [{ "object_id": "obj_...", "kind": "acne_overlay" }],
        "age_estimate": null,
        "age_range": null,
        "dominant_depth": null,
        "distribution": null
      }
      // ...one entry per condition in your plan
    ],
    "face_overlays": [{ "object_id": "obj_...", "kind": "..." }],
    "advice": [
      { "suggestions_key": "...", "condition_key": "acne", "category": "...", "priority": "...", "text": "...", "routine_slot": "..." }
    ],
    "stamp": { "model_set_id": "...", "model_set_label": "...", "threshold_set_id": "...", "threshold_set_label": "..." }
  },
  "product_block": null,
  "client": null
}
FieldMeaning
skin_result.overallThe overall score (0–100), its grade and severity, and display_text to show
skin_result.conditions[]One entry per condition in your plan (see the Conditions reference): key, name, score (0–100, higher is clearer skin), grade, served_severity, tier, confidence and the overlays drawn for it. For skin_age, show age_estimate and age_range instead of the score
skin_result.skin_profileskin_tone (category, ita_angle, fitzpatrick_estimate, skin_tone_label) and skin_type (classification, confidence, score). The skin tone is an estimate from the photo's colours, not a clinical grading
skin_result.advice[]Care suggestions per condition, with category, priority, text and routine_slot
skin_result.stampWhich model set and threshold set produced the result. Quote it when you contact us
product_blockYour own products, ranked for this result, when the workflow has a recommendations step. See Product recommendations
steps[]Each completed step: step_key, step_type, outcome and its output (IDs and scores only)
deliveredtrue once you confirmed the result was shown
Overlay images. overlays and face_overlays name each image by object_id and kind. The image files themselves are not served to API keys yet.
Then confirm it was shown. Answer the result step with {"shown": true}:
bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"step_key": "result", "input": {"shown": true}}'
# The session ends: status "completed", outcome "result_delivered". The result stays readable.
The response is read in the session's language (Content-Language). New fields can appear at any time: ignore what you don't know.

Product recommendations

Rupam can rank your own products for each result. Set it up in the dashboard: add your products to a catalogue, publish a recommendations setup, and use a workflow with a recommendations step (rupam.recommendations) after the scan. The step is a system step: it needs no input, and it never makes the scan fail. Which plans include it is in the plans table.

The products arrive in the result's product_block:

product_blockMeaning
nullThe workflow has no recommendations step
{ rec_id, products[], by_concern[], disclaimer, disclosure, consult_notes, routine }The ranked picks. products lists each product with the reason it was picked; by_concern groups them by the conditions found. routine is a morning and evening routine on Growth and Professional, else null
{ status: "empty", reason }Nothing to show: config_missing, disabled, channel_off, no_catalogue or nothing_qualifies
{ status: "degraded", reason }The picks could not be made this time: config_invalid or failed. The skin result is unaffected
Show the disclaimer and disclosure.ranking_explainer wherever you show the products. The picks are cosmetic suggestions, not treatment advice.

More session calls

Cancel a session

POST/v2/sessions/{ses_id}/cancel

No body and no Idempotency-Key. An open session ends cancelled and the answer is the session's status. A session that already ended answers 409 session_closed.

bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/cancel" \
  -H "Authorization: Bearer $RUPAM_KEY"
POST/v2/sessions/{ses_id}/consent-records

When the person withdraws consent through you, record it here, on an open or ended session. Send exactly one record per call. Purposes: analysis, history, evaluation, training, recommendations, marketing, push.

bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/consent-records" \
  -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"records": [{"purpose": "analysis", "event": "withdrawn"}]}'
# 201: {"consent_ids": ["cns_..."]}, or [] when nothing was in use to withdraw

Redeem a result handle

POST/v2/sessions/{ses_id}/redeem

For flows where the person goes to Rupam's capture page and comes back to your site with a result_handle in the URL. Your server swaps the handle for the result, once, within 15 minutes. Every failure answers 400 result_handle_invalid; after that, read the result with GET …/result. API integrations don't need this call.

bash
curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/redeem" \
  -H "Authorization: Bearer $RUPAM_KEY" \
  -H "Content-Type: application/json" \
  -d '{"result_handle": "..."}'

Read the workflow's setup

GET/v2/sessions/bootstrap

The published workflow's offered languages, chosen language and the keys and types of its steps, before any session exists. With a publishable key, also the allowed origins. Writes nothing.

Usage and plans

Read your usage

GET/v2/usage

Give either period_id, or from and to (date-times at most 400 days apart; anything else is 400 range_unbounded). group_by is meter (the default), project, integration or day. A key sees only its own integration's rows. Only billed units are counted.

bash
curl -sS "https://api.rupam.ai/v2/usage?from=2026-11-01T00:00:00Z&to=2026-11-23T00:00:00Z&group_by=day" \
  -H "Authorization: Bearer $RUPAM_KEY"

Response

json
{
  "current_period": { "period_id": "...", "allowance": 10000, "used": 1240, "reserved": 2, "remaining": 8758 },
  "rows": [
    { "day": "2026-11-22", "meter": "session", "project_id": "prj_...", "integration_id": "int_...", "units": 57, "preview_units": 0, "assisted_units": 0 }
  ],
  "time_zone": "Asia/Kolkata"
}

List the plans

GET/v2/plans

The plans on sale, each with plan_key, version, its prices with and without GST, extra-scan rates per 1,000, its modules and quantities (limits).

Conditions Reference

skin_result.conditions[] holds only the conditions in your plan, each under its key. skin_type and skin_tone are in skin_profile on every plan.

ConditionkeyFrom planNotes
AcneacneFreeVisible spots. The overlay outlines them.
PoresporesFreeVisible pores.
Dark circlesdark_circlesFreeUnder-eye area, both eyes.
PigmentationpigmentationFreeUneven tone and spots.
WrinkleswrinklesStarterScore reflects visible wrinkles.
OilinessoilinessStarterVisible shine.
RednessrednessStarterVisible redness on cheeks and nose, measured against the person's own skin.
TexturetextureStarterSurface smoothness.
Skin ageskin_ageGrowthShow age_estimate and age_range instead of the score. It is an apparent age from visible signs. No overlay.
Fine linesfine_linesGrowthEarly lines around the eyes and forehead.
Eye bagseye_bagsGrowthVisible under-eye puffiness.
BlackheadsblackheadsGrowthVisible blackheads.
HydrationhydrationProfessionalVisible dryness. It is not a measure of skin moisture.
MolesmolesProfessionalVisible moles only; not a health assessment. No overlay.
Skin glowskin_glowProfessionalVisible radiance.
Overlays. skin_age and moles never have an overlay. All other conditions do.

Using the Results Responsibly

  • The results are cosmetic, not medical. Describe them as an assessment of visible skin features. Do not present them as a diagnosis or a treatment recommendation.
  • Say that the result comes from AI. Where you show a result or a suggestion, show that it was produced by an automated analysis, and show the disclaimer when you use product recommendations.
  • A face photo is personal data, and the person decides. Show the person the notice from current_render and send the decision they actually made. Never answer the notice or the age check for them. Send only what you need.
  • Treat the skin tone as an estimate. Do not use it to make decisions about a person.

This is guidance for building with the API, not legal advice. See our Privacy Policy and Terms.

Error Responses

Every error is application/problem+json (RFC 9457) with a stable code. Branch on code, never on title. Every answer, error or not, carries a Rupam-Request-Id header: quote it when you contact us.

http
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
Rupam-Request-Id: req_...

{
  "type": "about:blank",
  "title": "Unprocessable Content",
  "status": 422,
  "code": "validation_failed",
  "request_id": "req_...",
  "errors": [{ "field": "/return_url", "code": "..." }]
}

errors[] names each wrong field by JSON pointer (/return_url). On limit_reached the problem also has reason and, where the limit has an end, resets_at (see Rate limits).

Codes you will meet

HTTPcodeWhat it means and what to do
400idempotency_key_requiredThis POST needs an Idempotency-Key header. Every creating POST does.
400result_handle_invalidThe result handle is spent, expired or not this session's. Read the result with GET …/result instead.
401invalid_credentialThe key is unknown, revoked, expired or badly formed.
401token_audienceThis route is for people signed in to the dashboard, not for keys.
403scope_missingThis key may not make this call (for example a publishable key answering a step).
403key_scope_exceededThe key reached outside its own integration.
403create_way_not_allowedThis integration does not start sessions this way.
403origin_not_allowedA publishable key was used from a site that is not in the integration's allowed origins.
403module_not_in_planYour plan does not include this channel or feature.
403org_suspendedThe account is suspended, usually after a failed payment. The account holder must settle it in the dashboard.
403limit_reachedA usage limit was reached. reason says which; resets_at says when it lifts.
404session_not_foundNo such session for this key.
404integration_not_foundThe integration is unknown or switched off.
409session_closedThe session has ended. Start a new one.
409result_not_readyThe session has no result yet, or ended without one. Read the session's status.
409integration_has_no_workflowNo workflow is live on the integration. Choose one on its page in the dashboard.
409idempotency_secret_not_replayableThe first answer held a secret (an upload grant), so it cannot be replayed. Use a new Idempotency-Key.
422validation_failedA field is wrong. errors[] names each one by JSON pointer.
422idempotency_key_reusedThe Idempotency-Key was already used for a different request.
429create_ceilingToo many sessions started on this integration this minute. Wait Retry-After seconds.
429rate_limitedToo many requests from this key. Wait Retry-After seconds.
500internal_errorSomething failed on our side. Retry once, then quote the request_id to us.
503entitlements_unavailableYour plan could not be checked just now. Retry after Retry-After.
503service_busyRupam is busy. Retry after Retry-After.

Other codes exist and more may be added; treat an unknown code by its HTTP status.

What to retry

StatusRetry?
409 result_not_readyYes, after reading the session again
429, 503Yes, after the number of seconds in Retry-After
500Once, with the same Idempotency-Key, then contact us with the request ID
400, 401, 403, 404, other 409, 422No. Fix the cause first

Rate Limits and Quotas

LimitCountsAnswerFreeStarterGrowthProfessional
Per minuteSessions started on one integration429 create_ceiling1050150500
Per daySessions on the whole account403 limit_reached1005002,0008,000
Per plan periodScans on the whole account403 limit_reached1502,50010,00050,000
  • There is no hourly limit.
  • Short bursts are limited per key too: 429 rate_limited.
  • Every 429 and 503 carries Retry-After (seconds). When a limit applies, answers also carry RateLimit-Policy and RateLimit (IETF draft 11).
  • The plan period starts on the day your plan started. With extra scans switched on (Starter and above), scans go on past the period's allowance up to the ceiling you set.
http
RateLimit-Policy: "default";q=<quota>;w=<window seconds>
RateLimit: "default";r=<remaining>;t=<seconds until reset>
Retry-After: <seconds>          # on every 429 and 503

The reason on limit_reached

reasonMeaning
org_allowanceThe plan period's scans are used up (and extra scans are off).
overage_ceilingThe extra-scan ceiling you set in the dashboard is reached.
customer_capA spending cap set on the account is reached.
org_daily_ceilingThe plan's daily limit is reached.
no_active_planThe account has no active plan.
http
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json

{
  "type": "about:blank",
  "title": "Forbidden",
  "status": 403,
  "code": "limit_reached",
  "reason": "org_daily_ceiling",
  "resets_at": { "utc": "2026-11-24T00:00:00Z", "local": "2026-11-24T05:30:00+05:30", "time_zone": "Asia/Kolkata" },
  "request_id": "req_...",
  "errors": []
}

Webhooks

Not available yet. Rupam does not send webhooks today. To follow a session, read GET /v2/sessions/{ses_id} every poll_after_ms. This section will describe webhooks when they ship.

Quick Start Example

One complete scan on an API integration: start a session, then answer each step the session asks for — age check, notice, photo, result — until it ends. The scripts ask the questions in your terminal, standing in for your app. Download one and run it with your key in RUPAM_KEY and a face photo. Available in cURL (with jq), Python and JavaScript. It is a real scan and counts against your plan.

#!/usr/bin/env bash
# Rupam API v2 quick start: one skin scan, driven from your server.
# Needs: curl, jq and uuidgen.   Usage: RUPAM_KEY=rsk_... ./quickstart-v2.sh face.jpg
# The key is a secret key (rsk_) of an API integration. Keep it on your server.
set -euo pipefail

API="${RUPAM_API:-https://api.rupam.ai}"
KEY="${RUPAM_KEY:?set RUPAM_KEY to your secret key (rsk_...)}"
PHOTO="${1:?usage: $0 face.jpg}"
case "$PHOTO" in *.png) TYPE="image/png" ;; *) TYPE="image/jpeg" ;; esac

call() { # call METHOD PATH [JSON]: one API call; a new Idempotency-Key on every POST
  local method=$1 path=$2 body=${3:-'{}'}
  local args=(-sS -X "$method" "$API$path" -H "Authorization: Bearer $KEY")
  if [ "$method" = POST ]; then args+=(-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" -d "$body"); fi
  local out code
  out=$(curl "${args[@]}" -w $'\n%{http_code}')
  code=${out##*$'\n'}; out=${out%$'\n'*}
  if [ "${code:0:1}" != 2 ]; then echo "$method $path -> $code $(echo "$out" | jq -r '.code // .')" >&2; exit 1; fi
  echo "$out"
}

# 1. Start a session. The key's integration and its live workflow decide the steps.
SES_ID=$(call POST /v2/sessions '{}' | jq -r .session.id)
S="/v2/sessions/$SES_ID"
echo "session $SES_ID"

# 2. Answer each step the session asks for, until it ends.
WAITS=0
while :; do
  ST=$(call GET "$S")
  STATUS=$(echo "$ST" | jq -r .status)
  if [ "$STATUS" != created ] && [ "$STATUS" != active ]; then
    echo "session ended: $STATUS $(echo "$ST" | jq -r '.outcome // ""')"; break
  fi
  STEP=$(echo "$ST" | jq -r '.current_step // ""')
  KIND=$(echo "$ST" | jq -r '.current_step_type // ""')
  RUN=$(echo "$ST" | jq -r '.step_run_status // ""')
  if [ "$STATUS" = created ] && [ -z "$STEP" ]; then
    STEP="__age_gate"; KIND="rupam.age_gate"      # a new session starts at the age check
  elif [ "$STATUS" != created ] && [ "$RUN" != awaiting_input ]; then
    WAITS=$((WAITS + 1))                          # Rupam is working (photo check, scan)
    if [ "$WAITS" -gt 300 ]; then echo "the session did not move on: read it again later" >&2; exit 1; fi
    sleep "$(echo "$ST" | jq -r '((.poll_after_ms // 2000) / 1000)')"; continue
  fi
  WAITS=0
  case "$KIND" in
    rupam.age_gate*)
      read -r -p "Age bracket (under_18, 18-24, 25-34, 35-44, 45-54, 55+, unknown): " BRACKET
      call POST "$S/steps" "$(jq -nc --arg s "$STEP" --arg b "$BRACKET" '{step_key: $s, input: {bracket: $b}}')" >/dev/null ;;
    rupam.notice_consent*)
      echo "$ST" | jq -r .current_render.text
      read -r -p "Does the person agree? (granted/declined): " DECISION
      call POST "$S/steps" "$(jq -nc --arg s "$STEP" --arg d "$DECISION" '{step_key: $s, input: {decision: $d}}')" >/dev/null ;;
    rupam.capture_selfie*)
      RETAKE=$(echo "$ST" | jq -r '.retake // ""')
      if [ -n "$RETAKE" ]; then echo "the photo was refused ($RETAKE): take a new one and run again" >&2; exit 1; fi
      GRANT=$(call POST "$S/upload-grants" "{\"content_type\": \"$TYPE\"}")
      URL=$(echo "$GRANT" | jq -r .url)
      if [ "$(echo "$GRANT" | jq -r .method)" = POST ]; then
        FORM=(); while IFS= read -r kv; do FORM+=(--form-string "$kv"); done < <(echo "$GRANT" | jq -r '.fields | to_entries[] | "\(.key)=\(.value)"')
        curl -sS --fail -X POST "$URL" "${FORM[@]}" -F "file=@$PHOTO;type=$TYPE" >/dev/null
      else
        HDRS=(); while IFS= read -r kv; do HDRS+=(-H "$kv"); done < <(echo "$GRANT" | jq -r '.fields | to_entries[] | "\(.key): \(.value)"')
        curl -sS --fail -X PUT "$URL" "${HDRS[@]}" --data-binary "@$PHOTO" >/dev/null
      fi
      call POST "$S/steps" "$(jq -nc --arg s "$STEP" --arg u "$(echo "$GRANT" | jq -r .upload_id)" '{step_key: $s, input: {upload_id: $u}}')" >/dev/null ;;
    rupam.result*)
      call GET "$S/result" | jq '.skin_result | {overall, conditions: [.conditions[] | {key, score, grade}]}'
      call POST "$S/steps" "$(jq -nc --arg s "$STEP" '{step_key: $s, input: {shown: true}}')" >/dev/null ;;
    *)
      echo "step $STEP ($KIND) is not handled by this example" >&2; exit 1 ;;
  esac
done

API Playground

The API does not run in this page: a secret key belongs on your server, and sessions do not answer other websites. Fill in the values as you go and copy each command into your terminal. Nothing you type here leaves the page.

From step 2. Leave empty to keep $SES_ID.

current_step while the session waits for the photo.

upload_id from the grant in step 5.

current_step once the scan is done (also result_step in the result).

  1. 1. Set your key in your terminal

    Your secret key stays in your own shell. Never paste it into a web page.

    bash
    export RUPAM_KEY="rsk_..."   # your secret key
  2. 2. Start a session

    Copy session.id from the answer into the Session ID field above.

    bash
    curl -sS -X POST "https://api.rupam.ai/v2/sessions" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{}'
  3. 3. Answer the age check

    Ask the person. Never guess the bracket.

    bash
    curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"step_key": "__age_gate", "input": {"bracket": "25-34"}}'
  4. 4. Read the notice, then send the person's decision

    Show current_render.text to the person first.

    bash
    curl -sS "https://api.rupam.ai/v2/sessions/$SES_ID" -H "Authorization: Bearer $RUPAM_KEY"
    
    curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"step_key": "__notice_consent", "input": {"decision": "granted"}}'
  5. 5. Take an upload grant and send the photo

    Use the url and fields from the grant. One --form-string per entry of fields; no Authorization header on the upload.

    bash
    curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/upload-grants" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"content_type": "image/jpeg"}'
    
    curl -sS -X POST "<url from the grant>" \
      --form-string "<field>=<value>" \
      -F "file=@face.jpg;type=image/jpeg"
  6. 6. Answer the photo step

    The step key is the session's current_step while it waits for the photo.

    bash
    curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"step_key": "<photo step>", "input": {"upload_id": "upl_..."}}'
  7. 7. Wait for the scan, then read the result

    Read the session every poll_after_ms until current_step is the result step.

    bash
    curl -sS "https://api.rupam.ai/v2/sessions/$SES_ID" -H "Authorization: Bearer $RUPAM_KEY"
    
    curl -sS "https://api.rupam.ai/v2/sessions/$SES_ID/result" -H "Authorization: Bearer $RUPAM_KEY"
  8. 8. Confirm the result was shown

    The session ends with outcome result_delivered. The result stays readable.

    bash
    curl -sS -X POST "https://api.rupam.ai/v2/sessions/$SES_ID/steps" \
      -H "Authorization: Bearer $RUPAM_KEY" -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{"step_key": "<result step>", "input": {"shown": true}}'

Other Ways to Integrate

The REST API is not the only route. If you would rather not write server code:

OptionWhat it is
Shopify pluginSkin analysis and product recommendations on your Shopify store, installed without code. Available on the paid plans.
Embed and RedirectRupam's own scan page on your site, or a hand-off to it and back. Set up in the dashboard, under Integrations.
White-label engineA custom-branded deployment for larger brands.
Talk to usFor other integration needs.

Getting help

When you write to us, include the Rupam-Request-Id header (or the problem's request_id), the session ID, the time in UTC, the endpoint, the HTTP status and your plan. Never send your API key or a face photo by email.

The API is versioned by its path (/v2). Changes inside /v2 only add things, so your code must ignore fields and values it does not know. A route that is going away first answers Deprecation and Sunset headers.

Ready to integrate?

Create a secret key and start analysing skin in minutes.