Skip to main content
SevrelDocumentation
← Back to App
Documentation menu

API Reference

The Sevrel REST API powers all platform functionality. All endpoints are served from https://api.sevrel.com and require authentication unless noted otherwise.

Base URL

https://api.sevrel.com

All request and response bodies are JSON. Authenticated endpoints require a valid session cookie obtained via the Azure authentication flow.

Authentication

Sevrel uses cookie-based sessions. Authenticate via Microsoft Entra ID, then use the returned session cookie for all subsequent requests. Cookies are HttpOnly, Secure, SameSite=Lax.

POST/api/auth/azureBearer (Azure token)

Exchange a Microsoft Entra ID access token for a Sevrel session cookie. The backend validates the Azure token against Microsoft JWKS (signature, audience, issuer, expiry). On success, sets a signed HttpOnly session cookie.

Request Body

// Headers
Authorization: Bearer <azure_access_token>

Response

// Set-Cookie header returned
// 200 OK
{
  "id": "uuid",
  "email": "user@org.com",
  "name": "Jane Doe",
  "role": "member"
}
GET/api/auth/meCookie

Returns the currently authenticated user's profile, including role and organization membership.

Response

{
  "id": "uuid",
  "email": "user@org.com",
  "name": "Jane Doe",
  "role": "member",
  "organization_id": "uuid",
  "organization_name": "Acme CRE"
}
POST/api/auth/logoutCookie

Invalidates the session cookie and clears the server-side session.

GET/api/auth/sessionsCookie

List all active sessions for the current user, including IP address, user agent, and timestamps. Useful for security auditing.

Response

{
  "sessions": [
    {
      "id": "uuid",
      "ip_address": "203.0.113.1",
      "user_agent": "Mozilla/5.0...",
      "created_at": "2026-03-17T08:00:00Z",
      "last_active": "2026-03-17T10:30:00Z"
    }
  ]
}
DELETE/api/auth/sessions/{id}Cookie

Revoke a specific session by ID. The user is signed out of that device or browser.

POST/api/auth/logout-allCookie

Revoke all active sessions for the current user across all devices. Returns the count of revoked sessions.

Response

{ "ok": true, "revokedSessions": 3 }

Chat

The core intelligence layer. Send questions about your documents and receive AI-generated answers with source citations. Supports both streaming (SSE) and synchronous modes.

POST/api/chat/streamCookie

Send a message and receive a streaming response via Server-Sent Events. The AI searches your connected documents, retrieves relevant sections, and streams an answer with inline citations. Supports optional file attachments.

Request Body

{
  "messages": [
    { "role": "user", "content": "What is the CAM for Bal Harbour 2025?" }
  ],
  "conversation_id": "uuid (optional)",
  "attachments": ["uuid (optional)"]
}

Response

// SSE stream
data: {"type": "thinking", "content": "Searching for CAM..."}
data: {"type": "content", "content": "The CAM charges for..."}
data: {"type": "evidence", "sources": [...]}
data: {"type": "done"}
POST/api/chatCookie

Synchronous (non-streaming) chat endpoint. Returns the complete response with evidence in a single JSON payload.

Request Body

{
  "messages": [
    { "role": "user", "content": "List all lease expirations in 2026." }
  ],
  "conversation_id": "uuid (optional)"
}

Response

{
  "response": "Based on your documents, the following...",
  "evidence": [
    {
      "source": "Lease_TenantXYZ_2023.pdf",
      "snippet": "Lease term expires December 31, 2026...",
      "page": 3
    }
  ]
}
POST/api/attachmentsCookie

Upload a file attachment for use in the next chat message. Accepts PDF, DOCX, XLSX, and text files via multipart form data.

Request Body

// Content-Type: multipart/form-data
// Field: file (binary)

Response

{
  "id": "uuid",
  "filename": "report.pdf",
  "size_bytes": 245760,
  "content_type": "application/pdf"
}

Conversations

Manage chat conversation history. Conversations persist messages and associated evidence for later review and sharing.

GET/api/conversationsCookie

List all conversations for the authenticated user. Evidence is stripped for performance — use the single conversation endpoint for full details.

Response

{
  "conversations": [
    {
      "id": "uuid",
      "title": "CAM Analysis Q4 2025",
      "created_at": "2026-03-15T10:00:00Z",
      "message_count": 8
    }
  ]
}
GET/api/conversations/{id}Cookie

Retrieve a single conversation with full message history and evidence citations.

Response

