REST API
Use the REST API directly when your product already owns the workflow and needs structured CAS output in your own backend or app flow.
Base URL
Section titled “Base URL”https://api.portfoliointel.co.in
Authentication
Section titled “Authentication”Pass your API key as a header:
X-API-Key: sk_live_*Authorization: Bearer sk_live_*
Parse a CAS
Section titled “Parse a CAS”curl -X POST https://api.portfoliointel.co.in/api/v1/parse \ -H "X-API-Key: sk_live_YOUR_KEY" \ -F "file=@cas.pdf" \ -F "password=optional-pdf-password"import fs from 'node:fs';
const form = new FormData();form.append('file', new Blob([fs.readFileSync('cas.pdf')]), 'cas.pdf');
const res = await fetch('https://api.portfoliointel.co.in/api/v1/parse', { method: 'POST', headers: { 'X-API-Key': process.env.PI_KEY! }, body: form,});const { data } = await res.json();console.log(data.snapshot_id);import os, requests
with open('cas.pdf', 'rb') as f: r = requests.post( 'https://api.portfoliointel.co.in/api/v1/parse', headers={'X-API-Key': os.environ['PI_KEY']}, files={'file': f}, )data = r.json()['data']print(data['snapshot_id'])