Skip to main content

Overview

The OpsHub NAV API provides programmatic access to all platform functionality. The API is organized into several categories:

Base URL

https://api.opshub.nomark.ai/v1
All API requests must use HTTPS. HTTP requests will be redirected to HTTPS.

Authentication

OpsHub uses JWT-based authentication via Supabase Auth.

Getting an API Key

1

Sign in to OpsHub

Navigate to opshub.nomark.ai and sign in
2

Navigate to Settings

Go to Settings > API Keys
3

Generate New Key

Click Generate API Key and copy the key
4

Store Securely

Store your API key securely - it will only be shown once

Authentication Methods

  • Bearer Token
  • Service Role
  • Supabase Client
Include your API key in the Authorization header:
curl https://api.opshub.nomark.ai/v1/portfolios \
  -H "Authorization: Bearer YOUR_API_KEY"
Never expose your API key or service role key in client-side code. Use environment variables and backend proxies.

Rate Limiting

API requests are rate-limited to ensure fair usage:
TierRequests/MinuteRequests/HourRequests/Day
Free601,00010,000
Pro30010,000100,000
EnterpriseUnlimitedUnlimitedUnlimited
Rate limit headers are included in all responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1640995200

Response Format

All API responses use JSON format with consistent structure:

Success Response

{
  "data": {
    // Response data
  },
  "meta": {
    "timestamp": "2024-01-15T12:00:00Z",
    "request_id": "req_abc123"
  }
}

Error Response

{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Portfolio ID is required",
    "details": {
      "field": "portfolio_id",
      "reason": "missing_required_field"
    }
  },
  "meta": {
    "timestamp": "2024-01-15T12:00:00Z",
    "request_id": "req_abc123"
  }
}

Error Codes

CodeHTTP StatusDescription
INVALID_REQUEST400Request parameters are invalid
UNAUTHORIZED401Authentication credentials are missing or invalid
FORBIDDEN403You don’t have permission to access this resource
NOT_FOUND404The requested resource doesn’t exist
CONFLICT409Request conflicts with existing resource
VALIDATION_ERROR422Validation failed for one or more fields
RATE_LIMIT_EXCEEDED429Too many requests, please slow down
INTERNAL_ERROR500An internal server error occurred
SERVICE_UNAVAILABLE503Service is temporarily unavailable

Pagination

List endpoints support cursor-based pagination:
GET /v1/portfolios?limit=20&cursor=eyJpZCI6IjEyMyJ9
Parameters:
  • limit - Number of items per page (default: 20, max: 100)
  • cursor - Cursor from previous response for next page
Response:
{
  "data": [...],
  "meta": {
    "next_cursor": "eyJpZCI6IjE0MyJ9",
    "has_more": true
  }
}

Filtering & Sorting

Use query parameters to filter and sort results:
# Filter portfolios by type
GET /v1/portfolios?portfolio_type=EQUITY

# Sort by creation date
GET /v1/portfolios?sort=created_at:desc

# Multiple filters
GET /v1/portfolios?portfolio_type=EQUITY&status=ACTIVE&sort=name:asc
Supported operators:
  • eq - Equal to (default)
  • neq - Not equal to
  • gt - Greater than
  • gte - Greater than or equal
  • lt - Less than
  • lte - Less than or equal
  • like - Pattern match
  • in - Value in list
Example with operators:
GET /v1/holdings?market_value=gte:1000000&position_date=eq:2024-01-15

Webhooks

Subscribe to real-time events via webhooks:
1

Create Webhook Endpoint

Go to Settings > Webhooks and create a new endpoint
2

Choose Events

Select which events to receive:
  • portfolio.created
  • portfolio.updated
  • validation.breach_detected
  • workflow.completed
  • nav.calculated
3

Verify Endpoint

OpsHub will send a verification request to your endpoint
4

Handle Events

Process webhook events in your application
Webhook payload:
{
  "event": "validation.breach_detected",
  "data": {
    "validation_id": "val_123",
    "portfolio_id": "port_456",
    "breach_type": "NAV_VARIANCE",
    "severity": "HIGH"
  },
  "timestamp": "2024-01-15T12:00:00Z",
  "signature": "sha256=..."
}
Verify webhook signatures using the X-OpsHub-Signature header to ensure requests are from OpsHub.

SDK Libraries

Official SDK libraries for popular languages:
npm install @opshub/sdk

import { OpsHub } from '@opshub/sdk';

const client = new OpsHub({
  apiKey: process.env.OPSHUB_API_KEY
});

const portfolios = await client.portfolios.list();

API Versioning

The API uses URL-based versioning:
https://api.opshub.nomark.ai/v1/...
Current version: v1 We maintain backward compatibility within major versions. Breaking changes will result in a new major version (v2, v3, etc.).

Support

Need help with the API?