{
  "id": "uuid",
  "title": "CAM Analysis Q4 2025",
  "messages": [...],
  "evidence": [...]
}
POST/api/conversationsCookie

Create a new empty conversation.

Request Body

{ "title": "Optional title" }

Response

{ "id": "uuid", "title": "Optional title", "created_at": "..." }
DELETE/api/conversations/{id}Cookie

Delete a conversation and all associated messages. Returns 204 No Content on success.

Documents & Egnyte

Browse and search your connected Egnyte document library. Sevrel reads documents in real time — no separate indexing step required.

GET/api/documents/browse?path={folder_path}Cookie

Browse Egnyte folder contents. Returns folders and files at the specified path, respecting your organization's base path configuration.

Response

{
  "folders": [
    { "name": "Leases", "path": "/Shared/All/Property1/Leases" }
  ],
  "files": [
    {
      "name": "Lease_TenantA_2024.pdf",
      "path": "/Shared/All/Property1/Leases/Lease_TenantA_2024.pdf",
      "size": 524288,
      "modified": "2026-01-15T08:00:00Z"
    }
  ]
}
GET/api/documents/search?q={query}Cookie

Full-text search across your Egnyte documents. Returns matching files with relevant text snippets.

Response

{
  "results": [
    {
      "name": "OpEx_Budget_2025.xlsx",
      "path": "/Shared/All/Property1/Financials/OpEx_Budget_2025.xlsx",
      "snippet": "Total CAM charges for 2025: $1,245,000...",
      "score": 0.92
    }
  ]
}
POST/api/documents/ingestCookie

Upload and ingest a local document for text extraction and use in chat. Accepts multipart form data with PDF, DOCX, XLSX, or text files.

Request Body

// Content-Type: multipart/form-data
// Field: file (binary)

Response

{
  "id": "uuid",
  "filename": "report.pdf",
  "status": "processed",
  "chunk_count": 42
}

Agents

Specialized AI workflows for common commercial real estate tasks. Each agent runs a multi-step pipeline and produces structured artifacts.

GET/api/agentsCookie

List all available agents with their descriptions, required inputs, and pipeline step definitions.

Response

{
  "agents": [
    {
      "slug": "loi-generator",
      "name": "LOI Generator",
      "description": "Generate letters of intent from historical patterns",
      "inputs": ["property_name", "tenant_name", "deal_terms"],
      "steps": 7
    }
  ]
}
POST/api/agents/{slug}/runCookie

Execute an agent pipeline. Returns a Server-Sent Events stream with step progress, intermediate results, and final artifacts.

Request Body

{
  "inputs": {
    "property_name": "Pembroke Lakes Square",
    "tenant_name": "Acme Retail",
    "deal_terms": "5-year term, 2,500 SF, $45 PSF NNN"
  }
}

Response

// SSE stream
data: {"step": 1, "status": "running", "title": "Searching historical LOIs..."}
data: {"step": 1, "status": "complete", "result": "Found 5 matching LOIs"}
data: {"step": 7, "status": "complete", "artifacts": [...]}
data: {"type": "done", "run_id": "uuid"}
POST/api/agents/{slug}/stopCookie

Cancel a running agent pipeline.

Request Body

{ "run_id": "uuid" }

Portfolio

Manage properties, tenants, and leases. The portfolio layer provides structured data for dashboard analytics and critical date tracking.

GET/api/portfolio/summaryCookie

Portfolio-level summary including property count, total square footage, occupancy rate, and key metrics.

Response

{
  "properties": [...],
  "metrics": {
    "total_properties": 12,
    "total_sqft": 1250000,
    "occupancy_rate": 0.94,
    "avg_rent_psf": 42.50
  }
}
GET/api/portfolio/propertiesCookie

List all properties with their tenants, lease counts, and key data points.

Response

{
  "properties": [
    {
      "id": "uuid",
      "name": "Pembroke Lakes Square",
      "address": "...",
      "sqft": 250000,
      "tenant_count": 42,
      "occupancy": 0.96
    }
  ]
}
POST/api/portfolio/bulk-import/leasesCookie

Bulk import lease records (max 100 per request). Creates or updates leases with associated tenant and property references.

Request Body

{
  "leases": [
    {
      "tenant_name": "Acme Retail",
      "property_name": "Pembroke Lakes Square",
      "start_date": "2024-01-01",
      "end_date": "2029-12-31",
      "sqft": 2500,
      "annual_rent": 112500
    }
  ]
}
GET/api/portfolio/setup-statusCookie

Returns onboarding progress — which setup steps are complete (Egnyte connected, properties imported, first query run, etc.).

