Run a KYC request
Create an API key, send ID images plus a liveness video, and handle the KYC decision.
- Authenticate with your API key
- Send a v1 multipart request with front/back images and a liveness video
- Handle the
approved/review/declineddecision
Everything here mirrors the hosted Helios flow. v2 (JSON) and a local simulator are included so you can integrate without a camera.
Time to complete: ~10 minutes
Prerequisites
- Python 3.9+ or Node.js 18+ installed on your machine.
- A SAGEA account. Create account
- A SAGEA API key. Foundry is enabled in Free mode by default, with no credit card required.
- Three test assets:
front.jpg— front of the ID, fully visible, min 1200px wide.back.jpg— back of the ID, fully visible (v1 requires both sides).liveness.mp4— 3–10s selfie video (MP4/MOV/WebM), single face, good light.
Step 1: Get your API key
- Open Foundry → API keys.
- Click Create new key.
- Give the key a name (for example,
helios-kyc) and click Create. - Copy the key to your clipboard. The key appears only once; if you lose it, generate a new one.
- Set the key as an environment variable in your terminal:
Step 2: Prepare your assets
Helios verifies a real person holding a real document. Your client must collect:
| Artifact | Requirements |
|---|---|
front_image | JPG/PNG, ID front fully visible, min 1200px wide |
back_image | JPG/PNG, ID back fully visible (v1 requires both sides; v2 makes it optional) |
liveness_video | MP4/MOV/WebM, 3–10s selfie video, single face, good light, no filters |
Quick sanity check before sending:
Trim or compress to 720p if the video exceeds ~50MB.
Step 3: Send a v1 request
POST https://api.sagea.space/helios/kyc/v1 accepts multipart/form-data. The API key is required; front_image, back_image, and liveness_video are all required.
Step 4: Try v2 (JSON, server-side)
POST https://api.sagea.space/helios/kyc/v2 accepts the same artifacts as base64 JSON — useful when files already live server-side. front_image_b64 and liveness_video_b64 are required; back_image_b64 is optional for single-sided documents.
Use v1 for browser and mobile uploads (multipart streams better) and v2 for back-office pipelines.
Step 5: Handle the decision
Both versions return the same schema:
Branch on decision:
A review example includes reasons:
Simulate a response locally
No camera handy? Stub the endpoint shape so your onboarding logic can be tested without network calls. Swap the stub for the real requests.post(...) call when going live — the schema is identical.
Verify
A successful run returns HTTP 200 with a decision of approved, review, or declined. If it doesn't, check the error table below.
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | API key is incorrect or not set | Run echo $SAGEA_API_KEY to confirm the variable is set |
400 missing_artifact | front_image, back_image (v1), or liveness_video absent | Attach all required files; v2 needs front_image_b64 + liveness_video_b64 minimum |
413 Payload Too Large | Video or images exceed limits (video max ~50MB) | Compress to 720p, trim to 3–10s |
422 spoof_detected | Printed face or screen replay detected | Recapture a live selfie video with no filters |