Critical Dates

Track time-sensitive lease events — expirations, renewal deadlines, rent escalations, and option exercise dates. Classified by urgency tier for proactive monitoring.

GET/api/critical-datesCookie

List critical dates with optional filters for property, status, and urgency.

Response

{
  "dates": [
    {
      "id": "uuid",
      "date_type": "lease_expiration",
      "date": "2026-06-30",
      "property": "Bal Harbour Square",
      "tenant": "Luxury Brand Co",
      "status": "upcoming",
      "severity": "critical_30d",
      "days_until": 28
    }
  ]
}
PUT/api/critical-dates/{id}/statusCookie

Update the status of a critical date (upcoming, acknowledged, actioned, expired) with optional notes.

Request Body

{
  "status": "acknowledged",
  "notes": "Renewal negotiation in progress with tenant."
}
POST/api/critical-datesCookie

Manually create a critical date entry.

Request Body

{
  "date_type": "option_exercise",
  "date": "2026-09-15",
  "property_id": "uuid",
  "tenant_id": "uuid",
  "notes": "Tenant has 5-year renewal option"
}
GET/api/critical-dates/export?format=csvCookie

Export critical dates as CSV or JSON for offline analysis or reporting.

DELETE/api/critical-dates/{id}Cookie

Delete a critical date entry. Returns 204 No Content.

Query Templates

Pre-built and user-saved query templates for common commercial real estate questions. Categories include financial analysis, lease review, portfolio comparison, and due diligence.

GET/api/query-templates?category={category}Cookie

List query templates, optionally filtered by category (financial, lease, portfolio, due_diligence).

Response

{
  "templates": [
    {
      "id": "uuid",
      "title": "Compare CAM Charges",
      "template_text": "Compare CAM charges for {property} across {year1} and {year2}.",
      "category": "financial",
      "is_system": true,
      "usage_count": 45
    }
  ]
}
POST/api/query-templatesCookie

Create a custom query template.

Request Body

{
  "title": "Tenant Renewal Status",
  "template_text": "What is the renewal status for {tenant} at {property}?",
  "category": "lease"
}
GET/api/query-templates/parameters/optionsCookie

Returns dropdown options for template parameters — available property names, tenant names, and fiscal years.

Dashboard (Roadmap)

Roadmap — not yet available

The portfolio analytics dashboard endpoints listed below are part of the Sevrel roadmap and are not currently mounted in production. They represent planned functionality and are documented here for reference only. Contact support for early access or timelines.

Planned portfolio analytics and operational intelligence endpoints designed to power a future dashboard with real-time metrics, risk scoring, and trend analysis.

GET/api/dashboard/overviewCookie

Aggregated portfolio overview with key performance indicators, alerts, and recent activity.

GET/api/dashboard/summaryCookie

Portfolio summary including property-level occupancy, revenue, and tenant metrics.

GET/api/dashboard/tenant-riskCookie

Risk scores (0-100) per tenant with contributing factors: expiry proximity, concentration risk, renewal options, space size, and critical date counts.

Response

{
  "tenants": [
    {
      "name": "Anchor Retail Inc",
      "risk_score": 72,
      "tier": "high",
      "factors": {
        "expiry_proximity": 0.9,
        "concentration": 0.7,
        "renewal_options": 0.3
      }
    }
  ]
}
GET/api/dashboard/lease-rolloverCookie

Rent expiring by quarter for rollover analysis. Shows quarterly exposure with the peak quarter highlighted.

GET/api/dashboard/concentrationCookie

Tenant, property, and industry concentration metrics with auto-generated alerts when thresholds are exceeded.

GET/api/dashboard/morning-briefingCookie

Daily briefing: action-required items (within 30 days), attention items (within 90 days), and FYI items (within 365 days).

GET/api/dashboard/health-scoreCookie

Portfolio health score (0-100) based on occupancy, data freshness, critical date coverage, and document availability.

GET/api/dashboard/weekly-summaryCookie

Weekly report with per-property occupancy, revenue, upcoming expirations, and rent escalations.

GET/api/dashboard/stale-dataCookie

Data quality indicators. Flags stale documents, missing lease data, and properties without recent updates.

GET/api/dashboard/rent-escalationsCookie

Upcoming rent escalation calendar with monthly increase amounts.

GET/api/dashboard/activity-feedCookie

Recent activity stream: queries, agent runs, document updates, and critical date changes.

GET/api/dashboard/property/{id}Cookie

Single-property deep dive with tenant list, financial metrics, critical dates, and document coverage.

GET/api/dashboard/tenant/{name}Cookie

Tenant deep dive across all properties: lease terms, rent details, risk factors, and related documents.

GET/api/dashboard/compare/tenantsCookie

Side-by-side tenant comparison on rent, lease terms, risk scores, and space utilization.

GET/api/dashboard/compare/propertiesCookie

Side-by-side property comparison on occupancy, revenue, tenant mix, and data quality.

GET/api/dashboard/rent-roll/{id}Cookie

Rent roll for a specific property showing all tenants, suite numbers, lease terms, and monthly rent.

GET/api/dashboard/financial-anomaliesCookie

Unified view of financial anomalies across your portfolio: NOI drift, CapEx irregularities, and rent anomalies detected by automated watchdogs.

GET/api/dashboard/rent-reconciliationCookie

Lease data quality checks and rent escalation compliance. Compares lease terms against actual payment data to identify discrepancies.

Scheduled Reports

Configure recurring reports delivered via email. Supports weekly summaries, critical date digests, and custom report types.

GET/api/reportsCookie

List all scheduled reports for the authenticated user.

POST/api/reportsCookie

Create a new scheduled report.

Request Body

{
  "report_type": "weekly_summary",
  "cadence": "weekly",
  "recipients": ["user@org.com"],
  "config": { "property_ids": ["uuid"] }
}
PATCH/api/reports/{id}Cookie

Update a scheduled report's cadence, recipients, or configuration.

POST/api/reports/{id}/runCookie

Immediately execute a scheduled report (out-of-band from its regular cadence).

DELETE/api/reports/{id}Cookie

Delete a scheduled report. Returns 204 No Content.

Organizations (Admin)

Multi-tenant organization management. Admin-only endpoints for creating organizations, managing users, and monitoring usage.

GET/api/organizationsCookie (admin)

List all organizations with user counts and creation dates.

Response

{
  "organizations": [
    {
      "id": "uuid",
      "name": "Acme CRE Partners",
      "slug": "acme-cre",
      "user_count": 8,
      "created_at": "2026-01-15T00:00:00Z"
    }
  ],
  "total": 5
}
POST/api/organizationsCookie (admin)

Create a new organization.

Request Body

{
  "name": "Acme CRE Partners",
  "slug": "acme-cre",
  "egnyte_domain": "acme.egnyte.com"
}
GET/api/organizations/{org_id}/usersCookie (admin)

List all users in an organization with their roles.

POST/api/organizations/{org_id}/usersCookie (admin)

Assign a user to an organization.

Request Body

{ "user_id": "uuid" }
PATCH/api/organizations/{org_id}/users/{user_id}/roleCookie (admin)

Update a user's role within an organization.

Request Body

{ "role": "admin" }
DELETE/api/organizations/{org_id}/users/{user_id}Cookie (admin)

Remove a user from an organization.

GET/api/organizations/{org_id}/usage?days=30Cookie (admin)

Per-organization usage statistics: query count, active users, document searches, and agent runs over the specified period.

GET/api/organizations/usage/summaryCookie (admin)

All-organizations usage overview for platform monitoring.

GET/api/organizations/me/usageCookie

Current user's organization quota and usage — query limits, user counts, and property limits based on subscription tier.

Health

GET/api/health/statusNone

Public health check endpoint. Returns service status for the API, database, LLM, and Egnyte connections.

Response

{
  "status": "healthy",
  "services": {
    "database": "ok",
    "llm": "ok",
    "egnyte": "ok"
  }
}

Rate Limits & Errors

Rate Limits

  • Auth endpoints: Per-IP rate limiting to prevent brute-force attacks.
  • Chat endpoints: Per-user rate limiting based on subscription tier. Free trial: 100 queries/month. Professional: 2,000/month. Enterprise: unlimited.
  • When rate limited, the API returns 429 Too Many Requests with a message indicating when the limit resets.

Error Responses

All errors follow a consistent envelope format:

{
  "detail": "Human-readable error message"
}

// Common status codes:
// 400 — Bad Request (invalid input)
// 401 — Unauthorized (missing or invalid session)
// 403 — Forbidden (insufficient role)
// 404 — Not Found
// 429 — Rate Limited
// 500 — Internal Server Error

Correlation IDs

Every request receives a unique correlation ID, returned in the X-Correlation-ID response header. Include this ID when contacting support about specific request failures.

Questions about the API?

Contact our team for integration support, custom endpoint needs, or enterprise API access.

Last updated: March 17, 2026